Allow MSGS command to operate in guest mode.
[citadel.git] / citadel / msgbase.c
index 2af2d39521ac1cb8f5b1430d11b64efcd960219d..a62daa15ceaff2ceb338888740e29af3bd4a0dc6 100644 (file)
@@ -797,6 +797,8 @@ void cmd_msgs(char *cmdbuf)
        char search_string[1024];
        ForEachMsgCallback CallBack;
 
+       if (CtdlAccessCheck(ac_logged_in_or_guest)) return;
+
        extract_token(which, cmdbuf, 0, '|', sizeof which);
        cm_ref = extract_int(cmdbuf, 1);
        extract_token(search_string, cmdbuf, 1, '|', sizeof search_string);
@@ -833,11 +835,6 @@ void cmd_msgs(char *cmdbuf)
        else
                mode = MSGS_ALL;
 
-       if ((!(CC->logged_in)) && (!(CC->internal_pgm))) {
-               cprintf("%d not logged in\n", ERROR + NOT_LOGGED_IN);
-               return;
-       }
-
        if ( (mode == MSGS_SEARCH) && (!config.c_enable_fulltext) ) {
                cprintf("%d Full text index is not enabled on this server.\n",
                        ERROR + CMD_NOT_SUPPORTED);