4 * Main source module for the client program.
16 #include <sys/types.h>
19 #include <sys/ioctl.h>
27 #include "serv_info.h"
29 #include "routines2.h"
34 #include "client_chat.h"
35 #include "client_passwords.h"
36 #include "citadel_decls.h"
47 char march_name[ROOMNAMELEN];
52 #define IFEXPERT if (userflags&US_EXPERT)
53 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
54 #define IFAIDE if (axlevel>=6)
55 #define IFNAIDE if (axlevel<6)
57 struct march *march = NULL;
59 /* globals associated with the client program */
60 char temp[PATH_MAX]; /* Name of general temp file */
61 char temp2[PATH_MAX]; /* Name of general temp file */
62 char tempdir[PATH_MAX]; /* Name of general temp dir */
63 char editor_path[256]; /* path to external editor */
64 char printcmd[256]; /* print command */
65 int editor_pid = (-1);
68 struct CtdlServInfo serv_info; /* Info on the server connected */
72 char room_name[ROOMNAMELEN];
73 char ugname[ROOMNAMELEN];
74 long uglsn; /* holds <u>ngoto info */
75 char is_mail = 0; /* nonzero when we're in a mail room */
76 char axlevel = 0; /* access level */
77 char is_room_aide = 0; /* boolean flag, 1 if room aide */
81 long usernum = 0L; /* user number */
83 long highest_msg_read; /* used for <A>bandon room cmd */
84 long maxmsgnum; /* used for <G>oto */
86 char have_xterm = 0; /* are we running on an xterm? */
93 char curr_floor = 0; /* number of current floor */
94 char floorlist[128][256]; /* names of floors */
95 char express_msgs = 0; /* express messages waiting! */
96 int termn8 = 0; /* Set to nonzero to cause a logoff */
98 extern int rc_ansi_color; /* ansi color value from citadel.rc */
101 * here is our 'clean up gracefully and exit' routine
103 void logoff(int code)
105 if (editor_pid > 0) { /* kill the editor if it's running */
106 kill(editor_pid, SIGHUP);
108 /* shut down the server... but not if the logoff code is 3, because
109 * that means we're exiting because we already lost the server
115 * now clean up various things
122 /* Violently kill off any child processes if Citadel is
125 if (getppid() == 1) {
126 kill(0 - getpgrp(), SIGTERM);
128 kill(0 - getpgrp(), SIGKILL);
130 sttybbs(SB_RESTORE); /* return the old terminal settings */
131 exit(code); /* exit with the proper exit code */
137 * signal catching function for hangups...
139 void dropcarr(int signum)
147 * catch SIGCONT to reset terminal modes when were are put back into the
150 void catch_sigcont(int signum)
153 signal(SIGCONT, catch_sigcont);
158 /* general purpose routines */
160 void formout(char *name)
161 { /* display a file */
163 snprintf(cmd, sizeof cmd, "MESG %s", name);
167 printf("%s\n", &cmd[4]);
170 fmout(screenwidth, NULL,
171 ((userflags & US_PAGINATOR) ? 1 : 0),
176 void userlist(char *patn)
186 pprintf("%s\n", &buf[4]);
189 pprintf(" User Name Num L LastCall Calls Posts\n");
190 pprintf("------------------------- ----- - ---------- ----- -----\n");
191 while (serv_gets(buf), strcmp(buf, "000")) {
192 if (sigcaught == 0) {
194 if (pattern(fl, patn) >= 0) {
195 pprintf("%-25s ", fl);
196 pprintf("%5ld %d ", extract_long(buf, 2),
197 extract_int(buf, 1));
198 lc = extract_long(buf, 3);
199 tmbuf = (struct tm *) localtime(&lc);
200 pprintf("%02d/%02d/%04d ",
203 (tmbuf->tm_year + 1900));
204 pprintf("%5ld %5ld\n", extract_long(buf, 4), extract_long(buf, 5));
214 * grab assorted info about the user...
216 void load_user_info(char *params)
218 extract(fullname, params, 0);
219 axlevel = extract_int(params, 1);
220 timescalled = extract_int(params, 2);
221 posted = extract_int(params, 3);
222 userflags = extract_int(params, 4);
223 usernum = extract_long(params, 5);
228 * Remove a room from the march list. 'floornum' is ignored unless
229 * 'roomname' is set to _FLOOR_, in which case all rooms on the requested
230 * floor will be removed from the march list.
232 void remove_march(char *roomname, int floornum)
234 struct march *mptr, *mptr2;
239 if ((!strcasecmp(march->march_name, roomname))
240 || ((!strcasecmp(roomname, "_FLOOR_")) && (march->march_floor == floornum))) {
247 for (mptr = march; mptr != NULL; mptr = mptr->next) {
249 if ((!strcasecmp(mptr->march_name, roomname))
250 || ((!strcasecmp(roomname, "_FLOOR_"))
251 && (mptr->march_floor == floornum))) {
253 mptr2->next = mptr->next;
264 * Locate the room on the march list which we most want to go to. Each room
265 * is measured given a "weight" of preference based on various factors.
267 char *pop_march(int desired_floor)
269 static char TheRoom[ROOMNAMELEN];
271 int TheOrder = 32767;
274 struct march *mptr = NULL;
276 strcpy(TheRoom, "_BASEROOM_");
280 for (mptr = march; mptr != NULL; mptr = mptr->next) {
282 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
283 weight = weight + 10000;
284 if (mptr->march_floor == desired_floor)
285 weight = weight + 5000;
287 weight = weight + ((128 - (mptr->march_floor)) * 128);
288 weight = weight + (128 - (mptr->march_order));
290 if (weight > TheWeight) {
292 strcpy(TheRoom, mptr->march_name);
293 TheFloor = mptr->march_floor;
294 TheOrder = mptr->march_order;
302 * jump directly to a room
304 void dotgoto(char *towhere, int display_name)
306 char aaa[256], bbb[256], psearch[256];
309 static int oldmailcount = (-1);
310 int partial_match, best_match;
313 /* store ungoto information */
314 strcpy(ugname, room_name);
317 /* first try an exact match */
318 snprintf(aaa, sizeof aaa, "GOTO %s", towhere);
323 if (!strncmp(aaa, "54", 2)) {
324 newprompt("Enter room password: ", bbb, 9);
325 snprintf(aaa, sizeof aaa, "GOTO %s|%s", towhere, bbb);
331 if (!strncmp(aaa, "54", 2)) {
332 printf("Wrong password.\n");
336 * If a match is not found, try a partial match.
337 * Partial matches anywhere in the string carry a weight of 1,
338 * left-aligned matches carry a weight of 2. Pick the room that
339 * has the highest-weighted match.
347 while (serv_gets(aaa), strcmp(aaa, "000")) {
348 extract(psearch, aaa, 0);
350 if (pattern(psearch, towhere) >= 0) {
353 if (!strncasecmp(towhere, psearch, strlen(towhere))) {
356 if (partial_match > best_match) {
357 strcpy(bbb, psearch);
358 best_match = partial_match;
361 if (strlen(bbb) == 0) {
362 printf("No room '%s'.\n", towhere);
365 snprintf(aaa, sizeof aaa, "GOTO %s", bbb);
375 extract(room_name, &aaa[4], 0);
376 room_flags = extract_int(&aaa[4], 4);
377 from_floor = curr_floor;
378 curr_floor = extract_int(&aaa[4], 10);
380 remove_march(room_name, 0);
381 if (!strcasecmp(towhere, "_BASEROOM_"))
382 remove_march(towhere, 0);
383 if ((from_floor != curr_floor) && (display_name > 0) && (floor_mode == 1)) {
384 if (floorlist[(int) curr_floor][0] == 0)
386 printf("(Entering floor: %s)\n", &floorlist[(int) curr_floor][0]);
388 if (display_name == 1) {
390 printf("%s ", room_name);
394 if (display_name != 2) {
395 color(BRIGHT_YELLOW);
396 printf("%d ", extract_int(&aaa[4], 1));
399 color(BRIGHT_YELLOW);
400 printf("%d ", extract_int(&aaa[4], 2));
402 printf("messages.\n");
404 highest_msg_read = extract_int(&aaa[4], 6);
405 maxmsgnum = extract_int(&aaa[4], 5);
406 is_mail = (char) extract_int(&aaa[4], 7);
407 is_room_aide = (char) extract_int(&aaa[4], 8);
408 ls = extract_long(&aaa[4], 6);
410 /* read info file if necessary */
411 if (extract_int(&aaa[4], 3) > 0)
414 /* check for newly arrived mail if we can */
415 if (num_parms(&aaa[4]) >= 10) {
416 newmailcount = extract_int(&aaa[4], 9);
417 if ((oldmailcount >= 0) && (newmailcount > oldmailcount)) {
419 printf("*** You have new mail\n");
422 oldmailcount = newmailcount;
426 /* Goto next room having unread messages.
427 * We want to skip over rooms that the user has already been to, and take the
428 * user back to the lobby when done. The room we end up in is placed in
429 * newroom - which is set to 0 (the lobby) initially.
434 struct march *mptr, *mptr2;
435 char next_room[ROOMNAMELEN];
437 /* Check to see if the march-mode list is already allocated.
438 * If it is, pop the first room off the list and go there.
444 while (serv_gets(buf), strcmp(buf, "000")) {
445 mptr = (struct march *) malloc(sizeof(struct march));
447 extract(mptr->march_name, buf, 0);
448 mptr->march_floor = (char) (extract_int(buf, 2) & 0x7F);
449 mptr->march_order = (char) (extract_int(buf, 3) & 0x7F);
454 while (mptr2->next != NULL)
459 /* add _BASEROOM_ to the end of the march list, so the user will end up
460 * in the system base room (usually the Lobby>) at the end of the loop
462 mptr = (struct march *) malloc(sizeof(struct march));
464 strcpy(mptr->march_name, "_BASEROOM_");
469 while (mptr2->next != NULL)
474 * ...and remove the room we're currently in, so a <G>oto doesn't make us
475 * walk around in circles
477 remove_march(room_name, 0);
480 strcpy(next_room, pop_march(curr_floor));
482 strcpy(next_room, "_BASEROOM_");
484 remove_march(next_room, 0);
485 dotgoto(next_room, 1);
489 * forget all rooms on a given floor
491 void forget_all_rooms_on(int ffloor)
494 struct march *flist, *fptr;
496 printf("Forgetting all rooms on %s...\r", &floorlist[ffloor][0]);
498 snprintf(buf, sizeof buf, "LKRA %d", ffloor);
502 printf("%-72s\n", &buf[4]);
506 while (serv_gets(buf), strcmp(buf, "000")) {
507 fptr = (struct march *) malloc(sizeof(struct march));
510 extract(fptr->march_name, buf, 0);
512 while (flist != NULL) {
513 snprintf(buf, sizeof buf, "GOTO %s", flist->march_name);
524 printf("%-72s\r", "");
529 * routine called by gotofloor() to move to a new room on a new floor
531 void gf_toroom(char *towhere, int mode)
533 int floor_being_left;
535 floor_being_left = curr_floor;
537 if (mode == GF_GOTO) { /* <;G>oto mode */
541 if (mode == GF_SKIP) { /* <;S>kip mode */
543 remove_march("_FLOOR_", floor_being_left);
545 if (mode == GF_ZAP) { /* <;Z>ap mode */
547 remove_march("_FLOOR_", floor_being_left);
548 forget_all_rooms_on(floor_being_left);
556 void gotofloor(char *towhere, int mode)
560 char buf[256], targ[256];
562 if (floorlist[0][0] == 0)
565 for (a = 0; a < 128; ++a)
566 if (!strcasecmp(&floorlist[a][0], towhere))
570 for (a = 0; a < 128; ++a) {
571 if (!strncasecmp(&floorlist[a][0], towhere, strlen(towhere))) {
577 for (a = 0; a < 128; ++a)
578 if (pattern(towhere, &floorlist[a][0]) > 0)
582 printf("No floor '%s'.\n", towhere);
585 for (mptr = march; mptr != NULL; mptr = mptr->next) {
586 if ((mptr->march_floor) == tofloor)
587 gf_toroom(mptr->march_name, mode);
592 snprintf(buf, sizeof buf, "LKRA %d", tofloor);
596 while (serv_gets(buf), strcmp(buf, "000")) {
597 if ((extract_int(buf, 2) == tofloor) && (strlen(targ) == 0))
598 extract(targ, buf, 0);
600 if (strlen(targ) > 0) {
601 gf_toroom(targ, mode);
603 printf("There are no rooms on '%s'.\n", &floorlist[tofloor][0]);
609 * forget all rooms on current floor
611 void forget_this_floor(void)
614 if (curr_floor == 0) {
615 printf("Can't forget this floor.\n");
618 if (floorlist[0][0] == 0)
620 printf("Are you sure you want to forget all rooms on %s? ",
621 &floorlist[(int) curr_floor][0]);
625 gf_toroom("_BASEROOM_", GF_ZAP);
630 * Figure out the physical screen dimensions, if we can
632 void check_screen_dims(void)
636 unsigned short height; /* rows */
637 unsigned short width; /* columns */
638 unsigned short xpixels;
639 unsigned short ypixels; /* pixels */
642 if (have_xterm) { /* dynamically size screen if on an xterm */
643 if (ioctl(0, TIOCGWINSZ, &xwinsz) == 0) {
645 screenheight = (int) xwinsz.height;
647 screenwidth = (int) xwinsz.width;
655 * set floor mode depending on client, server, and user settings
657 void set_floor_mode(void)
659 if (serv_info.serv_ok_floors == 0) {
660 floor_mode = 0; /* Don't use floors if the server */
662 /* doesn't support them! */
664 if (rc_floor_mode == RC_NO) { /* never use floors */
667 if (rc_floor_mode == RC_YES) { /* always use floors */
670 if (rc_floor_mode == RC_DEFAULT) { /* user choice */
671 floor_mode = ((userflags & US_FLOORS) ? 1 : 0);
677 * Set or change the user's password
679 int set_password(void)
685 if (strlen(rc_password) > 0) {
686 strcpy(pass1, rc_password);
687 strcpy(pass2, rc_password);
689 IFNEXPERT formout("changepw");
690 newprompt("Enter a new password: ", pass1, -19);
691 newprompt("Enter it again to confirm: ", pass2, -19);
695 if (!strcasecmp(pass1, pass2)) {
696 snprintf(buf, sizeof buf, "SETP %s", pass1);
699 printf("%s\n", &buf[4]);
700 offer_to_remember_password(hostbuf, portbuf, fullname, pass1);
703 printf("*** They don't match... try again.\n");
711 * get info about the server we've connected to
713 void get_serv_info(char *supplied_hostname)
717 CtdlInternalGetServInfo(&serv_info);
719 /* be nice and identify ourself to the server */
720 snprintf(buf, sizeof buf, "IDEN %d|%d|%d|%s|",
721 SERVER_TYPE, 0, REV_LEVEL,
722 (server_is_local ? "local" : CITADEL));
724 /* Append a hostname */
725 if (supplied_hostname != NULL) {
726 strcat(buf, supplied_hostname);
729 locate_host(&buf[strlen(buf)]); /* append to the end */
733 serv_gets(buf); /* we don't care about the result code */
741 * Display list of users currently logged on to the server
743 void who_is_online(int longlist)
745 char buf[256], username[256], roomname[256], fromhost[256];
747 char actual_user[256], actual_room[256], actual_host[256];
748 char tbuf[256], clientsoft[256];
750 time_t idletime, idlehours, idlemins, idlesecs;
751 int last_session = (-1);
755 if (tbuf[0] == '2') {
756 timenow = extract_long(&tbuf[4], 0);
764 pprintf("FLG ### User Name Room From host\n");
766 pprintf("--- --- ------------------------- -------------------- ------------------------\n");
771 while (serv_gets(buf), strcmp(buf, "000")) {
772 extract(username, buf, 1);
773 extract(roomname, buf, 2);
774 extract(fromhost, buf, 3);
775 extract(clientsoft, buf, 4);
776 extract(flags, buf, 7);
778 idletime = timenow - extract_long(buf, 5);
779 idlehours = idletime / 3600;
780 idlemins = (idletime - (idlehours * 3600)) / 60;
781 idlesecs = (idletime - (idlehours * 3600) - (idlemins * 60));
783 if (idletime > 900) {
784 while (strlen(roomname) < 20) {
785 strcat(roomname, " ");
787 strcpy(&roomname[14], "[idle]");
792 extract(actual_user, buf, 8);
793 extract(actual_room, buf, 9);
794 extract(actual_host, buf, 10);
796 pprintf("\nFlags: %-3s Sess# %-3d Name: %-25s Room: %s\n",
797 flags, extract_int(buf, 0), username, roomname);
798 pprintf("from <%s> using <%s>, idle %ld:%02ld:%02ld\n",
799 fromhost, clientsoft,
800 (long) idlehours, (long) idlemins, (long) idlesecs);
802 if ( (strlen(actual_user)+strlen(actual_room)+strlen(actual_host)) > 0) {
804 if (strlen(actual_user)>0) pprintf("<%s> ", actual_user);
805 if (strlen(actual_room)>0) pprintf("in <%s> ", actual_room);
806 if (strlen(actual_host)>0) pprintf("from <%s> ", actual_host);
811 if (extract_int(buf, 0) == last_session) {
814 color(BRIGHT_MAGENTA);
815 pprintf("%-3s ", flags);
817 pprintf("%-3d ", extract_int(buf, 0));
819 last_session = extract_int(buf, 0);
821 pprintf("%-25s ", username);
822 color(BRIGHT_MAGENTA);
824 pprintf("%-20s ", roomname);
826 pprintf("%-24s\n", fromhost);
833 void enternew(char *desc, char *buf, int maxlen)
836 snprintf(bbb, sizeof bbb, "Enter in your new %s: ", desc);
837 newprompt(bbb, buf, maxlen);
842 int shift(int argc, char **argv, int start, int count) {
845 for (i=start; i<(argc-count); ++i) {
846 argv[i] = argv[i+count];
855 int main(int argc, char **argv)
858 char aaa[100], bbb[100];/* general purpose variables */
859 char argbuf[32]; /* command line buf */
860 char nonce[NONCE_SIZE];
861 char *telnet_client_host = NULL;
862 char *sptr, *sptr2; /* USed to extract the nonce */
863 char hexstring[MD5_HEXSTRING_SIZE];
864 int stored_password = 0;
867 sttybbs(SB_SAVE); /* Store the old terminal parameters */
868 load_command_set(); /* parse the citadel.rc file */
869 sttybbs(SB_NO_INTR); /* Install the new ones */
870 signal(SIGHUP, dropcarr); /* Cleanup gracefully if carrier is dropped */
871 signal(SIGTERM, dropcarr); /* Cleanup gracefully if terminated */
872 signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
875 * Handle command line options as if we were called like /bin/login
876 * (i.e. from in.telnetd)
878 for (a=0; a<argc; ++a) {
879 if ((argc > a+1) && (!strcmp(argv[a], "-h")) ) {
880 telnet_client_host = argv[a+1];
881 argc = shift(argc, argv, a, 2);
883 if (!strcmp(argv[a], "-p")) {
884 argc = shift(argc, argv, a, 1);
888 printf("Attaching to server... \r");
890 attach_to_server(argc, argv, hostbuf, portbuf);
896 printf("%s\n", &aaa[4]);
900 /* If there is a [nonce] at the end, put the nonce in <nonce>, else nonce
904 if ((sptr = strchr(aaa, '<')) == NULL)
910 if ((sptr2 = strchr(sptr, '>')) == NULL)
918 strncpy(nonce, sptr, NONCE_SIZE);
922 get_serv_info(telnet_client_host);
928 printf("%-23s\n%s\n%s\n", serv_info.serv_software, serv_info.serv_humannode,
929 serv_info.serv_bbs_city);
930 screenwidth = 80; /* default screen dimensions */
933 printf(" pause next stop\n");
934 printf(" ctrl-s ctrl-o ctrl-c\n\n");
935 formout("hello"); /* print the opening greeting */
938 GSTA: /* See if we have a username and password on disk */
939 if (rc_remember_passwords) {
940 get_stored_password(hostbuf, portbuf, fullname, password);
941 if (strlen(fullname) > 0) {
942 snprintf(aaa, sizeof(aaa)-1, "USER %s", fullname);
947 sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
949 else /* Else no APOP */
951 snprintf(aaa, sizeof(aaa)-1, "PASS %s", password);
957 load_user_info(&aaa[4]);
962 set_stored_password(hostbuf, portbuf, "", "");
970 if (strlen(rc_username) > 0) {
971 strcpy(fullname, rc_username);
973 newprompt("Enter your name: ", fullname, 29);
976 if (!strcasecmp(fullname, "new")) { /* just in case */
977 printf("Please enter the name you wish to log in with.\n");
980 (!strcasecmp(fullname, "bbs"))
981 || (!strcasecmp(fullname, "new"))
982 || (strlen(fullname) == 0));
984 if (!strcasecmp(fullname, "off")) {
988 /* sign on to the server */
989 snprintf(aaa, sizeof aaa, "USER %s", fullname);
995 /* password authentication */
996 if (strlen(rc_password) > 0) {
997 strcpy(password, rc_password);
999 newprompt("\rPlease enter your password: ", password, -19);
1005 sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
1007 else /* Else no APOP */
1009 snprintf(aaa, sizeof(aaa)-1, "PASS %s", password);
1014 if (aaa[0] == '2') {
1015 load_user_info(&aaa[4]);
1016 offer_to_remember_password(hostbuf, portbuf,
1017 fullname, password);
1020 printf("<< wrong password >>\n");
1021 if (strlen(rc_password) > 0)
1025 NEWUSR: if (strlen(rc_password) == 0) {
1026 printf("No record. Enter as new user? ");
1030 snprintf(aaa, sizeof aaa, "NEWU %s", fullname);
1033 if (aaa[0] != '2') {
1034 printf("%s\n", aaa);
1037 load_user_info(&aaa[4]);
1039 while (set_password() != 0);;
1045 /* Switch color support on or off if we're in user mode */
1046 if (rc_ansi_color == 3) {
1047 if (userflags & US_COLOR)
1053 printf("%s\nAccess level: %d (%s)\nUser #%ld / Call #%d\n",
1054 fullname, axlevel, axdefs[(int) axlevel],
1055 usernum, timescalled);
1059 if (aaa[0] == '2') {
1060 b = extract_int(&aaa[4], 0);
1064 printf("*** You have a new private message in Mail>\n");
1066 printf("*** You have %d new private messages in Mail>\n", b);
1069 if ((axlevel >= 6) && (extract_int(&aaa[4], 2) > 0)) {
1070 printf("*** Users need validation\n");
1072 if (extract_int(&aaa[4], 1) > 0) {
1073 printf("*** Please register.\n");
1074 formout("register");
1078 /* Make up some temporary filenames for use in various parts of the
1079 * program. Don't mess with these once they've been set, because we
1080 * will be unlinking them later on in the program and we don't
1081 * want to delete something that we didn't create. */
1082 snprintf(temp, sizeof temp, tmpnam(NULL));
1083 snprintf(temp2, sizeof temp2, tmpnam(NULL));
1084 snprintf(tempdir, sizeof tempdir, tmpnam(NULL));
1086 /* Get screen dimensions. First we go to a default of 80x24. Then
1087 * we try to get the user's actual screen dimensions off the server.
1088 * However, if we're running on an xterm, all this stuff is
1089 * irrelevant because we're going to dynamically size the screen
1090 * during the session.
1096 if (aaa[0] == '2') {
1097 screenwidth = extract_int(&aaa[4], 0);
1098 screenheight = extract_int(&aaa[4], 1);
1100 if (getenv("TERM") != NULL)
1101 if (!strcmp(getenv("TERM"), "xterm")) {
1105 check_screen_dims();
1111 /* Enter the lobby */
1112 dotgoto("_BASEROOM_", 1);
1114 /* Main loop for the system... user is logged in. */
1123 /* MAIN COMMAND LOOP */
1125 mcmd = getcmd(argbuf); /* Get keyboard command */
1128 check_screen_dims(); /* if xterm, get screen size */
1146 newprompt("What do you want your username to be? ", aaa, 32);
1147 snprintf(bbb, sizeof bbb, "ENT0 2|0|0|0|%s", aaa);
1150 if (strncmp("200", aaa, 3))
1151 printf("\n%s\n", aaa);
1165 dotgoto("_MAIL_", 1);
1182 readmsgs(0, (-1), 0);
1185 readmsgs(2, (-1), 0);
1188 readmsgs(3, 1, atoi(argbuf));
1275 cli_image_upload("_userpic_");
1278 cli_image_upload("_roompic_");
1282 snprintf(aaa, sizeof aaa, "_floorpic_|%d", curr_floor);
1283 cli_image_upload(aaa);
1287 enternew("roomname", aaa, 20);
1288 snprintf(bbb, sizeof bbb, "RCHG %s", aaa);
1291 if (strncmp("200", aaa, 3))
1292 printf("\n%s\n", aaa);
1295 enternew("hostname", aaa, 25);
1296 snprintf(bbb, sizeof bbb, "HCHG %s", aaa);
1299 if (strncmp("200", aaa, 3))
1300 printf("\n%s\n", aaa);
1303 enternew("username", aaa, 32);
1304 snprintf(bbb, sizeof bbb, "UCHG %s", aaa);
1307 if (strncmp("200", aaa, 3))
1308 printf("\n%s\n", aaa);
1318 display_help(argbuf);
1322 formout("register");
1327 printf("Are you sure (y/n)? ");
1336 printf("All users will be disconnected! "
1337 "Really terminate the server? ");
1341 printf("%s\n", &aaa[4]);
1350 printf("Do you really want to schedule a "
1351 "server shutdown? ");
1353 serv_puts("SCDN 1");
1356 if (atoi(&aaa[4])) {
1358 "The Citadel server will terminate when all users are logged off.\n"
1363 "The Citadel server will not terminate.\n"
1378 if (server_is_local) {
1379 sttybbs(SB_RESTORE);
1380 snprintf(aaa, sizeof aaa, "USERNAME=\042%s\042; export USERNAME;"
1381 "exec ./subsystem %ld %d %d", fullname,
1382 usernum, screenwidth, axlevel);
1384 sttybbs(SB_NO_INTR);
1386 printf("*** Can't run doors when server is not local.\n");
1399 do_system_configuration();
1403 do_internet_configuration();
1407 check_message_base();
1429 gotofloor(argbuf, GF_GOTO);
1433 gotofloor(argbuf, GF_SKIP);
1437 forget_this_floor();
1465 knrooms(floor_mode);
1475 misc_server_cmd(argbuf);
1479 edit_system_message(argbuf);
1504 } while (termn8 == 0);
1506 TERMN8: printf("%s logged out.\n", fullname);
1507 while (march != NULL) {
1508 remove_march(march->march_name, 0);
1511 printf("\n\nType 'off' to hang up, or next user...\n");
1513 snprintf(aaa, sizeof aaa, "LOUT");
1516 if ((mcmd == 29) || (mcmd == 15)) {