Don't perform checkExtraSecurity when $_no_db_connection is set.
authorjollytoad <jollytoad>
Wed, 2 Mar 2005 09:19:34 +0000 (09:19 +0000)
committerjollytoad <jollytoad>
Wed, 2 Mar 2005 09:19:34 +0000 (09:19 +0000)
classes/Misc.php
libraries/lib.inc.php

index cb4feefce43cb054315410666602aa6f9ca825e9..a5e7a6c521158126ff5a68ed5a0c1b75b99b16c8 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.98.2.1 2005/03/01 10:34:12 jollytoad Exp $
+        * $Id: Misc.php,v 1.98.2.2 2005/03/02 09:19:34 jollytoad Exp $
         */
         
        class Misc {
                 */
                function checkExtraSecurity() {
                        global $conf;
-
-                       // Disallowed logins if extra_login_security is enabled.  These must be lowercase.
-                       $bad_usernames = array('pgsql', 'postgres', 'root', 'administrator');
                        
                        // If extra security is off, return true
                        if (!$conf['extra_login_security']) return true;
                        
+                       // Disallowed logins if extra_login_security is enabled.  These must be lowercase.
+                       $bad_usernames = array('pgsql', 'postgres', 'root', 'administrator');
+                       
                        $server_info = $this->getServerInfo();
                        
                        if ($server_info['password'] == '') return false;
index 8528d87280b523b5f486536111294de2b701fc20..5fa517ed751bdfbe1c66545058551cfba27e96fb 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Function library read in upon startup
         *
-        * $Id: lib.inc.php,v 1.92.2.1 2005/03/01 10:42:28 jollytoad Exp $
+        * $Id: lib.inc.php,v 1.92.2.2 2005/03/02 09:19:35 jollytoad Exp $
         */
        include_once('decorator.inc.php');
        
        if (isset($_SESSION['webdbLanguage']))
                include("./lang/recoded/{$_SESSION['webdbLanguage']}.php");
 
-       // If extra login check fails, back to the login screen
-       $_allowed = $misc->checkExtraSecurity();
-       if (!$_allowed) {
-               include('./login.php');
-               exit;
-       }
-
        // Check database support is properly compiled in
        if (!function_exists('pg_connect')) {
                echo $lang['strnotloaded'];
                        # TODO: nice error
                }
                
+               // If extra login check fails, back to the login screen
+               $_allowed = $misc->checkExtraSecurity();
+               if (!$_allowed) {
+                       include('./login.php');
+                       exit;
+               }
+               
                $_server_info = $misc->getServerInfo();
                
                // Redirect to the login form if not logged in