Show system contexts when RWHO is run via admin socket
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 27 Feb 2012 21:40:52 +0000 (16:40 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Mon, 27 Feb 2012 21:40:52 +0000 (16:40 -0500)
citadel/config.c
citadel/modules/rwho/serv_rwho.c

index 78a01d074c6358fefe1911450aa06cbad551894f..5328e30369149a50d2c04939d0c6469b1557a17f 100644 (file)
@@ -42,9 +42,7 @@ void brand_new_installation_set_defaults(void) {
        uname(&my_utsname);
 
        /* set some sample/default values in place of blanks... */
-       char c_nodename[256];
-       safestrncpy(c_nodename, my_utsname.nodename, sizeof c_nodename);
-       strtok(config.c_nodename, ".");
+       extract_token(config.c_nodename, my_utsname.nodename, 0, '.', sizeof config.c_nodename);
        if (IsEmptyStr(config.c_fqdn) ) {
                if ((he = gethostbyname(my_utsname.nodename)) != NULL) {
                        safestrncpy(config.c_fqdn, he->h_name, sizeof config.c_fqdn);
index 0aed437ceb96b991b0a1af7e60fd5801f98a65c7..09e256f8657466f32ada03c65e875b785975cd55 100644 (file)
@@ -4,19 +4,14 @@
  *
  * 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 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.
+ * 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"
@@ -76,8 +71,6 @@ void cmd_rwho(char *argbuf) {
        /* So that we don't keep the context list locked for a long time
         * we create a copy of it first
         */
-       
-
        nptr = CtdlGetContextArray(&nContexts) ;
        if (!nptr)
        {
@@ -87,7 +80,7 @@ void cmd_rwho(char *argbuf) {
                return;
        }
        
-       aide = (CC->user.axlevel >= AxAideU) ;
+       aide = ( (CC->user.axlevel >= AxAideU) || (CC->internal_pgm) ) ;
        cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
        
        for (i=0; i<nContexts; i++)