}
-/*
- * enter user bio
- */
-void cmd_ebio(void) {
- char buf[256];
- FILE *fp;
-
- if (!(CC->logged_in)) {
- cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
- return;
- }
-
- sprintf(buf,"./bio/%ld",CC->usersupp.usernum);
- fp = fopen(buf,"w");
- if (fp == NULL) {
- cprintf("%d Cannot create file\n",ERROR);
- return;
- }
- cprintf("%d \n",SEND_LISTING);
- while(client_gets(buf), strcmp(buf,"000")) {
- fprintf(fp,"%s\n",buf);
- }
- fclose(fp);
- }
-
-/*
- * read user bio
- */
-void cmd_rbio(char *cmdbuf)
-{
- struct usersupp ruser;
- char buf[256];
- FILE *fp;
-
- extract(buf,cmdbuf,0);
- if (getuser(&ruser,buf)!=0) {
- cprintf("%d No such user.\n",ERROR+NO_SUCH_USER);
- return;
- }
- sprintf(buf,"./bio/%ld",ruser.usernum);
-
- fp = fopen(buf,"r");
- if (fp == NULL) {
- cprintf("%d %s has no bio on file.\n",
- ERROR+FILE_NOT_FOUND,ruser.fullname);
- return;
- }
- cprintf("%d \n",LISTING_FOLLOWS);
- while (fgets(buf,256,fp)!=NULL) cprintf("%s",buf);
- fclose(fp);
- cprintf("000\n");
- }
-
-/*
- * list of users who have entered bios
- */
-void cmd_lbio(void) {
- char buf[256];
- FILE *ls;
- struct usersupp usbuf;
-
- ls=popen("cd ./bio; ls","r");
- if (ls==NULL) {
- cprintf("%d Cannot open listing.\n",ERROR+FILE_NOT_FOUND);
- return;
- }
-
- cprintf("%d\n",LISTING_FOLLOWS);
- while (fgets(buf,255,ls)!=NULL)
- if (getuserbynumber(&usbuf,atol(buf))==0)
- cprintf("%s\n",usbuf.fullname);
- pclose(ls);
- cprintf("000\n");
- }
-
-
/*
* Administrative Get User Parameters
*/