]> code.citadel.org Git - citadel.git/blobdiff - citadel/textclient/citadel.c
* use eUsrAxlvl all over the place
[citadel.git] / citadel / textclient / citadel.c
index 7e5ef874a2351bf2233c80e1a4b657bdce81c01f..b1abf294794d19638ebf0b99088580df4b5a808d 100644 (file)
@@ -73,8 +73,8 @@
 
 #define IFEXPERT if (userflags&US_EXPERT)
 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
-#define IFAIDE if (axlevel>=6)
-#define IFNAIDE if (axlevel<6)
+#define IFAIDE if (axlevel>=AxAideU)
+#define IFNAIDE if (axlevel<AxAideU)
 
 int rordercmp(struct ctdlroomlisting *r1, struct ctdlroomlisting *r2);
 
@@ -92,12 +92,13 @@ int screenwidth;
 int screenheight;
 unsigned room_flags;
 unsigned room_flags2;
+int entmsg_ok = 0;
 char room_name[ROOMNAMELEN];
 char *uglist[UGLISTLEN]; /* size of the ungoto list */
 long uglistlsn[UGLISTLEN]; /* current read position for all the ungoto's. Not going to make any friends with this one. */
 int uglistsize = 0;
 char is_mail = 0;              /* nonzero when we're in a mail room */
-char axlevel = 0;              /* access level */
+char axlevel = AxDeleted;              /* access level */
 char is_room_aide = 0;         /* boolean flag, 1 if room aide */
 int timescalled;
 int posted;
@@ -470,6 +471,19 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto)
        from_floor = curr_floor;
        curr_floor = room->RRfloor;
 
+       /* Determine, based on the room's default view, whether an <E>nter message
+        * command will be valid here.
+        */
+       switch(room->RRdefaultview) {
+               case VIEW_BBS:
+               case VIEW_MAILBOX:
+                                       entmsg_ok = 1;
+                                       break;
+               default:
+                                       entmsg_ok = 0;
+                                       break;
+       }
+
        remove_march(room_name, 0);
        if (!strcasecmp(towhere, "_BASEROOM_"))
                remove_march(towhere, 0);
@@ -1677,12 +1691,19 @@ int main(int argc, char **argv)
        } else {
                newprompt("\rPlease enter your password: ", password, -19);
        }
-       strproc(password);
 
        if (*nonce) {
                r = CtdlIPCTryApopPassword(ipc, make_apop_string(password, nonce, hexstring, sizeof hexstring), aaa);
+               if (r / 100 != 2) {
+                       strproc(password);
+                       r = CtdlIPCTryApopPassword(ipc, make_apop_string(password, nonce, hexstring, sizeof hexstring), aaa);
+               }
        } else {
                r = CtdlIPCTryPassword(ipc, password, aaa);
+               if (r / 100 != 2) {
+                       strproc(password);
+                       r = CtdlIPCTryPassword(ipc, password, aaa);
+               }
        }
        
        if (r / 100 == 2) {
@@ -1755,7 +1776,7 @@ NEWUSR:   if (IsEmptyStr(rc_password)) {
                                rv = system(rc_gotmail_cmd);
                        }
                }
-               if ((axlevel >= 6) && (chek.needvalid > 0)) {
+               if ((axlevel >= AxAideU) && (chek.needvalid > 0)) {
                        scr_printf("*** Users need validation\n");
                }
                if (chek.needregis > 0) {