From 3a1a804554cb9764783a8021f95978e5a0bb58bf Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 9 Aug 2005 21:58:57 +0000 Subject: [PATCH] * Removed the ./help/? hack; replaced with actual "show directory" code in the server. --- citadel/ChangeLog | 5 +++++ citadel/citserver.c | 39 +++++++++++++++++++++++++++++++++------ citadel/help/aide | 36 ++++++++++++++++++++++++------------ 3 files changed, 62 insertions(+), 18 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index c821b93ee..1cdf1eae3 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 654.6 2005/08/09 21:58:57 ajc +* Removed the ./help/? hack; replaced with actual "show directory" code + in the server. + Revision 654.5 2005/08/09 16:28:32 ajc * setup.c: added "exim4" to the list of non-Citadel MTA's which can be disabled during setup. @@ -7009,3 +7013,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/citserver.c b/citadel/citserver.c index 868f2daab..bc7e493e0 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -32,6 +32,7 @@ #include #include +#include #include #include /* #include */ @@ -452,6 +453,8 @@ void cmd_mesg(char *mname) char buf[256]; char buf2[256]; char *dirs[2]; + DIR *dp; + struct dirent *d; extract_token(buf, mname, 0, '|', sizeof buf); @@ -465,15 +468,39 @@ void cmd_mesg(char *mname) DATA_DIR"/" #endif "help"); - snprintf(buf2, sizeof buf2, "%s.%d.%d", buf, CC->cs_clientdev, CC->cs_clienttyp); - mesg_locate(targ, sizeof targ, buf2, 2, (const char **)dirs); - if (strlen(targ) == 0) { - snprintf(buf2, sizeof buf2, "%s.%d", buf, CC->cs_clientdev); + snprintf(buf2, sizeof buf2, "%s.%d.%d", + buf, CC->cs_clientdev, CC->cs_clienttyp); + + /* If the client requested "?" then produce a listing */ + if (!strcmp(buf, "?")) { + cprintf("%d %s\n",LISTING_FOLLOWS,buf); + dp = opendir(dirs[1]); + if (dp != NULL) { + while (d = readdir(dp), d != NULL) { + if (d->d_name[0] != '.') { + cprintf(" %s\n", d->d_name); + } + } + closedir(dp); + } + cprintf("000\n"); + } + + /* Otherwise, look for the requested file by name. */ + else { mesg_locate(targ, sizeof targ, buf2, 2, (const char **)dirs); if (strlen(targ) == 0) { - mesg_locate(targ, sizeof targ, buf, 2, (const char **)dirs); - } + snprintf(buf2, sizeof buf2, "%s.%d", + buf, CC->cs_clientdev); + mesg_locate(targ, sizeof targ, buf2, 2, + (const char **)dirs); + if (strlen(targ) == 0) { + mesg_locate(targ, sizeof targ, buf, 2, + (const char **)dirs); + } + } } + free(dirs[0]); free(dirs[1]); diff --git a/citadel/help/aide b/citadel/help/aide index 4d5b5c177..38d535521 100644 --- a/citadel/help/aide +++ b/citadel/help/aide @@ -1,18 +1,30 @@ The following commands are available only to Aides. A subset of these commands are available to room aides when they are currently in the room they are room aide for. - - .ide dit Room - edit current room's parameters - .ide ile elete - delete a file from the directory - .ide ile ove - move a file to another room - .ide ile end over net - send a file across the network - .ide enter nfo file - create/change this room's info file - .ide ill Room - delete the current room - .ide oom nvite user - add user to invitation-only room - .ide oom ick out user - delete user from invitation-only room - .ide ser edit - change a user's access level - .ide alidate new users - process new user registration - .ide ho knows room - lists users with access to current room + + <.> ide ill this room (Delete the current room) + <.> ide dit this room (Edit the current room's parameters) + <.> ide ho knows room (List users with access to this room) + <.> ide edit ser (Change user's access level, password, etc.) + <.> ide alidate new users (Process new user registrations) + <.> ide enter nfo file (Create/change this room's banner) + <.> ide oom nvite user (Grant access to an invitation-only room) + <.> ide oom ick out user (Revoke access to an invitation-only room) + <.> ide ile elete (Delete a file from the room's directory) + <.> ide ile end over net (Transmit a file to another node) + <.> ide ile ove (Move a file to another room's directory) + <.> ide essage edit: (Edit system banners) + <.> ide

ost (Post a message on behalf of another user) + <.> ide ystem configuration eneral (Edit global site config) + <.> ide ystem configuration nternet (Edit Internet domains) + <.> ide ystem configuration check essage base (Internal checks) + <.> ide ystem configuration etwork (Netting with other Citadels) + <.> ide ystem configuration network ilter list + <.> ide erminate server ow (Shut down Citadel server now) + <.> ide erminate server cheduled (Shut down Citadel server later) + <.> ide mailing ist recipients (For mailing list rooms) + <.> ide mailing list igest recipients (For mailing list rooms) + <.> ide etwork room sharing (Replication with other Citadels) In addition, the ove and elete commands are available at the message prompt. -- 2.30.2