More fixes for admin login and to early call of isAdmin()
authorRoland Häder <roland@mxchange.org>
Tue, 15 Dec 2009 23:32:51 +0000 (23:32 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 15 Dec 2009 23:32:51 +0000 (23:32 +0000)
inc/filter-functions.php
inc/filters.php
inc/functions.php
inc/gen_sql_patches.php

index e9afe02..5091962 100644 (file)
@@ -100,9 +100,9 @@ ORDER BY
 
        // Init filters
        registerFilter('init', 'LOAD_CONFIGURATION');
+       registerFilter('init', 'INIT_RANDOMIZER');
        registerFilter('init', 'LOAD_RUNTIME_INCLUDES');
        registerFilter('init', 'INIT_EXTENSIONS');
-       registerFilter('init', 'INIT_RANDOMIZER');
        registerFilter('init', 'INIT_RANDOM_NUMBER');
        registerFilter('init', 'CHECK_SVN_REVISION');
        registerFilter('init', 'RUN_DAILY_RESET');
index 018e8b6..9345e50 100644 (file)
@@ -703,14 +703,6 @@ function FILTER_LOAD_RUNTIME_INCLUDES () {
                // Load the include
                loadIncludeOnce($inc);
        } // END - foreach
-
-       // Load admin include file if he is admin
-       if (isAdmin()) {
-               // Administrative functions
-               loadIncludeOnce('inc/modules/admin/admin-inc.php');
-       } // END - if
-       //* DEBUG: */ addPointsThroughReferalSystem('test', 36, 1000);
-       //* DEBUG: */ die();
 }
 
 // Filter for checking admin ACL
index 5b30f4f..744aadb 100644 (file)
@@ -2238,6 +2238,7 @@ function encodeHashForCookie ($passHash) {
                //* DEBUG: */ outputHtml(__FUNCTION__.':'.strlen($passHash).'/'.strlen(getConfig('secret_key')).'<br />');
                if ((strlen($passHash) != 49) || (strlen(getConfig('secret_key')) != 40)) {
                        // Both keys must have same length so return unencrypted
+                       logDebugMessage(__FUNCTION__, __LINE__, strlen($passHash).'!=49/'.strlen(getConfig('secret_key')).'!=40');
                        return $ret;
                } // END - if
 
index a358c8d..4baf15f 100644 (file)
@@ -77,11 +77,8 @@ if (getConfig('file_hash') == '') {
                $fileHash
        );
 
-       // Count of chars to be taken from back of the string
-       $nums = mt_rand(40, 45);
-
        // Generate secret key from a randomized string
-       $secretKey = substr(sha1(generatePassword(mt_rand(128, 256))), -$nums);
+       $secretKey = sha1(generateHash(mt_rand(128, 256)));
 
        // File hash was never created
        writeToFile($FQFN, $secretKey);