]> git.mxchange.org Git - mailer.git/commitdiff
Several kinky code smoothed, fixes for admin login
authorRoland Häder <roland@mxchange.org>
Fri, 30 Oct 2009 11:34:35 +0000 (11:34 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 30 Oct 2009 11:34:35 +0000 (11:34 +0000)
inc/config-functions.php
inc/db/lib.php
inc/extensions-functions.php
inc/filter-functions.php
inc/filters.php
inc/functions.php
inc/loader/load_cache-extension.php
inc/modules/admin/what-config_session.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/wrapper-functions.php

index fd29373344d66379df08aeea07eb6577c39f2ecd..8f25e9223c51a002747d11f8911c170ceeacf166 100644 (file)
@@ -97,6 +97,7 @@ function setConfigEntry ($configEntry, $value) {
 
 // Checks wether the given config entry is set
 function isConfigEntrySet ($configEntry) {
 
 // Checks wether the given config entry is set
 function isConfigEntrySet ($configEntry) {
+       //* DEBUG: */ print __FUNCTION__.':'.$configEntry.'='.intval(isset($GLOBALS['config'][$configEntry])).'<br />';
        return (isset($GLOBALS['config'][$configEntry]));
 }
 
        return (isset($GLOBALS['config'][$configEntry]));
 }
 
index a75102395302e5b0ffdeb9967423968169374016..76a097bf2ca33c8902e9a7b71fdae498d9249263 100644 (file)
@@ -41,9 +41,6 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
        die();
 } // END - if
 
-// Is it not set?
-if (!isConfigEntrySet('_DB_TYPE')) setConfigEntry('_DB_TYPE', 'mysql3');
-
 // Create include file name
 $inc = sprintf("inc/db/lib-%s.php", getConfig('_DB_TYPE'));
 
 // Create include file name
 $inc = sprintf("inc/db/lib-%s.php", getConfig('_DB_TYPE'));
 
index 59e2e95ded0f601a09d53dabb77eed19b259741c..dfa79d8fb9c739f19abcb241befba9d73297b13d 100644 (file)
@@ -1036,7 +1036,7 @@ function addExtensionNotes ($ver) {
        $out = ''; $content = array();
 
        // Is do we have verbose output enabled?
        $out = ''; $content = array();
 
        // Is do we have verbose output enabled?
-       if ((getConfig('verbose_sql') == 'Y') || (!isExtensionActive('sql_patches'))) {
+       if ((!isExtensionActive('sql_patches')) || (getConfig('verbose_sql') == 'Y')) {
                // Update notes found?
                if (getExtensionUpdateNotes($ver) != '') {
                        // Update notes found
                // Update notes found?
                if (getExtensionUpdateNotes($ver) != '') {
                        // Update notes found
@@ -1391,9 +1391,9 @@ function FILTER_INIT_EXTENSIONS () {
        // Do we have some entries?
        //* DEBUG */ print __FUNCTION__.': ENTRY!<br />';
        if (isset($GLOBALS['cache_array']['extension']['ext_name'])) {
        // Do we have some entries?
        //* DEBUG */ print __FUNCTION__.': ENTRY!<br />';
        if (isset($GLOBALS['cache_array']['extension']['ext_name'])) {
-               //* DEBUG */ print __FUNCTION__.': CACHE - START!<br />';
                // Load all found extensions if found
                // Load all found extensions if found
-               foreach ($GLOBALS['cache_array']['extension']['ext_name'] as $key=>$ext_name) {
+               //* DEBUG */ print __FUNCTION__.': CACHE - START!<br />';
+               foreach ($GLOBALS['cache_array']['extension']['ext_name'] as $key => $ext_name) {
                        // Load it
                        //* DEBUG */ print __FUNCTION__.': '.$ext_name.' - START<br />';
                        loadExtension($ext_name, 'init');
                        // Load it
                        //* DEBUG */ print __FUNCTION__.': '.$ext_name.' - START<br />';
                        loadExtension($ext_name, 'init');
index 5e3a5d828499c33a1378e12c67dc8ffd33c587ad..819c891e706f685da9238c7430fb7a0133aaa68d 100644 (file)
@@ -119,8 +119,8 @@ ORDER BY
        // Init filters
        registerFilter('init', 'LOAD_CONFIGURATION');
        registerFilter('init', 'INIT_EXTENSIONS');
        // Init filters
        registerFilter('init', 'LOAD_CONFIGURATION');
        registerFilter('init', 'INIT_EXTENSIONS');
-       registerFilter('init', 'LOAD_RUNTIME_INCLUDES');
        registerFilter('init', 'INIT_RANDOMIZER');
        registerFilter('init', 'INIT_RANDOMIZER');
+       registerFilter('init', 'LOAD_RUNTIME_INCLUDES');
        registerFilter('init', 'INIT_RANDOM_NUMBER');
        registerFilter('init', 'CHECK_SVN_REVISION');
        registerFilter('init', 'RUN_DAILY_RESET');
        registerFilter('init', 'INIT_RANDOM_NUMBER');
        registerFilter('init', 'CHECK_SVN_REVISION');
        registerFilter('init', 'RUN_DAILY_RESET');
index 3f7569eaa3ca5d4c12b2daad0cb3a1066d09cb89..4204fbb3c1f2f57926af7ebdd631306282a1e968 100644 (file)
@@ -580,7 +580,16 @@ function FILTER_DETERMINE_WHAT_ACTION () {
        // Get all values
        if ((getOutputMode() != 1) && (getOutputMode() != -1)) {
                // Fix module
        // Get all values
        if ((getOutputMode() != 1) && (getOutputMode() != -1)) {
                // Fix module
-               if (!isModuleSet()) setModule('index');
+               if (!isModuleSet()) {
+                       // Is the request element set?
+                       if (isGetRequestElementSet('module')) {
+                               // Set module from request
+                               setModule(getRequestElement('module'));
+                       } else {
+                               // Set default module 'index'
+                               setModule('index');
+                       }
+               } // END - if
 
                // Fix 'what' if not yet set
                if (!isWhatSet())   setWhat(getWhatFromModule(getModule()));
 
                // Fix 'what' if not yet set
                if (!isWhatSet())   setWhat(getWhatFromModule(getModule()));
index 25610ef39c4263cbded07e7e7d4ddf3acc22c15c..57e2c1036496f8d6305bdaeabc192e9770edb98b 100644 (file)
@@ -458,7 +458,7 @@ function loadEmailTemplate ($template, $content = array(), $UID = 0) {
        } // END - if
 
        // Load user's data
        } // END - if
 
        // Load user's data
-       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content)."<br />");
+       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content).'<br />');
        if (($UID > 0) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if (isExtensionActive('nickname')) {
        if (($UID > 0) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if (isExtensionActive('nickname')) {
@@ -585,7 +585,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
                        // Load email address
                        $result_email = SQL_QUERY_ESC("SELECT `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
                                array(bigintval($toEmail)), __FUNCTION__, __LINE__);
                        // Load email address
                        $result_email = SQL_QUERY_ESC("SELECT `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
                                array(bigintval($toEmail)), __FUNCTION__, __LINE__);
-                       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />");
+                       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email).'<br />');
 
                        // Does the user exist?
                        if (SQL_NUMROWS($result_email)) {
 
                        // Does the user exist?
                        if (SQL_NUMROWS($result_email)) {
@@ -1307,7 +1307,7 @@ function generateRandomCode ($length, $code, $userid, $DATA = '') {
        // Calculate number for generating the code
        $a = $code + getConfig('_ADD') - 1;
 
        // Calculate number for generating the code
        $a = $code + getConfig('_ADD') - 1;
 
-       if (isConfigEntrySet('master_hash')) {
+       if (isConfigEntrySet('master_salt')) {
                // Generate hash with master salt from modula of number with the prime number and other data
                $saltedHash = generateHash(($a % getConfig('_PRIME')) . getConfig('ENCRYPT_SEPERATOR') . $server . getConfig('ENCRYPT_SEPERATOR') . $keys . getConfig('ENCRYPT_SEPERATOR') . $data . getConfig('ENCRYPT_SEPERATOR') . getConfig('DATE_KEY') . getConfig('ENCRYPT_SEPERATOR') . $a, getConfig('master_salt'));
 
                // Generate hash with master salt from modula of number with the prime number and other data
                $saltedHash = generateHash(($a % getConfig('_PRIME')) . getConfig('ENCRYPT_SEPERATOR') . $server . getConfig('ENCRYPT_SEPERATOR') . $keys . getConfig('ENCRYPT_SEPERATOR') . $data . getConfig('ENCRYPT_SEPERATOR') . getConfig('DATE_KEY') . getConfig('ENCRYPT_SEPERATOR') . $a, getConfig('master_salt'));
 
@@ -1315,7 +1315,7 @@ function generateRandomCode ($length, $code, $userid, $DATA = '') {
                $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(getConfig('rand_no') - $a + sqrt(getConfig('_ADD'))) / pi();
        } else {
                // Generate hash with "hash of site key" from modula of number with the prime number and other data
                $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(getConfig('rand_no') - $a + sqrt(getConfig('_ADD'))) / pi();
        } else {
                // Generate hash with "hash of site key" from modula of number with the prime number and other data
-               $saltedHash = generateHash(($a % getConfig('_PRIME')) . getConfig('ENCRYPT_SEPERATOR') . $server . getConfig('ENCRYPT_SEPERATOR') . $keys . getConfig('ENCRYPT_SEPERATOR') . $data . getConfig('ENCRYPT_SEPERATOR') . getConfig('DATE_KEY') . getConfig('ENCRYPT_SEPERATOR') . $a, substr(sha1(getConfig('SITE_KEY')), 0, 8));
+               $saltedHash = generateHash(($a % getConfig('_PRIME')) . getConfig('ENCRYPT_SEPERATOR') . $server . getConfig('ENCRYPT_SEPERATOR') . $keys . getConfig('ENCRYPT_SEPERATOR') . $data . getConfig('ENCRYPT_SEPERATOR') . getConfig('DATE_KEY') . getConfig('ENCRYPT_SEPERATOR') . $a, substr(sha1(getConfig('SITE_KEY')), 0, getConfig('salt_length')));
 
                // Create number from hash
                $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(getConfig('rand_no') - $a + sqrt(getConfig('_ADD'))) / pi();
 
                // Create number from hash
                $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(getConfig('rand_no') - $a + sqrt(getConfig('_ADD'))) / pi();
@@ -1724,7 +1724,7 @@ function extractHostnameFromUrl (&$script) {
        if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
 
        // Generate relative URL
        if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
 
        // Generate relative URL
-       //* DEBUG: */ print("SCRIPT=" . $script."<br />");
+       //* DEBUG: */ print("SCRIPT=" . $script.'<br />');
        if (substr(strtolower($script), 0, 7) == 'http://') {
                // But only if http:// is in front!
                $script = substr($script, (strlen($url) + 7));
        if (substr(strtolower($script), 0, 7) == 'http://') {
                // But only if http:// is in front!
                $script = substr($script, (strlen($url) + 7));
@@ -1733,7 +1733,7 @@ function extractHostnameFromUrl (&$script) {
                $script = substr($script, (strlen($url) + 8));
        }
 
                $script = substr($script, (strlen($url) + 8));
        }
 
-       //* DEBUG: */ print("SCRIPT=" . $script."<br />");
+       //* DEBUG: */ print("SCRIPT=" . $script.'<br />');
        if (substr($script, 0, 1) == '/') $script = substr($script, 1);
 
        // Return host name
        if (substr($script, 0, 1) == '/') $script = substr($script, 1);
 
        // Return host name
@@ -1834,7 +1834,7 @@ function sendRawRequest ($host, $request) {
        } // END - if
 
        // Open connection
        } // END - if
 
        // Open connection
-       //* DEBUG: */ die("SCRIPT=" . $script."<br />");
+       //* DEBUG: */ die("SCRIPT=" . $script.'<br />');
        if ($useProxy === true) {
                // Connect to host through proxy connection
                $fp = @fsockopen(compileCode(getConfig('proxy_host')), bigintval(getConfig('proxy_port')), $errno, $errdesc, 30);
        if ($useProxy === true) {
                // Connect to host through proxy connection
                $fp = @fsockopen(compileCode(getConfig('proxy_host')), bigintval(getConfig('proxy_port')), $errno, $errdesc, 30);
@@ -1952,11 +1952,11 @@ function isEmailValid ($email) {
 function isUrlValid ($URL, $compile=true) {
        // Trim URL a little
        $URL = trim(urldecode($URL));
 function isUrlValid ($URL, $compile=true) {
        // Trim URL a little
        $URL = trim(urldecode($URL));
-       //* DEBUG: */ outputHtml($URL."<br />");
+       //* DEBUG: */ outputHtml($URL.'<br />');
 
        // Compile some chars out...
        if ($compile === true) $URL = compileUriCode($URL, false, false, false);
 
        // Compile some chars out...
        if ($compile === true) $URL = compileUriCode($URL, false, false, false);
-       //* DEBUG: */ outputHtml($URL."<br />");
+       //* DEBUG: */ outputHtml($URL.'<br />');
 
        // Check for the extension filter
        if (isExtensionActive('filter')) {
 
        // Check for the extension filter
        if (isExtensionActive('filter')) {
@@ -2073,8 +2073,15 @@ function generateHash ($plainText, $salt = '') {
                //* DEBUG: */ outputHtml($salt." (".strlen($salt).")<br />");
        } else {
                // Use given salt
                //* DEBUG: */ outputHtml($salt." (".strlen($salt).")<br />");
        } else {
                // Use given salt
+               //* DEBUG: */ print 'salt=' . $salt . '<br />';
                $salt = substr($salt, 0, getConfig('salt_length'));
                $salt = substr($salt, 0, getConfig('salt_length'));
-               //* DEBUG: */ outputHtml("GIVEN={$salt}<br />");
+               //* DEBUG: */ print 'salt=' . $salt . '(' . strlen($salt) . '/' . getConfig('salt_length') . ')<br />';
+
+               // Sanity check on salt
+               if (strlen($salt) != getConfig('salt_length')) {
+                       // Not the same!
+                       debug_report_bug(__FUNCTION__.': salt length mismatch! ('.strlen($salt).'/'.getConfig('salt_length').')');
+               } // END - if
        }
 
        // Return hash
        }
 
        // Return hash
@@ -2167,7 +2174,7 @@ function generatePassString ($passHash) {
        $ret = $passHash;
 
        // Is a secret key and master salt already initialized?
        $ret = $passHash;
 
        // Is a secret key and master salt already initialized?
-       if ((isExtensionInstalled('sql_patches')) && (isConfigEntrySet('_PRIME')) && (isConfigEntrySet('secret_key')) && (isConfigEntrySet('master_salt'))) {
+       if ((isExtensionInstalled('sql_patches')) && (isExtensionInstalledAndNewer('other', '0.2.5')) && (isConfigEntrySet('_PRIME')) && (isConfigEntrySet('secret_key')) && (isConfigEntrySet('master_salt'))) {
                // Only calculate when the secret key is generated
                $newHash = ''; $start = 9;
                for ($idx = 0; $idx < 10; $idx++) {
                // Only calculate when the secret key is generated
                $newHash = ''; $start = 9;
                for ($idx = 0; $idx < 10; $idx++) {
@@ -2179,16 +2186,17 @@ function generatePassString ($passHash) {
                        } elseif ($part2 > $part1) {
                                $mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
                        }
                        } elseif ($part2 > $part1) {
                                $mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
                        }
-                       $mod = substr(round($mod), 0, 4);
-                       $mod = str_repeat(0, 4-strlen($mod)) . $mod;
-                       //* DEBUG: */ outputHtml("*" . $start.'=' . $mod."*<br />");
+                       $mod = substr($mod, 0, 4);
+                       //* DEBUG: */ outputHtml('part1='.$part1.'/part2='.$part2.'/mod=' . $mod . '('.strlen($mod).')<br />');
+                       $mod = str_repeat(0, (4 - strlen($mod))) . $mod;
+                       //* DEBUG: */ outputHtml('*' . $start . '=' . $mod . '*<br />');
                        $start += 4;
                        $newHash .= $mod;
                } // END - for
 
                        $start += 4;
                        $newHash .= $mod;
                } // END - for
 
-               //* DEBUG: */ print($passHash."<br />" . $newHash." (".strlen($newHash).')');
+               //* DEBUG: */ print($passHash.'<br />' . $newHash." (".strlen($newHash).')<br />');
                $ret = generateHash($newHash, getConfig('master_salt'));
                $ret = generateHash($newHash, getConfig('master_salt'));
-               //* DEBUG: */ print($ret."<br />");
+               //* DEBUG: */ print('ret='.$ret.'<br />');
        } else {
                // Hash it simple
                //* DEBUG: */ outputHtml("--" . $passHash."--<br />");
        } else {
                // Hash it simple
                //* DEBUG: */ outputHtml("--" . $passHash."--<br />");
@@ -2421,12 +2429,12 @@ function generateErrorCodeFromUserStatus ($status) {
 // Function to search for the last modifified file
 function searchDirsRecursive ($dir, &$last_changed) {
        // Get dir as array
 // Function to search for the last modifified file
 function searchDirsRecursive ($dir, &$last_changed) {
        // Get dir as array
-       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir."<br />");
+       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir.'<br />');
        // Does it match what we are looking for? (We skip a lot files already!)
        // RegexPattern to exclude  ., .., .revision,  .svn, debug.log or .cache in the filenames
        $excludePattern = '@(\.revision|debug\.log|\.cache|config\.php)$@';
        $ds = getArrayFromDirectory($dir, '', true, false, array(), '.php', $excludePattern);
        // Does it match what we are looking for? (We skip a lot files already!)
        // RegexPattern to exclude  ., .., .revision,  .svn, debug.log or .cache in the filenames
        $excludePattern = '@(\.revision|debug\.log|\.cache|config\.php)$@';
        $ds = getArrayFromDirectory($dir, '', true, false, array(), '.php', $excludePattern);
-       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds)."<br />");
+       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds).'<br />');
 
        // Walk through all entries
        foreach ($ds as $d) {
 
        // Walk through all entries
        foreach ($ds as $d) {
@@ -2439,7 +2447,7 @@ function searchDirsRecursive ($dir, &$last_changed) {
                        // $FQFN is a directory so also crawl into this directory
                        $newDir = $d;
                        if (!empty($dir)) $newDir = $dir . '/'. $d;
                        // $FQFN is a directory so also crawl into this directory
                        $newDir = $d;
                        if (!empty($dir)) $newDir = $dir . '/'. $d;
-                       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir."<br />");
+                       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir.'<br />');
                        searchDirsRecursive($newDir, $last_changed);
                } elseif (isFileReadable($FQFN)) {
                        // $FQFN is a filename and no directory
                        searchDirsRecursive($newDir, $last_changed);
                } elseif (isFileReadable($FQFN)) {
                        // $FQFN is a filename and no directory
@@ -2854,7 +2862,7 @@ function isUrlValidSimple ($url) {
                        // @TODO Are these convertions still required?
                        $pat = str_replace('.', "&#92;&#46;", $pat);
                        $pat = str_replace('@', "&#92;&#64;", $pat);
                        // @TODO Are these convertions still required?
                        $pat = str_replace('.', "&#92;&#46;", $pat);
                        $pat = str_replace('@', "&#92;&#64;", $pat);
-                       //* DEBUG: */ outputHtml($key."=&nbsp;" . $pat . "<br />");
+                       //* DEBUG: */ outputHtml($key."=&nbsp;" . $pat . '<br />');
                } // END - if
 
                // Check if expression matches
                } // END - if
 
                // Check if expression matches
@@ -3402,7 +3410,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                // Exclude '.', '..' and entries in $excludeArray automatically
                if (in_array($baseFile, $excludeArray, true))  {
                        // Exclude them
                // Exclude '.', '..' and entries in $excludeArray automatically
                if (in_array($baseFile, $excludeArray, true))  {
                        // Exclude them
-                       //* DEBUG: */ outputHtml('excluded=' . $baseFile . "<br />");
+                       //* DEBUG: */ outputHtml('excluded=' . $baseFile . '<br />');
                        continue;
                } // END - if
 
                        continue;
                } // END - if
 
@@ -3416,9 +3424,9 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                // Check if the base filename matches an exclusion pattern and if the pattern is not empty
                if ((!empty($excludePattern)) && (preg_match($excludePattern, $baseFile, $match))) {
                        // These Lines are only for debugging!!
                // Check if the base filename matches an exclusion pattern and if the pattern is not empty
                if ((!empty($excludePattern)) && (preg_match($excludePattern, $baseFile, $match))) {
                        // These Lines are only for debugging!!
-                       //* DEBUG: */ outputHtml('baseDir:' . $baseDir . "<br />");
-                       //* DEBUG: */ outputHtml('baseFile:' . $baseFile . "<br />");
-                       //* DEBUG: */ outputHtml('FQFN:' . $FQFN . "<br />");
+                       //* DEBUG: */ outputHtml('baseDir:' . $baseDir . '<br />');
+                       //* DEBUG: */ outputHtml('baseFile:' . $baseFile . '<br />');
+                       //* DEBUG: */ outputHtml('FQFN:' . $FQFN . '<br />');
 
                        // Exclude this one
                        continue;
 
                        // Exclude this one
                        continue;
index d93cb6656d03ad73dbb1def101ced9ed45267ff3..e4509b218e6c0788690c825628df48efc2a81981 100644 (file)
@@ -65,7 +65,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
                        if ($EXT_DUMMY['ext_css'][$k] == 'Y') addExtensionCssFile($name . '.css');
 
                        // Load extension file itself
                        if ($EXT_DUMMY['ext_css'][$k] == 'Y') addExtensionCssFile($name . '.css');
 
                        // Load extension file itself
-                       if ((($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y') || (isAdmin()))) {
+                       if (($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y')) {
                                $EXT_POOL[] = $name;
                        } // END - if
 
                                $EXT_POOL[] = $name;
                        } // END - if
 
index 5e02381932242a228a78aa84d254b0ddbef0cecd..abc556d8de7da7cae2923cfb58364558ffef1b87 100644 (file)
@@ -39,7 +39,7 @@
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
-}
+} // END - if
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
index f6c1a1f1264f56d8ae6884cbda82cae2c53da8bf..a733ea9abd2440a6c38aa14c0f974e3fcc7b151d 100644 (file)
@@ -70,16 +70,12 @@ initMessages();
 
 // Check if this file is writeable or read-only and warn the user
 if (!isInstalling()) {
 
 // Check if this file is writeable or read-only and warn the user
 if (!isInstalling()) {
-       // Load database layer here
-       loadIncludeOnce('inc/db/lib.php');
-
-       // Set missing module
-       if ((!isModuleSet()) && (isGetRequestElementSet('module'))) setModule(getRequestElement('module'));
-       if (!isModuleSet()) setModule('index');
-
        // Load configuration file(s) here
        loadIncludeOnce('inc/load_config.php');
 
        // Load configuration file(s) here
        loadIncludeOnce('inc/load_config.php');
 
+       // Load database layer here
+       loadIncludeOnce('inc/db/lib.php');
+
        // CSS array
        initExtensionCssFiles();
 
        // CSS array
        initExtensionCssFiles();
 
index 7088fec5ae0bc4740908ed26e467a4db9ac98fb7..3c095aee9e0754c215ad3e02fc5af1e67827c29d 100644 (file)
@@ -641,7 +641,7 @@ function isMember () {
 function isAdmin ($admin = '') {
        // Init variables
        $ret = false; $passCookie = ''; $valPass = '';
 function isAdmin ($admin = '') {
        // Init variables
        $ret = false; $passCookie = ''; $valPass = '';
-       //* DEBUG: */ print(__FUNCTION__.':'.$admin."<br />");
+       //* DEBUG: */ print(__FUNCTION__.':'.$admin.'<br />');
 
        // If admin login is not given take current from cookies...
        if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
 
        // If admin login is not given take current from cookies...
        if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
@@ -649,7 +649,7 @@ function isAdmin ($admin = '') {
                $admin = getSession('admin_login');
                $passCookie = getSession('admin_md5');
        } // END - if
                $admin = getSession('admin_login');
                $passCookie = getSession('admin_md5');
        } // END - if
-       //* DEBUG: */ print(__FUNCTION__.':'.$admin.'/'.$passCookie."<br />");
+       //* DEBUG: */ print(__FUNCTION__.':'.$admin.'/'.$passCookie.'<br />');
 
        // Search in array for entry
        if (isset($GLOBALS['admin_hash'])) {
 
        // Search in array for entry
        if (isset($GLOBALS['admin_hash'])) {
@@ -965,7 +965,7 @@ function getModeAction ($mode, $what) {
                // Get it directly from URL
                return getAction();
        }
                // Get it directly from URL
                return getAction();
        }
-       //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />");
+       //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret.'<br />');
 
        // Does the module have a menu?
        if (ifModuleHasMenu($mode)) {
 
        // Does the module have a menu?
        if (ifModuleHasMenu($mode)) {
@@ -1343,7 +1343,7 @@ function updateReferalCounter ($userid) {
                array(bigintval($userid), $GLOBALS['cache_array']['ref_level'][$userid]), __FUNCTION__, __LINE__);
 
        // When no entry was updated then we have to create it here
                array(bigintval($userid), $GLOBALS['cache_array']['ref_level'][$userid]), __FUNCTION__, __LINE__);
 
        // When no entry was updated then we have to create it here
-       //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />");
+       //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS().'<br />');
        if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
        if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
index 882cd3aa9bd755a3a0554e4c3fc5dce28570aeb8..0f89445a06222c3fcb2a83b573f2a24574efe6f9 100644 (file)
@@ -646,12 +646,14 @@ function redirectToIndexMemberOnlyModule () {
 // Wrapper function for checking if extension is installed and newer or same version
 function isExtensionInstalledAndNewer ($ext_name, $version) {
        // Return it
 // Wrapper function for checking if extension is installed and newer or same version
 function isExtensionInstalledAndNewer ($ext_name, $version) {
        // Return it
+       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=&gt;'.$version.'<br />';
        return ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
 }
 
 // Wrapper function for checking if extension is installed and older than given version
 function isExtensionInstalledAndOlder ($ext_name, $version) {
        // Return it
        return ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
 }
 
 // Wrapper function for checking if extension is installed and older than given version
 function isExtensionInstalledAndOlder ($ext_name, $version) {
        // Return it
+       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'&lt;'.$version.'<br />';
        return ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
 }
 
        return ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
 }