* Removed the ./help/? hack; replaced with actual "show directory" code
authorArt Cancro <ajc@citadel.org>
Tue, 9 Aug 2005 21:58:57 +0000 (21:58 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 9 Aug 2005 21:58:57 +0000 (21:58 +0000)
  in the server.

citadel/ChangeLog
citadel/citserver.c
citadel/help/aide

index c821b93ee4b056b9735a4e1ac0e92174d8b51dc0..1cdf1eae3ea3319dfe12abe8981ec780d934b7d3 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 868f2daab498b6d80e50f4e13317a9bdbeae3cfd..bc7e493e09c1976d6356d1ebf7b9002145ce3ea8 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <ctype.h>
 #include <string.h>
+#include <dirent.h>
 #include <errno.h>
 #include <limits.h>
 /* #include <dlfcn.h> */
@@ -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]);
 
index 4d5b5c17711ce7109230ab49752a330d38dcdbc3..38d535521eccefa2e72913e32fb0b74e590658cb 100644 (file)
@@ -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.
-   
- .<A>ide <E>dit Room                - edit current room's parameters
- .<A>ide <F>ile <D>elete            - delete a file from the directory
- .<A>ide <F>ile <M>ove              - move a file to another room
- .<A>ide <F>ile <S>end over net     - send a file across the network
- .<A>ide enter <I>nfo file          - create/change this room's info file
- .<A>ide <K>ill Room                - delete the current room
- .<A>ide <R>oom <I>nvite user       - add user to invitation-only room
- .<A>ide <R>oom <K>ick out user     - delete user from invitation-only room
- .<A>ide <U>ser edit                - change a user's access level
- .<A>ide <V>alidate new users       - process new user registration
- .<A>ide <W>ho knows room           - lists users with access to current room
+
+ <.> <A>ide <K>ill this room   (Delete the current room)
+ <.> <A>ide <E>dit this room   (Edit the current room's parameters)
+ <.> <A>ide <W>ho knows room   (List users with access to this room)
+ <.> <A>ide edit <U>ser        (Change user's access level, password, etc.)
+ <.> <A>ide <V>alidate new users   (Process new user registrations)
+ <.> <A>ide enter <I>nfo file      (Create/change this room's banner)
+ <.> <A>ide <R>oom <I>nvite user   (Grant access to an invitation-only room)
+ <.> <A>ide <R>oom <K>ick out user (Revoke access to an invitation-only room)
+ <.> <A>ide <F>ile <D>elete        (Delete a file from the room's directory)
+ <.> <A>ide <F>ile <S>end over net (Transmit a file to another node)
+ <.> <A>ide <F>ile <M>ove          (Move a file to another room's directory)
+ <.> <A>ide <M>essage edit:        (Edit system banners)
+ <.> <A>ide <P>ost                 (Post a message on behalf of another user)
+ <.> <A>ide <S>ystem configuration <G>eneral   (Edit global site config)
+ <.> <A>ide <S>ystem configuration <I>nternet  (Edit Internet domains)
+ <.> <A>ide <S>ystem configuration check <M>essage base   (Internal checks)
+ <.> <A>ide <S>ystem configuration <N>etwork   (Netting with other Citadels)
+ <.> <A>ide <S>ystem configuration network <F>ilter list
+ <.> <A>ide <T>erminate server <N>ow          (Shut down Citadel server now)
+ <.> <A>ide <T>erminate server <S>cheduled    (Shut down Citadel server later)
+ <.> <A>ide mailing <L>ist recipients         (For mailing list rooms)
+ <.> <A>ide mailing list <D>igest recipients  (For mailing list rooms)
+ <.> <A>ide <N>etwork room sharing     (Replication with other Citadels)
  
  In addition, the <M>ove and <D>elete commands are available at the
 message prompt.