]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
* Removed the last instance if is_room_aide
[citadel.git] / webcit / roomops.c
index 5e7359b5fd6e8455077bd716e20de54a1a8cbac7..1ab8c8efa93c78d806753c139916f500ac048145 100644 (file)
@@ -16,6 +16,7 @@ char *viewdefs[9];                    /* the different kinds of available views */
  */
 
 void display_whok(void);
+int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP);
 
 /*
  * Initialize the viewdefs with localized strings
@@ -844,8 +845,9 @@ void ParseGoto(folder *room, StrBuf *Line)
        room->is_inbox = StrBufExtractNext_long(Line, &Pos, '|'); // is_mailbox
 
        flag = StrBufExtractNext_long(Line, &Pos, '|');
-       if (WCC->is_aide || flag)
+       if (WCC->is_aide || flag) {
                room->RAFlags |= UA_ADMINALLOWED;
+       }
 
        room->UsersNewMAilboxMessages = StrBufExtractNext_long(Line, &Pos, '|');
 
@@ -1114,7 +1116,7 @@ void display_editroom(void)
        wc_printf("</td>\n");
        wc_printf("<td>&nbsp;</td>\n");
 
-       if ( (WC->axlevel >= 6) || (WC->is_room_aide) ) {
+       if ( ConditionalHaveRoomeditRights(NULL, NULL)) {
 
                wc_printf("<td class=\"");
                if (!strcmp(tab, "config")) {
@@ -2583,6 +2585,7 @@ void entroom(void)
        int er_floor;
        int er_num_type;
        int er_view;
+       wcsession *WCC = WC;
 
        if (!havebstr("ok_button")) {
                strcpy(WC->ImportantMessage,
@@ -2616,16 +2619,25 @@ void entroom(void)
 
        serv_getln(buf, sizeof buf);
        if (buf[0] != '2') {
-               strcpy(WC->ImportantMessage, &buf[4]);
+               strcpy(WCC->ImportantMessage, &buf[4]);
                display_main_menu();
                return;
        }
-       /** TODO: Room created, now udate the left hand icon bar for this user */
+       /** TODO: Room created, now update the left hand icon bar for this user */
        burn_folder_cache(0);   /* burn the old folder cache */
        
-       
        gotoroom(er_name);
-       do_change_view(er_view);                /* Now go there */
+
+       serv_printf("VIEW %d", er_view);
+       serv_getln(buf, sizeof buf);
+       WCC->CurRoom.view = er_view;
+
+       if ( (WCC != NULL) && ( (WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) )  {
+               display_editroom ();
+       } else {
+               do_change_view(er_view);                /* Now go there */
+       }
+
 }
 
 
@@ -3110,14 +3122,15 @@ void tmplput_ungoto(StrBuf *Target, WCTemplputParams *TP)
 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
-       return (WCC != NULL)? (WCC->is_room_aide == 0) : 0;
+       return (WCC != NULL)? 
+               ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) : 0;
 }
 
 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
        return (WCC == NULL)? 0 : 
-               ( (WCC->is_room_aide) || /////TODO!
+               ( ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
                   (WCC->CurRoom.is_inbox) || 
                   (WCC->CurRoom.QRFlags2 & QR2_COLLABDEL) );
 }
@@ -3191,7 +3204,7 @@ int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP)
 
        return ( (WCC!= NULL) && 
                 ((WCC->axlevel >= 6) || 
-                 (WCC->is_room_aide) || 
+                 ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
                  (WCC->CurRoom.is_inbox) ));
 }