]> git.mxchange.org Git - mailer.git/commitdiff
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 e9afe0281ff808b95073d88d662b671a5d4df121..509196238260f3ab56da0b569a75353a2e973488 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 018e8b6fd4b658b5319f2da337f86fbadc94f01c..9345e507e282ea4e641be0549a26c8a6bee76cad 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 5b30f4f795174e15a0dd36501aa36651104efcd9..744aadb9f4013e15957808ee834e50e188346e0b 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 a358c8d74a31730107d78eb09ce915688c3d742c..4baf15fa48f0eb3f962e7c80bcfc7f402a279a1e 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);