]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/rwho/serv_rwho.c
RWHO: use the api function to check for aide access.
[citadel.git] / citadel / modules / rwho / serv_rwho.c
index be0e4865a91c73560149ce58feb96d5d39e66179..e509bab133d2770e149bdf48e194ee7b589051ad 100644 (file)
@@ -1,9 +1,22 @@
 /*
- * $Id$
- *
  * This module implements server commands related to the display and
  * manipulation of the "Who's online" list.
  *
+ * Copyright (c) 1987-2012 by the citadel.org team
+ *
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3.
+ *  
+ *  
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  
+ *  
+ *  
  */
 
 #include "sysdep.h"
@@ -37,9 +50,7 @@
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "room_ops.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 
@@ -76,7 +87,7 @@ void cmd_rwho(char *argbuf) {
                return;
        }
        
-       aide = CC->user.axlevel >= 6;
+       aide = CtdlAccessCheck(ac_aide);
        cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
        
        for (i=0; i<nContexts; i++) 
@@ -87,6 +98,12 @@ void cmd_rwho(char *argbuf) {
                room_spoofed = 0;
                host_spoofed = 0;
                
+               if (!aide && nptr[i].state == CON_SYS)
+                       continue;
+
+               if (!aide && nptr[i].kill_me != 0)
+                       continue;
+
                if (nptr[i].cs_flags & CS_POSTING)
                   strcat(flags, "*");
                else
@@ -279,6 +296,6 @@ CTDL_MODULE_INIT(rwho)
                CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode");
        }
        
-       /* return our Subversion id for the Log */
-        return "$Id$";
+       /* return our module name for the log */
+        return "rwho";
 }