]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_expire.c
* Replaced most of the very repetitive and very redundant access level checks
[citadel.git] / citadel / serv_expire.c
index d38f1085f1e7e1127a533a92cb18288695a14d2f..f8f2366e182d96b36a96d42ec14c0159ffc780a6 100644 (file)
@@ -499,17 +499,7 @@ void cmd_expi(char *argbuf) {
        char cmd[256];
        int retval;
 
-
-       if ((!(CC->logged_in))&&(!(CC->internal_pgm))) {
-               cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
-               return;
-       }
-
-       if ((!is_room_aide()) && (!(CC->internal_pgm)) ) {
-               cprintf("%d Higher access required.\n",
-                       ERROR+HIGHER_ACCESS_REQUIRED);
-               return;
-       }
+       if (CtdlAccessCheck(ac_aide)) return;
 
        extract(cmd, argbuf, 0);
        if (!strcasecmp(cmd, "users")) {
@@ -556,7 +546,7 @@ void do_fsck_msg(long msgnum) {
 void do_fsck_room(struct quickroom *qrbuf, void *data)
 {
        getroom(&CC->quickroom, qrbuf->QRname);
-       CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, do_fsck_msg);
+       CtdlForEachMessage(MSGS_ALL, 0L, (-127), NULL, NULL, do_fsck_msg);
 }
 
 /*
@@ -569,11 +559,7 @@ void cmd_fsck(char *argbuf) {
        struct roomref *ptr;
        int realcount;
 
-       if ( (!CC->logged_in) || (CC->usersupp.axlevel < 6) ) {
-               cprintf("%d Higher access required\n",
-                       ERROR+HIGHER_ACCESS_REQUIRED);
-               return;
-       }
+       if (CtdlAccessCheck(ac_aide)) return;
 
        /* Lame way of checking whether anyone else is doing this now */
        if (rr != NULL) {