]> 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 3d60b1a5a4be4e341961eb587cd5f05b1dc174a9..e509bab133d2770e149bdf48e194ee7b589051ad 100644 (file)
@@ -1,24 +1,22 @@
 /*
- * $Id$
- *
  * This module implements server commands related to the display and
  * manipulation of the "Who's online" list.
  *
- * Copyright (c) 1987-2009 by the citadel.org team
+ * Copyright (c) 1987-2012 by the citadel.org team
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
+ *  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.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  
+ *  
+ *  
  */
 
 #include "sysdep.h"
@@ -52,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"
 
@@ -91,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++) 
@@ -102,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
@@ -294,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";
 }