Compilation time added, some compileCode() calles removed, ADMIN_WHAT_404 added
authorRoland Häder <roland@mxchange.org>
Wed, 4 Nov 2009 06:39:47 +0000 (06:39 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 4 Nov 2009 06:39:47 +0000 (06:39 +0000)
31 files changed:
inc/functions.php
inc/language/de.php
inc/libs/payout_functions.php
inc/libs/surfbar_functions.php
inc/modules/admin/action-admins.php
inc/modules/admin/action-bank.php
inc/modules/admin/action-country.php
inc/modules/admin/action-doubler.php
inc/modules/admin/action-email.php
inc/modules/admin/action-holiday.php
inc/modules/admin/action-login.php
inc/modules/admin/action-menu.php
inc/modules/admin/action-misc.php
inc/modules/admin/action-mods.php
inc/modules/admin/action-newsletter.php
inc/modules/admin/action-payouts.php
inc/modules/admin/action-primera.php
inc/modules/admin/action-rallye.php
inc/modules/admin/action-repair.php
inc/modules/admin/action-setup.php
inc/modules/admin/action-sponsor.php
inc/modules/admin/action-stats.php
inc/modules/admin/action-surfbar.php
inc/modules/admin/action-task.php
inc/modules/admin/action-theme.php
inc/modules/admin/action-transfer.php
inc/modules/admin/action-user.php
inc/modules/admin/action-wernis.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_payouts.php
inc/mysql-manager.php

index b6d40608d3a53662d16bb29357b04d4dc28e2367..c9d530034735a1d88b48db113107bd8082ac0f42 100644 (file)
@@ -996,6 +996,9 @@ function compileCode ($code, $simple = false, $constants = true, $full = true) {
                return $code;
        } // END - if
 
+       // Start couting
+       $startCompile = explode(' ', microtime());
+
        // Init replacement-array with full security characters
        $secChars = $GLOBALS['security_chars'];
 
@@ -1071,6 +1074,12 @@ function compileCode ($code, $simple = false, $constants = true, $full = true) {
                } // END - foreach
        } // END - if
 
+       // Get timing
+       $compiled = explode(' ', microtime());
+
+       // Add timing
+       $code .= '<!-- Compilation time: ' . ((($compiled[1] + $compiled[0]) - ($startCompile[1] + $startCompile[0])) * 1000). 'ms //-->';
+
        // Return compiled code
        return $code;
 }
@@ -1752,9 +1761,6 @@ function sendPostRequest ($script, $postData) {
                return array('', '', '');
        } // END - if
 
-       // Compile the script name
-       $script = compileCode($script);
-
        // Extract host name from script
        $host = extractHostnameFromUrl($script);
 
@@ -1895,9 +1901,6 @@ function sendRawRequest ($host, $request) {
 
 // Taken from www.php.net eregi() user comments
 function isEmailValid ($email) {
-       // Compile email
-       $email = compileCode($email);
-
        // Check first part of email address
        $first = '[-a-z0-9!#$%&\'*+/=?^_<{|}~]+(\.[-a-zA-Z0-9!#$%&\'*+/=?^_<{|}~]+)*';
 
index cb08ba49fa061e3ea9cceac9914a1344ca5af725..c787381d1350f753ca0ee75902e00d8844963319 100644 (file)
@@ -123,7 +123,8 @@ addMessages(array(
        'ADMIN_LOGOUT_DONE' => "Ausloggen aus dem Admin-Bereich abgeschlossen.",
        'ADMIN_LOGOUT_FAILED' => "Konnte nicht aus dem Admin-Bereich ausloggen! :-(",
        'ADMIN_RELOGIN_LINK' => "Klicken Sie hier, um sich erneut einzuloggen.",
-       'ADMIN_ACTION_404' => "Das aufgerufe Admin-Modul <span class=\"data\">%s</span> ist zwar g&uuml;ltig, konnte aber nicht auf dem Server gefunden werden.",
+       'ADMIN_ACTION_404' => "Das aufgerufe Admin-Hauptmen&uuml; <span class=\"data\">%s</span> ist zwar g&uuml;ltig, konnte aber nicht auf dem Server gefunden werden.",
+       'ADMIN_WHAT_404' => "Das aufgerufe Admin-Untermen&uuml; <span class=\"data\">%s</span> ist zwar g&uuml;ltig, konnte aber nicht auf dem Server gefunden werden.",
        'ALREADY_INSTALLED' => "Dieses Script ist bereits auf diesem Server installiert worden Bitte l&ouml;schen Sie install.php inc/install-inc.php und install.sql von Ihrem Server! (Keine Sorge, Sie k&ouml;nnen es tun...)",
        'ADMIN_MAIN_TITLE' => "Willkommen zum Administrationsbereich",
        'YOU_ARE_HERE' => "Sie sind hier:",
index 77d7121a2e6e03ca8b02d5d9b7c9c0737c01c0d0..167142d23924d9464f9f30a0ae695c1cbf79d453 100644 (file)
@@ -58,9 +58,6 @@ ORDER BY
                if (SQL_NUMROWS($result) > 0) {
                        // Now let's check
                        while ($content = SQL_FETCHARRAY($result)) {
-                               // Compile the type
-                               $content['type'] = compileCode($content['type']);
-
                                // Are these points enougth?
                                if ($points >= $content['min_points']) {
                                        // Prepare content for template
index 1856892d13dfa5b760c19b3081b2a3ecaa05f9f2..1fc4d35ca50341717937e26ca9ba81e1f2315205 100644 (file)
@@ -438,20 +438,16 @@ function SURFBAR_MEMBER_EXECUTE_EDIT_ACTION ($urlData) {
        // Default is nothing done
        $status = false;
 
-       // Translate URLs for testing
-       $url1 = compileCode($urlData['url']);
-       $url2 = compileCode($urlData['edit']['url']);
-
        // Has the URL or limit changed?
        if (true) {
                //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
                // Run the query
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE `id`=%s AND `status`='%s' LIMIT 1",
-               array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
+                       array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
 
                // All fine
                $status = true;
-       }
+       } // END - if
 
        // Return status
        return $status;
index 06867e14ca91739ff3b12ad0dfa46a1002114c28..66c57010955796a0206292a2c46b7d58ece00528 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 6766542044f02103ec839a693dcb507051b31c02..9503b6c9e0266f4f8965edbfcf0829c3991c4360 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index af2e9ecbc0601795f7df35bbb92020c4f4abc7ba..b9b0aa07f7b403017df5b69217f4ddf5384edee0 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index d7599b892f4fa7f7be1a4ae6a8d75f868aa440a8..43a4603327f9402cb38dcfa281da3c76096c81e4 100644 (file)
@@ -51,7 +51,7 @@ if (isIncludeReadable($inc)) {
        loadInclude($inc);
 } else {
        // "what file" not found
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 39e63a964bcb95989d3669b58fa4bf164ac150f4..6a853c0510897c4e3b61d1531483a80d5ae069cf 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 60a75ea96470463bb3de4c3ea9ea381bb736ad22..a6cf78cd22fb4ed0520d5eb02fbfbe09138f87ad 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index e73fccc032d1e0a5833da63c6201c090bf666f35..6350134ef8340f8fc393839157379d5cfd4604d1 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index be767d4bad3791e8085ea975a95c7001f05e452c..9f9ce332eae1add8d4e309636ab82781f83c975f 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 3f67688afa8e594d413d62a9a8e8f9528ada91a0..875745497a0657ee56b89d2119191e5d0a48f2b2 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 //
index fd1754fefca8be0c9a77b9432aa4a09fce5b162d..004cd8cdb0e23ecbef2fc3167cd293ad777982cd 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index f71db925985616bb9db77b52d589eb67121b529a..befe3b74acd53b02c1d5db15427d461ea24fdc8b 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 21c5d95f6880c9e52efac0e70f3309ab151b05da..13ae4a1d4a2b956a0e7f6ba3a236c054b1212822 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 315fda5d4e7196bd9c6d4efc35420b5367d036cd..3d77746a915f6f14d0b8bf1ace6ea011403185f3 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 6a342875fd86ccce043ba67f56e7cae6f42d08cb..8f8d49033db45b9bc7185a7be44eea5fa25a2239 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 4ffb2da4f1e0fca14690eac4b5c776cceb8f8d0c..40dbbdbb49d934a785797df693e674282d8e0475 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 60e5d6868a42dd1194efb627f2f1d165a75f8186..e21de1011bda1dfcc4aae9d27ea50ff57097f79e 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index fb44eea7b6c7642afa1d223963a3197be47806b9..6ca94660a631e2ffd45e2268a588a216318ca98f 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 9f31458f25e6eaa13893a655c9840308ca1fee73..02d66b7297f95f32dcab1b2a47dade45f266c28c 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index c50fae900dea77cab6674c62de2ab5b46e69f7be..1cd344aed08baaa2506a96065a41df81984d04dd 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 4589cb3bd3105ee46bbafb9216b5ff35a1071350..97373241a6c3696036748313f1517e8aa65b7074 100644 (file)
@@ -55,7 +55,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 53fa6484184b3c02a72130ff56f0a85e1b1c9290..b66b48c580d610fad05898616e283ce75878f35e 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index fd4f45ed0833ced9c22dc9f92de95b37a6acf363..11d8405a3e59f4e696c85db649bf46fda4ee5406 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index f2b7ca6892bd367c19ac438b5129b490190f3e20..8d379ac38232c1cec72886c074a49b317144a2ec 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 // [EOF]
index 75296b5ec3a1b8ae24ae50c770a88b21f861fc37..c35124f3975dee6829de703952102d922e0e8f26 100644 (file)
@@ -50,7 +50,7 @@ if (isIncludeReadable($inc)) {
        // Ok, we finally load the admin action module
        loadInclude($inc);
 } else {
-       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), getWhat());
+       addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_WHAT_404'), getWhat());
 }
 
 //
index 22b09b64e0cdc2bd530582d019e21d3e5773de18..db07ff35968b8cbb59178f0ba959cbe33d2f0bd1 100644 (file)
@@ -249,8 +249,8 @@ function doAdminAction () {
                // Default admin action is the overview page
                $what = 'overview';
        } else {
-               // Compile out some chars
-               $what = compileCode($what, false, false, false);
+               // Secure it
+               $what = secureString($what);
        }
 
        // Get action value
@@ -567,9 +567,6 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
 
                        // Shall we process this id? It muss not be empty, of course
                        if (($skip === false) && (!empty($id)) && (!isset($GLOBALS['skip_config'][$id]))) {
-                               // Save this entry
-                               $val = compileCode($val);
-
                                // Translate the value? (comma to dot!)
                                if ((is_array($translateComma)) && (in_array($id, $translateComma))) {
                                        // Then do it here... :)
@@ -1156,9 +1153,6 @@ function sendAdminPasswordResetLink ($email) {
        // Init output
        $OUT = '';
 
-       // Compile out security characters (must be for looking up!)
-       $email = compileCode($email);
-
        // Look up administator login
        $result = SQL_QUERY_ESC("SELECT `id`, `login`, `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `email`='%s' LIMIT 1",
                array($email), __FUNCTION__, __LINE__);
@@ -1197,12 +1191,9 @@ function adminResetValidateHashLogin ($hash, $login) {
        // By default nothing validates... ;)
        $valid = false;
 
-       // Compile the login for lookup
-       $login = compileCode($login);
-
        // Then try to find that user
        $result = SQL_QUERY_ESC("SELECT `id`, `password`, `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
-       array($login), __FUNCTION__, __LINE__);
+               array($login), __FUNCTION__, __LINE__);
 
        // Is an account here?
        if (SQL_NUMROWS($result) == 1) {
@@ -1210,7 +1201,7 @@ function adminResetValidateHashLogin ($hash, $login) {
                $content = SQL_FETCHARRAY($result);
 
                // Generate hash again
-               $hashFromData = generateHash(getConfig('URL').':'.$content['id'].':'.$login.':'.$content['password'], substr($content['password'], 10));
+               $hashFromData = generateHash(getConfig('URL') . ':' . $content['id'] . ':' . $login . ':' . $content['password'], substr($content['password'], 10));
 
                // Does both match?
                $valid = ($hash == $hashFromData);
index 479c54100c817adf4a20488b70de93d4574ae20d..ff1e5c65208cd234bd6141c59cca89dbbc4140fb 100644 (file)
@@ -97,7 +97,6 @@ LIMIT 1",
 
                                        if (!empty($eurl)) {
                                                // Ok, run URL...
-                                               $eurl = compileCode($eurl);
                                                switch ($eenc) {
                                                        case 'md5':
                                                                $fpass = md5($fpass);
index 90c8d83eb01ce56ccd44682df6b67583904a6459..343477e89101ab298cd11456a0754c92bd1132ec 100644 (file)
@@ -869,6 +869,8 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry=false) {
 
        // Run SQL command
        $result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
+
+       // Should we look for affected rows (only update) or found rows?
        if ($updateEntry === true) {
                // Check updated/affected rows
                $ret = (SQL_AFFECTEDROWS() == 1);