]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
CtdlAccessCheck() may now be passed a new access level to check for: ac_logged_in_or_...
[citadel.git] / citadel / citserver.c
index 9b522032daa9a5d51bf08acc22916c46bd0bbed1..859c25fa9d3b46b22cf19212245b32f7470bf248 100644 (file)
@@ -1,6 +1,4 @@
 /* 
- * $Id$
- *
  * Main source module for the Citadel server
  *
  * Copyright (c) 1987-2010 by the citadel.org team
@@ -297,6 +295,8 @@ void cmd_info(char *cmdbuf) {
        else {
                cprintf("0\n"); /* OpenID is disabled when using non-native auth */
        }
+
+       cprintf("%d\n", config.c_guest_logins);
        
        cprintf("000\n");
 }
@@ -659,6 +659,11 @@ int CtdlAccessCheck(int required_level) {
                return(-1);
        }
 
+       if ((required_level >= ac_logged_in_or_guest) && (CC->logged_in == 0) && (!config.c_guest_logins)) {
+               cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
+               return(-1);
+       }
+
        if ((required_level >= ac_logged_in) && (CC->logged_in == 0)) {
                cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
                return(-1);
@@ -1104,6 +1109,6 @@ CTDL_MODULE_INIT(citserver)
                CtdlRegisterProtoHook(cmd_scdn, "SCDN", "schedule or cancel a server shutdown");
                CtdlRegisterProtoHook(cmd_time, "TIME", "fetch the date and time from the server");
        }
-        /* return our Subversion id for the Log */
-       return "$Id$";
+        /* return our id for the Log */
+       return "citserver";
 }