user access level helper moved to the other accesslevel helpers: user_ops.c
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 14 Sep 2013 21:00:46 +0000 (23:00 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 14 Sep 2013 21:00:46 +0000 (23:00 +0200)
citadel/citserver.c
citadel/user_ops.c

index 666c9cb52aa783a772dce1fd67bc514db8f78bc4..d8eab8d2a56f676e3b2ae39487cfb3aa7791b788 100644 (file)
@@ -368,52 +368,6 @@ int CtdlIsPublicClient(void)
 
 
 
-/*
- * Convenience function.
- */
-int CtdlAccessCheck(int required_level) {
-
-       if (CC->internal_pgm) return(0);
-       if (required_level >= ac_internal) {
-               cprintf("%d This is not a user-level command.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
-               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);
-       }
-
-       if (CC->user.axlevel >= AxAideU) return(0);
-       if (required_level >= ac_aide) {
-               cprintf("%d This command requires Admin access.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
-               return(-1);
-       }
-
-       if (is_room_aide()) return(0);
-       if (required_level >= ac_room_aide) {
-               cprintf("%d This command requires Admin or Room Admin access.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
-               return(-1);
-       }
-
-       /* shhh ... succeed quietly */
-       return(0);
-}
-
-
-
-
-
-
-
 
 /*
  * Back-end function for starting a session
index 3e28fec7cbd39ffc1eb0ad09d294b2a22550be22..71c0af3d3ecf4f6683bdc21d640d2c2c5e95861d 100644 (file)
@@ -390,6 +390,47 @@ int CtdlCheckInternetMailPermission(struct ctdluser *who) {
        return(0);
 }
 
+/*
+ * Convenience function.
+ */
+int CtdlAccessCheck(int required_level)
+{
+       if (CC->internal_pgm) return(0);
+       if (required_level >= ac_internal) {
+               cprintf("%d This is not a user-level command.\n",
+                       ERROR + HIGHER_ACCESS_REQUIRED);
+               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);
+       }
+
+       if (CC->user.axlevel >= AxAideU) return(0);
+       if (required_level >= ac_aide) {
+               cprintf("%d This command requires Admin access.\n",
+                       ERROR + HIGHER_ACCESS_REQUIRED);
+               return(-1);
+       }
+
+       if (is_room_aide()) return(0);
+       if (required_level >= ac_room_aide) {
+               cprintf("%d This command requires Admin or Room Admin access.\n",
+                       ERROR + HIGHER_ACCESS_REQUIRED);
+               return(-1);
+       }
+
+       /* shhh ... succeed quietly */
+       return(0);
+}
+
+
 
 /*
  * Is the user currently logged in an Admin?