]> code.citadel.org Git - citadel.git/commitdiff
Added the EXTN command in a temporary form to run server extensions, but
authorArt Cancro <ajc@citadel.org>
Wed, 12 Aug 1998 02:58:45 +0000 (02:58 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 12 Aug 1998 02:58:45 +0000 (02:58 +0000)
there's a bug in it for some reason, that after you successfully run an
extension, the next server command crashes the server. This needs to be
fixed...

citadel/citserver.c
citadel/techdoc/session.txt
citadel/user_ops.c

index afa6ae97839cbae2da824a3cc5dae5ddc7323ba4..a61e09ffa41f8b0cb99f5f6014478e9bdcb71029 100644 (file)
@@ -184,7 +184,7 @@ void cmd_time()
    
    tv = time(NULL);
    
-   cprintf("%d|%ld\n", OK, tv);
+   cprintf("%d %ld\n", OK, tv);
 }
 
 /*
@@ -1068,6 +1068,12 @@ void *context_loop(struct CitContext *con)
                else if (!strncasecmp(cmdbuf, "EXTN", 4)) {
                        cmd_extn(&cmdbuf[5]);
                        }
+               else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
+                       cmd_agup(&cmdbuf[5]);
+                       }
+               else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
+                       cmd_asup(&cmdbuf[5]);
+                       }
                else {
                        cprintf("%d Unrecognized or unsupported command.\n",
                                ERROR);
index 9979b48295a7ccb8a7e17225ef443410cfdf0bdb..284e38ea0c5696d37f1494674239d545d457561e 100644 (file)
@@ -1530,55 +1530,78 @@ UCLS command.
 The following are for citserver 5.02 and above
 ----------------------------------------------
 
-HCHG   (Hostname CHanGe)
+ HCHG  (Hostname CHanGe)
 
-HCHG is a command, usable by any user, that allows a user to change their RWHO
+ HCHG is a command, usable by any user, that allows a user to change their RWHO
 host value.  This will mask a client's originating hostname from normal
 users; access level 6 and higher see an entry right underneath the spoofed
 entry listing the actual hostname the user originates from.
 
-The format of an HCHG command is:
+ The format of an HCHG command is:
 
-HCHG <name>
+ HCHG <name>
 
+ If a HCHG command is successful, the value OK (200) is returned.
 
-If a HCHG command is successful, the value OK (200) is returned.
 
-RCHG   (Roomname CHanGe)
+ RCHG  (Roomname CHanGe)
 
-RCHG is a command, usable by any user, that allows a user to change their RWHO
+ RCHG is a command, usable by any user, that allows a user to change their RWHO
 room value.  This will mask a client's roomname from normal users; access
 level 6 and higher see an entry right underneath the spoofed entry listing
 the actual room the user is in.
 
-The format of an RCHG command is:
+ The format of an RCHG command is:
 
-RCHG <name>
+ RCHG <name>
 
-If a RCHG command is successful, the value OK (200) is returned.
+ If a RCHG command is successful, the value OK (200) is returned.
 
-UCHG   (Username CHanGe)
 
-UCHG is an aide-level command which allows an aide to effectively change their
+ UCHG  (Username CHanGe)
+
+ UCHG is an aide-level command which allows an aide to effectively change their
 username.  If this value is blank, the user goes into stealth mode (see
 STEL).  Posts
 will show up as being from the real username in this mode, however.  In
 addition, the RWHO listing will include both the spoofed and real usernames.
 
-The format of an UCHG command is:
+ The format of an UCHG command is:
+ UCHG <name>
 
-UCHG <name>
+ If a UCHG command is successful, the value OK (200) is returned.
 
-If a UCHG command is successful, the value OK (200) is returned.
 
-TIME   (Get server local TIME)
+ TIME  (get server local TIME)
 
-TIME returns a string in the following format:
+ TIME returns OK followed by the current time measured in seconds since
+00:00:00 GMT, Jan 1, 1970.
 
- A|B
+ This is used in allowing a client to calculate idle times.
 
-Where A is OK (200), B is the current time measured in seconds since
-00:00:00 GMT, Jan 1, 1970.
 
-This is used in allowing a client to calculate idle times.
+ AGUP   (Administrative Get User Parameters)
+ ASUP   (Administrative Set User Parameters)
+  
+ These commands are only executable by Aides and by server extensions running
+at system-level.  They are used to get/set any and all parameters relating to
+a user account.  AGUP requires only one argument: the name of the user in
+question.  SGUP requires all of the parameters to be set.  The parameters are
+as follows, and are common to both commands:
+ 0 - User name
+ 1 - Password
+ 2 - Flags (see citadel.h)
+ 3 - Times called
+ 4 - Messages posted
+ 5 - Access level
+ 6 - User number
+ 7 - Timestamp of last call
+
+ Upon success, AGUP returns OK followed by all these parameters, and ASUP
+simply returns OK.  If the client has insufficient access to perform the
+requested operation, ERROR+HIGHER_ACCESS_REQUIRED is returned.  If the
+requested user does not exist, ERROR+NO_SUCH_USER is returned.
 
\ No newline at end of file
index 36805fe2e4bd2ba76254a28835362ba314f3e0ae..ce832d949101d5383b52c90c1636ccef63e99438 100644 (file)
@@ -522,8 +522,12 @@ void cmd_getu(void) {
                return;
                }
        getuser(&CC->usersupp,CC->curr_user);
-       cprintf("%d %d|%d|%d\n",OK,CC->usersupp.USscreenwidth,
-               CC->usersupp.USscreenheight,(CC->usersupp.flags & US_USER_SET));
+       cprintf("%d %d|%d|%d\n",
+               OK,
+               CC->usersupp.USscreenwidth,
+               CC->usersupp.USscreenheight,
+               (CC->usersupp.flags & US_USER_SET)
+               );
        }
 
 /*
@@ -1091,3 +1095,69 @@ void cmd_lbio(void) {
        pclose(ls);
        cprintf("000\n");
        }
+
+
+/*
+ * Administrative Get User Parameters
+ */
+void cmd_agup(char *cmdbuf) {
+       struct usersupp usbuf;
+       char requested_user[256];
+
+       if ( (CC->internal_pgm==0)
+          && ( (CC->logged_in == 0) || (is_aide()==0) ) ) {
+               cprintf("%d Higher access required.\n", 
+                       ERROR + HIGHER_ACCESS_REQUIRED);
+               return;
+               }
+
+       extract(requested_user, cmdbuf, 0);
+       if (getuser(&usbuf, requested_user) != 0) {
+               cprintf("%d No such user.\n", ERROR + NO_SUCH_USER);
+               return;
+               }
+
+       cprintf("%d %s|%s|%u|%d|%d|%d|%ld\n", 
+               OK,
+               usbuf.fullname,
+               usbuf.password,
+               usbuf.flags,
+               usbuf.timescalled,
+               usbuf.posted,
+               (int)usbuf.axlevel,
+               usbuf.usernum);
+       }
+
+
+
+/*
+ * Administrative Set User Parameters
+ */
+void cmd_asup(char *cmdbuf) {
+       struct usersupp usbuf;
+       char requested_user[256];
+       int np;
+       
+       if ( (CC->internal_pgm==0)
+          && ( (CC->logged_in == 0) || (is_aide()==0) ) ) {
+               cprintf("%d Higher access required.\n", 
+                       ERROR + HIGHER_ACCESS_REQUIRED);
+               return;
+               }
+
+       extract(requested_user, cmdbuf, 0);
+       if (lgetuser(&usbuf, requested_user) != 0) {
+               cprintf("%d No such user.\n", ERROR + NO_SUCH_USER);
+               return;
+               }
+
+       np = num_parms(cmdbuf);
+       if (np > 1) extract(usbuf.password, cmdbuf, 1);
+       if (np > 2) usbuf.flags = extract_int(cmdbuf, 2);
+       if (np > 3) usbuf.timescalled = extract_int(cmdbuf, 3);
+       if (np > 4) usbuf.posted = extract_int(cmdbuf, 4);
+       if (np > 5) usbuf.axlevel = extract_int(cmdbuf, 5);
+
+       lputuser(&usbuf, requested_user);
+       cprintf("%d Ok\n", OK);
+       }