Some fixes for surfbar extension (#123), double->single, misc cleanups/fixes
authorRoland Häder <roland@mxchange.org>
Sun, 26 Jul 2009 18:42:27 +0000 (18:42 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Jul 2009 18:42:27 +0000 (18:42 +0000)
35 files changed:
inc/config-local.php.dist
inc/doubler_send.php
inc/functions.php
inc/install-inc.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/user_functions.php
inc/libs/wernis_functions.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-add_surfbar_url.php
inc/modules/admin/what-admins_add.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-list_doubler.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-send_bonus.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-stats.php
inc/modules/member/what-payout.php
inc/modules/member/what-primera.php
inc/modules/member/what-transfer.php
inc/modules/member/what-wernis.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/request-functions.php
inc/wrapper-functions.php
templates/de/emails/admin/admin_payout_request.tpl
templates/de/emails/admin/admin_payout_request_banner.tpl
templates/de/emails/admin/admin_wernis_request.tpl
templates/de/emails/member/member_mydata_notify.tpl
templates/de/emails/member/member_payout_request.tpl
templates/de/emails/member/member_payout_request_banner.tpl
templates/de/emails/member/member_wernis_request.tpl
templates/de/html/admin/admin_admins_add.tpl

index d1c0b948572d7977ad3af956a160a6d7bb747e67..b0d10287f14ae71815857769b70d21a3a0cb09d3 100644 (file)
@@ -47,82 +47,85 @@ if (!defined('__SECURITY')) {
  ************************************************************************/
 
 // CFG: SITE-KEY
-setConfigEntry('SITE_KEY', "");
+setConfigEntry('SITE_KEY', '');
 
 // CFG: DATE-KEY
-setConfigEntry('DATE_KEY', date("d-m-Y (l-F-T)", time()));
+setConfigEntry('DATE_KEY', date('d-m-Y (l-F-T)', time()));
 
 // CFG: DEFAULT-LANGUAGE
-setConfigEntry('DEFAULT_LANG', "de");
+setConfigEntry('DEFAULT_LANG', 'de');
 
 // CFG: NULLPASS-WARNING
-setConfigEntry('WARN_NO_PASS', "Y");
+setConfigEntry('WARN_NO_PASS', 'Y');
 
 // CFG: WRITE-FOOTER
-setConfigEntry('WRITE_FOOTER', "Y");
+setConfigEntry('WRITE_FOOTER', 'Y');
 
 // CFG: OUTPUT-MODE
-setConfigEntry('OUTPUT_MODE', "render");
+setConfigEntry('OUTPUT_MODE', 'render');
 
 // CFG: INSTALLED
-setConfigEntry('MXCHANGE_INSTALLED', "N");
+setConfigEntry('MXCHANGE_INSTALLED', 'N');
 
 // CFG: ADMIN-SETUP
-setConfigEntry('ADMIN_REGISTERED', "N");
+setConfigEntry('ADMIN_REGISTERED', 'N');
 
 // CFG: MYSQL-PREFIX
-setConfigEntry('_MYSQL_PREFIX', "mxchange");
+setConfigEntry('_MYSQL_PREFIX', 'mxchange');
 
 // CFG: TABLE-TYPE
-setConfigEntry('_TABLE_TYPE', "MyISAM");
+setConfigEntry('_TABLE_TYPE', 'MyISAM');
 
 // CFG: DATABASE-TYPE
-setConfigEntry('_DB_TYPE', "mysql3");
+setConfigEntry('_DB_TYPE', 'mysql3');
 
 // CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!)
-setConfigEntry('DEBUG_MODE', "Y");
+setConfigEntry('DEBUG_MODE', 'Y');
 
 // CFG: BACKLINK (Enable backlink to mxchange.org in footer? rel=external is set!)
 setConfigEntry('ENABLE_BACKLINK', 'Y');
 
 // CFG: DEBUG-RESET (comment in to test daily reset, comment out to not test)
-//setConfigEntry('DEBUG_RESET', "Y");
+//setConfigEntry('DEBUG_RESET', 'Y');
 
 // CFG: DEBUG-MONTHLY (comment in to test monthly reset, comment out to not test)
-//setConfigEntry('DEBUG_MONTHLY', "Y");
+//setConfigEntry('DEBUG_MONTHLY', 'Y');
 
 // CFG: DEBUG-WEEKLY (comment in to test weekly reset, comment out to not test)
-//setConfigEntry('DEBUG_WEEKLY', "Y");
+//setConfigEntry('DEBUG_WEEKLY', 'Y');
+
+// CFG: DEBUG-REGEX (comment in to debug regular expressions)
+//setConfigEntry('DEBUG_REGEX', 'Y');
 
 // Your MySQL data (we don't like M$ SQL ;-) )
 $GLOBALS['mysql'] = array(
        // CFG: MYSQL-HOST
-       'host'     => "localhost",
+       'host'     => 'localhost',
        // CFG: MYSQL-DBASE
-       'dbase'    => "db",
+       'dbase'    => 'db',
        // CFG: MYSQL-LOGIN
-       'login'    => "user",
+       'login'    => 'user',
        // CFG: MYSQL-PASSWORD
-       'password' => "pass",
+       'password' => 'pass',
 );
 
 // SMTP-Subsystem (keep all empty to use legacy mail() command!)
 // CFG: SMTP-HOSTNAME
-setConfigEntry('SMTP_HOSTNAME', "");
+setConfigEntry('SMTP_HOSTNAME', '');
 // CFG: SMTP-USER
-setConfigEntry('SMTP_USER'    , "");
+setConfigEntry('SMTP_USER'    , '');
 // CFG: SMTP-PASSWORD
-setConfigEntry('SMTP_PASSWORD', "");
+setConfigEntry('SMTP_PASSWORD', '');
 
 // @TODO Rewrite the following three constants, somehow...
 // CFG: MAIN-TITLE
-define('MAIN_TITLE', "Your mail-exchanger title");
+define('MAIN_TITLE', 'Your mail-exchanger title');
 
 // CFG: SLOGAN
-define('SLOGAN', "Your cool slogan here");
+define('SLOGAN', 'Your cool slogan here');
 
 // CFG: WEBMASTER
-define('WEBMASTER', "you@some-hoster.tld.invalid");
+define('WEBMASTER', 'you@some-hoster.tld.invalid');
 
 //
 ?>
index cc34bddfedb5cf7b6facae0e50f4d4a2d05d25b8..6e21b9dc23d8f473aabff2840527c43a7242cb3a 100644 (file)
@@ -53,8 +53,8 @@ if ($DOUBLER_POINTS == 0) {
 } // END - if
 
 // If not currently doubled set it to zero
-unset($_GET['DOUBLER_UID']);
-unset($_POST['DOUBLER_UID']);
+REQUEST_UNSET_GET('DOUBLER_UID');
+REQUEST_UNSET_POST('DOUBLER_UID');
 setSession('DOUBLER_UID', '');
 if (empty($GLOBALS['doubler_uid'])) $GLOBALS['doubler_uid'] = 0;
 
index d7a327592143bbfefa1a2c89601faf9ff7c9228d..71538ea79815e23daf5961754171266df50ce86d 100644 (file)
@@ -230,10 +230,10 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
 
        // @DEPRECATED Try to rewrite the if() condition
-       if ($template == "member_support_form") {
+       if ($template == 'member_support_form') {
                // Support request of a member
                $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-               array(getUserId()), __FUNCTION__, __LINE__);
+                       array(getUserId()), __FUNCTION__, __LINE__);
 
                // Is content an array?
                if (is_array($content)) {
@@ -265,27 +265,27 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        $mode = '';
 
        // Check for admin/guest/member templates
-       if (strpos($template, "admin_") > -1) {
+       if (strpos($template, 'admin_') > -1) {
                // Admin template found
-               $mode = "admin/";
-       } elseif (strpos($template, "guest_") > -1) {
+               $mode = 'admin/';
+       } elseif (strpos($template, 'guest_') > -1) {
                // Guest template found
-               $mode = "guest/";
-       } elseif (strpos($template, "member_") > -1) {
+               $mode = 'guest/';
+       } elseif (strpos($template, 'member_') > -1) {
                // Member template found
-               $mode = "member/";
-       } elseif (strpos($template, "install_") > -1) {
+               $mode = 'member/';
+       } elseif (strpos($template, 'install_') > -1) {
                // Installation template found
-               $mode = "install/";
-       } elseif (strpos($template, "ext_") > -1) {
+               $mode = 'install/';
+       } elseif (strpos($template, 'ext_') > -1) {
                // Extension template found
-               $mode = "ext/";
-       } elseif (strpos($template, "la_") > -1) {
-               // "Logical-area" template found
-               $mode = "la/";
+               $mode = 'ext/';
+       } elseif (strpos($template, 'la_') > -1) {
+               // 'Logical-area' template found
+               $mode = 'la/';
        } else {
                // Test for extension
-               $test = substr($template, 0, strpos($template, "_"));
+               $test = substr($template, 0, strpos($template, '_'));
                if (EXT_IS_ACTIVE($test)) {
                        // Set extra path to extension's name
                        $mode = $test.'/';
@@ -295,15 +295,15 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        ////////////////////////
        // Generate file name //
        ////////////////////////
-       $FQFN = $basePath.$mode.$template.".tpl";
+       $FQFN = $basePath . $mode . $template . '.tpl';
 
-       if ((!empty($GLOBALS['what'])) && ((strpos($template, "_header") > 0) || (strpos($template, "_footer") > 0)) && (($mode == "guest/") || ($mode == "member/") || ($mode == "admin/"))) {
+       if ((!empty($GLOBALS['what'])) && ((strpos($template, '_header') > 0) || (strpos($template, '_footer') > 0)) && (($mode == 'guest/') || ($mode == 'member/') || ($mode == 'admin/'))) {
                // Select what depended header/footer template file for admin/guest/member area
                $file2 = sprintf("%s%s%s_%s.tpl",
-               $basePath,
-               $mode,
-               $template,
-               SQL_ESCAPE($GLOBALS['what'])
+                       $basePath,
+                       $mode,
+                       $template,
+                       SQL_ESCAPE($GLOBALS['what'])
                );
 
                // Probe for it...
@@ -311,12 +311,12 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
 
                // Remove variable from memory
                unset($file2);
-       }
+       } // END - if
 
        // Does the special template exists?
        if (!isFileReadable($FQFN)) {
                // Reset to default template
-               $FQFN = $basePath.$template.".tpl";
+               $FQFN = $basePath . $template . '.tpl';
        } // END - if
 
        // Now does the final template exists?
@@ -339,7 +339,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                }
 
                // Add surrounding HTML comments to help finding bugs faster
-               $ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
+               $ret = "<!-- Template " . $template . " - Start -->\n" . $ret . "<!-- Template " . $template . " - End -->\n";
        } elseif ((IS_ADMIN()) || ((isInstalling()) && (!isInstalled()))) {
                // Only admins shall see this warning or when installation mode is active
                $ret = "<br /><span class=\"guest_failed\">{--TEMPLATE_404--}</span><br />
@@ -368,12 +368,12 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                }
        } elseif (isDebugModeEnabled()) {
                // Warning, empty output!
-               return "E:".$template."<br />\n";
+               return "E:" . $template."<br />\n";
        }
 }
 
 // Send mail out to an email address
-function sendEmail($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '') {
+function sendEmail ($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '') {
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />\n";
 
        // Compile subject line (for POINTS constant etc.)
@@ -403,7 +403,7 @@ function sendEmail($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '')
                        // Free result
                        SQL_FREERESULT($result_email);
                }
-       } elseif ("$toEmail" == '0') {
+       } elseif ($toEmail == '0') {
                // Is the webmaster!
                $toEmail = constant('WEBMASTER');
        }
@@ -414,18 +414,18 @@ function sendEmail($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '')
                // Not in PHPMailer-Mode
                if (empty($mailHeader)) {
                        // Load email header template
-                       $mailHeader = LOAD_EMAIL_TEMPLATE("header");
+                       $mailHeader = LOAD_EMAIL_TEMPLATE('header');
                } else {
                        // Append header
-                       $mailHeader .= LOAD_EMAIL_TEMPLATE("header");
+                       $mailHeader .= LOAD_EMAIL_TEMPLATE('header');
                }
        } elseif (isDebugModeEnabled()) {
                if (empty($mailHeader)) {
                        // Load email header template
-                       $mailHeader = LOAD_EMAIL_TEMPLATE("header");
+                       $mailHeader = LOAD_EMAIL_TEMPLATE('header');
                } else {
                        // Append header
-                       $mailHeader .= LOAD_EMAIL_TEMPLATE("header");
+                       $mailHeader .= LOAD_EMAIL_TEMPLATE('header');
                }
        }
 
@@ -441,11 +441,11 @@ function sendEmail($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '')
        if (empty($HTML)) $HTML = 'N';
        if (isDebugModeEnabled()) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
-               print("<pre>
+               OUTPUT_HTML("<pre>
 ".htmlentities(trim($mailHeader))."
-To      : ".$toEmail."
-Subject : ".$subject."
-Message : ".$message."
+To      : " . $toEmail."
+Subject : " . $subject."
+Message : " . $message."
 </pre>\n");
        } elseif (($HTML == 'Y') && (EXT_IS_ACTIVE('html_mail'))) {
                // Send mail as HTML away
@@ -467,7 +467,7 @@ function checkPhpMailerUsage() {
 }
 
 // Send out a raw email with PHPMailer class or legacy mail() command
-function sendRawEmail ($toEmail, $subject, $msg, $from) {
+function sendRawEmail ($toEmail, $subject, $message, $from) {
        // Shall we use PHPMailer class or legacy mode?
        if (checkPhpMailerUsage()) {
                // Use PHPMailer class with SMTP enabled
@@ -491,13 +491,13 @@ function sendRawEmail ($toEmail, $subject, $msg, $from) {
                }
                $mail->FromName   = constant('MAIN_TITLE');
                $mail->Subject    = $subject;
-               if ((EXT_IS_ACTIVE('html_mail')) && (strip_tags($msg) != $msg)) {
-                       $mail->Body       = $msg;
+               if ((EXT_IS_ACTIVE('html_mail')) && (strip_tags($message) != $message)) {
+                       $mail->Body       = $message;
                        $mail->AltBody    = 'Your mail program required HTML support to read this mail!';
                        $mail->WordWrap   = 70;
                        $mail->IsHTML(true);
                } else {
-                       $mail->Body       = decodeEntities($msg);
+                       $mail->Body       = decodeEntities($message);
                }
                $mail->AddAddress($toEmail, '');
                $mail->AddReplyTo(constant('WEBMASTER'), constant('MAIN_TITLE'));
@@ -506,7 +506,7 @@ function sendRawEmail ($toEmail, $subject, $msg, $from) {
                $mail->Send();
        } else {
                // Use legacy mail() command
-               @mail($toEmail, $subject, decodeEntities($msg), $from);
+               mail($toEmail, $subject, decodeEntities($message), $from);
        }
 }
 
@@ -577,7 +577,7 @@ function generateDateTime ($time, $mode = '0') {
 // Translates Y/N to yes/no
 function translateYesNo ($yn) {
        // Default
-       $translated = "??? (".$yn.')';
+       $translated = "??? (" . $yn.')';
        switch ($yn) {
                case 'Y': $translated = getMessage('YES'); break;
                case 'N': $translated = getMessage('NO'); break;
@@ -815,29 +815,29 @@ function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') {
        // Check for admin/guest/member templates
        if (strpos($template, 'admin_') > -1) {
                // Admin template found
-               $FQFN = $basePath.'admin/'.$template.'.tpl';
+               $FQFN = $basePath.'admin/' . $template.'.tpl';
        } elseif (strpos($template, 'guest_') > -1) {
                // Guest template found
-               $FQFN = $basePath.'guest/'.$template.'.tpl';
+               $FQFN = $basePath.'guest/' . $template.'.tpl';
        } elseif (strpos($template, 'member_') > -1) {
                // Member template found
-               $FQFN = $basePath.'member/'.$template.'.tpl';
+               $FQFN = $basePath.'member/' . $template.'.tpl';
        } else {
                // Test for extension
                $test = substr($template, 0, strpos($template, '_'));
                if (EXT_IS_ACTIVE($test)) {
                        // Set extra path to extension's name
-                       $FQFN = $basePath.$test.'/'.$template.'.tpl';
+                       $FQFN = $basePath . $test.'/' . $template.'.tpl';
                } else {
                        // No special filename
-                       $FQFN = $basePath.$template.'.tpl';
+                       $FQFN = $basePath . $template.'.tpl';
                }
        }
 
        // Does the special template exists?
        if (!isFileReadable($FQFN)) {
                // Reset to default template
-               $FQFN = $basePath.$template.'.tpl';
+               $FQFN = $basePath . $template.'.tpl';
        } // END - if
 
        // Now does the final template exists?
@@ -852,7 +852,7 @@ function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') {
                eval($tmpl_file);
        } elseif (!empty($template)) {
                // Template file not found!
-               $newContent = "{--TEMPLATE_404--}: ".$template."<br />
+               $newContent = "{--TEMPLATE_404--}: " . $template."<br />
 {--TEMPLATE_CONTENT--}
 <pre>".print_r($content, true)."</pre>
 {--TEMPLATE_DATA--}
@@ -869,7 +869,7 @@ function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') {
        // Is there some content?
        if (empty($newContent)) {
                // Compiling failed
-               $newContent = "Compiler error for template {$template}!\nUncompiled content:\n".$tmpl_file;
+               $newContent = "Compiler error for template {$template}!\nUncompiled content:\n" . $tmpl_file;
                // Add last error if the required function exists
                if (function_exists('error_get_last')) $newContent .= "\n--------------------------------------\nDebug:\n".print_r(error_get_last(), true)."--------------------------------------\nPlease don't alter these informations!\nThanx.";
        } // END - if
@@ -1027,17 +1027,17 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true)
                        if ($fuzzyFound) continue;
 
                        // Take all string elements
-                       if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_".$matches[4][$key]]))) {
+                       if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_" . $matches[4][$key]]))) {
                                // Replace it in the code
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />\n";
-                               $newMatch = str_replace("[".$matches[4][$key]."]", "['".$matches[4][$key]."']", $match);
-                               $code = str_replace($match, "\".".$newMatch.".\"", $code);
-                               $matchesFound[$key."_".$matches[4][$key]] = 1;
+                               $newMatch = str_replace("[" . $matches[4][$key]."]", "['" . $matches[4][$key]."']", $match);
+                               $code = str_replace($match, "\"." . $newMatch.".\"", $code);
+                               $matchesFound[$key."_" . $matches[4][$key]] = 1;
                                $matchesFound[$match] = 1;
                        } elseif (!isset($matchesFound[$match])) {
                                // Not yet replaced!
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />\n";
-                               $code = str_replace($match, "\".".$match.".\"", $code);
+                               $code = str_replace($match, "\"." . $match.".\"", $code);
                                $matchesFound[$match] = 1;
                        }
                } // END - foreach
@@ -1104,30 +1104,30 @@ function ADD_SELECTION ($type, $default, $prefix = '', $id = '0') {
 
        if ($type == 'yn') {
                // This is a yes/no selection only!
-               if ($id > 0) $prefix .= "[".$id."]";
-               $OUT .= "    <select name=\"".$prefix."\" class=\"register_select\" size=\"1\">\n";
+               if ($id > 0) $prefix .= "[" . $id."]";
+               $OUT .= "    <select name=\"" . $prefix."\" class=\"register_select\" size=\"1\">\n";
        } else {
                // Begin with regular selection box here
                if (!empty($prefix)) $prefix .= "_";
                $type2 = $type;
-               if ($id > 0) $type2 .= "[".$id."]";
-               $OUT .= "    <select name=\"".strtolower($prefix.$type2)."\" class=\"register_select\" size=\"1\">\n";
+               if ($id > 0) $type2 .= "[" . $id."]";
+               $OUT .= "    <select name=\"".strtolower($prefix . $type2)."\" class=\"register_select\" size=\"1\">\n";
        }
 
        switch ($type) {
                case "day": // Day
                        for ($idx = 1; $idx < 32; $idx++) {
-                               $OUT .= "<option value=\"".$idx."\"";
+                               $OUT .= "<option value=\"" . $idx."\"";
                                if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        } // END - for
                        break;
 
                case "month": // Month
                        foreach ($GLOBALS['month_descr'] as $month => $descr) {
-                               $OUT .= "<option value=\"".$month."\"";
+                               $OUT .= "<option value=\"" . $month."\"";
                                if ($default == $month) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$descr."</option>\n";
+                               $OUT .= ">" . $descr."</option>\n";
                        } // END - for
                        break;
 
@@ -1150,19 +1150,19 @@ function ADD_SELECTION ($type, $default, $prefix = '', $id = '0') {
                        // Check if the default value is larger than minimum and bigger than actual year
                        if (($default > $minYear) && ($default >= $year)) {
                                for ($idx = $year; $idx < ($year + 11); $idx++) {
-                                       $OUT .= "<option value=\"".$idx."\"";
+                                       $OUT .= "<option value=\"" . $idx."\"";
                                        if ($default == $idx) $OUT .= ' selected="selected"';
-                                       $OUT .= ">".$idx."</option>\n";
+                                       $OUT .= ">" . $idx."</option>\n";
                                } // END - for
                        } elseif ($default == -1) {
                                // Current year minus 1
                                for ($idx = $startYear; $idx <= ($year + 1); $idx++)
                                {
-                                       $OUT .= "<option value=\"".$idx."\">".$idx."</option>\n";
+                                       $OUT .= "<option value=\"" . $idx."\">" . $idx."</option>\n";
                                }
                        } else {
                                // Get current year and subtract the configured minimum age
-                               $OUT .= "<option value=\"".($minYear - 1)."\">&lt;".$minYear."</option>\n";
+                               $OUT .= "<option value=\"".($minYear - 1)."\">&lt;" . $minYear."</option>\n";
                                // Calculate earliest year depending on extension version
                                if (GET_EXT_VERSION('other') >= '0.2.1') {
                                        // Use configured minimum age
@@ -1174,9 +1174,9 @@ function ADD_SELECTION ($type, $default, $prefix = '', $id = '0') {
 
                                // Construct year selection list
                                for ($idx = $minYear; $idx <= $year; $idx++) {
-                                       $OUT .= "<option value=\"".$idx."\"";
+                                       $OUT .= "<option value=\"" . $idx."\"";
                                        if ($default == $idx) $OUT .= ' selected="selected"';
-                                       $OUT .= ">".$idx."</option>\n";
+                                       $OUT .= ">" . $idx."</option>\n";
                                } // END - for
                        }
                        break;
@@ -1184,19 +1184,19 @@ function ADD_SELECTION ($type, $default, $prefix = '', $id = '0') {
                case "sec":
                case "min":
                        for ($idx = 0; $idx < 60; $idx+=5) {
-                               if (strlen($idx) == 1) $idx = '0'.$idx;
-                               $OUT .= "<option value=\"".$idx."\"";
+                               if (strlen($idx) == 1) $idx = '0' . $idx;
+                               $OUT .= "<option value=\"" . $idx."\"";
                                if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        } // END - for
                        break;
 
                case "hour":
                        for ($idx = 0; $idx < 24; $idx++) {
-                               if (strlen($idx) == 1) $idx = '0'.$idx;
-                               $OUT .= "<option value=\"".$idx."\"";
+                               if (strlen($idx) == 1) $idx = '0' . $idx;
+                               $OUT .= "<option value=\"" . $idx."\"";
                                if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        } // END - for
                        break;
 
@@ -1232,27 +1232,27 @@ function generateRandomCode ($length, $code, $uid, $DATA = '') {
        if (isConfigEntrySet('master_salt')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
 
        // Build string from misc data
-       $data   = $code.getConfig('ENCRYPT_SEPERATOR').$uid.getConfig('ENCRYPT_SEPERATOR').$DATA;
+       $data   = $code.getConfig('ENCRYPT_SEPERATOR') . $uid.getConfig('ENCRYPT_SEPERATOR') . $DATA;
 
        // Add more additional data
        if (isSessionVariableSet('u_hash'))         $data .= getConfig('ENCRYPT_SEPERATOR').getSession('u_hash');
        if (isUserIdSet())                          $data .= getConfig('ENCRYPT_SEPERATOR').getUserId();
        if (isSessionVariableSet('mxchange_theme')) $data .= getConfig('ENCRYPT_SEPERATOR').getSession('mxchange_theme');
        if (isSessionVariableSet('mx_lang'))        $data .= getConfig('ENCRYPT_SEPERATOR').getLanguage();
-       if (isset($GLOBALS['refid']))               $data .= getConfig('ENCRYPT_SEPERATOR').$GLOBALS['refid'];
+       if (isset($GLOBALS['refid']))               $data .= getConfig('ENCRYPT_SEPERATOR') . $GLOBALS['refid'];
 
        // Calculate number for generating the code
        $a = $code + getConfig('_ADD') - 1;
 
        if (isConfigEntrySet('master_hash')) {
                // 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'));
+               $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'));
 
                // Create number from hash
                $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(constant('_MAX') - $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, 8));
 
                // Create number from hash
                $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(constant('_MAX') - $a + sqrt(getConfig('_ADD'))) / pi();
@@ -1280,7 +1280,7 @@ function bigintval ($num, $castValue = true) {
 
        // Has the whole value changed?
        // @TODO Remove this if() block if all is working fine
-       if ("".$ret."" != ''.$num."") {
+       if ("" . $ret."" != '' . $num."") {
                // Log the values
                debug_report_bug("{$ret}<>{$num}");
        } // END - if
@@ -1296,7 +1296,7 @@ function GENERATE_IMAGE ($img_code, $headerSent=true) {
                return;
        } elseif (!$headerSent) {
                // Return in an HTML code code
-               return "<img src=\"{!URL!}/img.php?code=".$img_code."\" alt=\"Image\" />\n";
+               return "<img src=\"{!URL!}/img.php?code=" . $img_code."\" alt=\"Image\" />\n";
        }
 
        // Load image
@@ -1343,7 +1343,7 @@ function GENERATE_IMAGE ($img_code, $headerSent=true) {
 function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
        // Calculate 2-seconds timestamp
        $stamp = round($timestamp);
-       //* DEBUG: */ print("*".$stamp.'/'.$timestamp."*<br />");
+       //* DEBUG: */ print("*" . $stamp.'/' . $timestamp."*<br />");
 
        // Do we have a leap year?
        $SWITCH = 0;
@@ -1398,7 +1398,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
                );
        } else {
                // Generate table
-               $OUT  = "<div align=\"".$align."\">\n";
+               $OUT  = "<div align=\"" . $align."\">\n";
                $OUT .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_table dashed\">\n";
                $OUT .= "<tr>\n";
 
@@ -1435,94 +1435,94 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
 
                if (ereg('Y', $display) || (empty($display))) {
                        // Generate year selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_ye\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_ye\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 10; $idx++) {
-                               $OUT .= "    <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "    <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $Y) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ye\" value=\"0\" />\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_ye\" value=\"0\" />\n";
                }
 
                if (ereg("M", $display) || (empty($display))) {
                        // Generate month selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_mo\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_mo\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 11; $idx++)
                        {
-                               $OUT .= "  <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "  <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $M) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mo\" value=\"0\" />\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_mo\" value=\"0\" />\n";
                }
 
                if (ereg("W", $display) || (empty($display))) {
                        // Generate week selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_we\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_we\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 4; $idx++) {
-                               $OUT .= "  <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "  <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $W) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_we\" value=\"0\" />\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_we\" value=\"0\" />\n";
                }
 
                if (ereg("D", $display) || (empty($display))) {
                        // Generate day selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_da\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_da\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 31; $idx++) {
-                               $OUT .= "  <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "  <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $D) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_da\" value=\"0\">\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_da\" value=\"0\">\n";
                }
 
                if (ereg("h", $display) || (empty($display))) {
                        // Generate hour selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_ho\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_ho\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 23; $idx++)      {
-                               $OUT .= "  <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "  <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $h) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ho\" value=\"0\">\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_ho\" value=\"0\">\n";
                }
 
                if (ereg('m', $display) || (empty($display))) {
                        // Generate minute selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_mi\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_mi\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 59; $idx++) {
-                               $OUT .= "  <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "  <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $m) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mi\" value=\"0\">\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_mi\" value=\"0\">\n";
                }
 
                if (ereg("s", $display) || (empty($display))) {
                        // Generate second selection
-                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_se\" size=\"1\">\n";
+                       $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_se\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 59; $idx++) {
-                               $OUT .= "  <option class=\"mini_select\" value=\"".$idx."\"";
+                               $OUT .= "  <option class=\"mini_select\" value=\"" . $idx."\"";
                                if ($idx == $s) $OUT .= ' selected="selected"';
-                               $OUT .= ">".$idx."</option>\n";
+                               $OUT .= ">" . $idx."</option>\n";
                        }
                        $OUT .= "  </select></td>\n";
                } else {
-                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_se\" value=\"0\">\n";
+                       $OUT .= "<INPUT type=\"hidden\" name=\"" . $prefix."_se\" value=\"0\">\n";
                }
                $OUT .= "</tr>\n";
                $OUT .= "</table>\n";
@@ -1568,7 +1568,7 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
        $template = trim($template);
 
        // Load email template
-       $msg = LOAD_EMAIL_TEMPLATE($template, $content, $UID);
+       $message = LOAD_EMAIL_TEMPLATE($template, $content, $UID);
 
        // Check which admin shall receive this mail
        $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM `{!_MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY admin_id",
@@ -1596,7 +1596,7 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
                if ($aid == '-1') {
                        if (EXT_IS_ACTIVE('events')) {
                                // Add line to user events
-                               EVENTS_ADD_LINE($subj, $msg, $UID);
+                               EVENTS_ADD_LINE($subj, $message, $UID);
                        } else {
                                // Log error for debug
                                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Extension 'events' missing: tpl=%s,subj=%s,UID=%s",
@@ -1618,7 +1618,7 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
 
        // Load email addresses and send away
        while ($content = SQL_FETCHARRAY($result)) {
-               sendEmail($content['email'], $subj, $msg);
+               sendEmail($content['email'], $subj, $message);
        } // END - while
 
        // Free memory
@@ -1657,7 +1657,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
        $SEP = ''; $TOP = '';
        if (!$show_form) {
                $TOP = " top2";
-               $SEP = "<tr><td colspan=\"".$colspan."\" class=\"seperator\">&nbsp;</td></tr>";
+               $SEP = "<tr><td colspan=\"" . $colspan."\" class=\"seperator\">&nbsp;</td></tr>";
        }
 
        $NAV = '';
@@ -1668,7 +1668,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
                        $NAV .= "<strong>-";
                } else {
                        // Open anchor tag and add base URL
-                       $NAV .= "<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$GLOBALS['what']."&amp;page=".$page."&amp;offset=".$offset;
+                       $NAV .= "<a href=\"{!URL!}/modules.php?module=admin&amp;what=" . $GLOBALS['what']."&amp;page=" . $page."&amp;offset=" . $offset;
 
                        // Add userid when we shall show all mails from a single member
                        if ((REQUEST_ISSET_GET('uid')) && (bigintval(REQUEST_GET('uid')) > 0)) $NAV .= "&amp;uid=".bigintval(REQUEST_GET('uid'));
@@ -1728,7 +1728,7 @@ function extractHostnameFromUrl (&$script) {
        if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
 
        // Generate relative URL
-       //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
+       //* DEBUG: */ print("SCRIPT=" . $script."<br />\n");
        if (substr(strtolower($script), 0, 7) == 'http://') {
                // But only if http:// is in front!
                $script = substr($script, (strlen($url) + 7));
@@ -1737,7 +1737,7 @@ function extractHostnameFromUrl (&$script) {
                $script = substr($script, (strlen($url) + 8));
        }
 
-       //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
+       //* DEBUG: */ print("SCRIPT=" . $script."<br />\n");
        if (substr($script, 0, 1) == '/') $script = substr($script, 1);
 
        // Return host name
@@ -1826,7 +1826,7 @@ function sendRawRequest ($host, $request) {
        } // END - if
 
        // Open connection
-       //* DEBUG: */ die("SCRIPT=".$script."<br />\n");
+       //* DEBUG: */ die("SCRIPT=" . $script."<br />\n");
        if ($useProxy === true) {
                // Connect to host through proxy connection
                $fp = @fsockopen(COMPILE_CODE(getConfig('proxy_host')), bigintval(getConfig('proxy_port')), $errno, $errdesc, 30);
@@ -1856,7 +1856,7 @@ function sendRawRequest ($host, $request) {
 
                // Add last new-line
                $proxyTunnel .= getConfig('HTTP_EOL');
-               //* DEBUG: */ print("<strong>proxyTunnel=</strong><pre>".$proxyTunnel."</pre>");
+               //* DEBUG: */ print("<strong>proxyTunnel=</strong><pre>" . $proxyTunnel."</pre>");
 
                // Write request
                fputs($fp, $proxyTunnel);
@@ -1948,13 +1948,13 @@ function isUrlValid ($URL, $compile=true) {
        //* DEBUG: */ echo $URL."<br />";
 
        // Compile some chars out...
-       if ($compile) $URL = compileUriCode($URL, false, false, false);
+       if ($compile === true) $URL = compileUriCode($URL, false, false, false);
        //* DEBUG: */ echo $URL."<br />";
 
        // Check for the extension filter
        if (EXT_IS_ACTIVE('filter')) {
                // Use the extension's filter set
-               return FILTER_isUrlValid($URL, false);
+               return FILTER_VALIDATE_URL($URL, false);
        } // END - if
 
        // If not installed, perform a simple test. Just make it sure there is always a http:// or
@@ -1971,8 +1971,8 @@ function generateMemberAdminActionLinks ($uid, $status = '') {
        $eval = "\$OUT = \"[&nbsp;";
 
        foreach ($TARGETS as $tar) {
-               $eval .= "<span class=\\\"admin_user_link\\\"><a href=\\\"{!URL!}/modules.php?module=admin&amp;what=".$tar."&amp;uid=".$uid."\\\" title=\\\"{--ADMIN_LINK_";
-               //* DEBUG: */ echo "*".$tar.'/'.$status."*<br />\n";
+               $eval .= "<span class=\\\"admin_user_link\\\"><a href=\\\"{!URL!}/modules.php?module=admin&amp;what=" . $tar."&amp;uid=" . $uid."\\\" title=\\\"{--ADMIN_LINK_";
+               //* DEBUG: */ echo "*" . $tar.'/' . $status."*<br />\n";
                if (($tar == "lock_user") && ($status == 'LOCKED')) {
                        // Locked accounts shall be unlocked
                        $eval .= "UNLOCK_USER";
@@ -2052,12 +2052,12 @@ function generateHash ($plainText, $salt = '') {
                $a = time() + getConfig('_ADD') - 1;
 
                // Generate SHA1 sum from modula of number and the prime number
-               $sha1 = sha1(($a % getConfig('_PRIME')).$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a);
-               //* DEBUG: */ echo "SHA1=".$sha1." (".strlen($sha1).")<br />";
+               $sha1 = sha1(($a % getConfig('_PRIME')) . $server.getConfig('ENCRYPT_SEPERATOR') . $keys.getConfig('ENCRYPT_SEPERATOR') . $data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR') . $a);
+               //* DEBUG: */ echo "SHA1=" . $sha1." (".strlen($sha1).")<br />";
                $sha1 = scrambleString($sha1);
-               //* DEBUG: */ echo "Scrambled=".$sha1." (".strlen($sha1).")<br />";
+               //* DEBUG: */ echo "Scrambled=" . $sha1." (".strlen($sha1).")<br />";
                //* DEBUG: */ $sha1b = descrambleString($sha1);
-               //* DEBUG: */ echo "Descrambled=".$sha1b." (".strlen($sha1b).")<br />";
+               //* DEBUG: */ echo "Descrambled=" . $sha1b." (".strlen($sha1b).")<br />";
 
                // Generate the password salt string
                $salt = substr($sha1, 0, getConfig('salt_length'));
@@ -2069,7 +2069,7 @@ function generateHash ($plainText, $salt = '') {
        }
 
        // Return hash
-       return $salt.sha1($salt.$plainText);
+       return $salt.sha1($salt . $plainText);
 }
 
 // Scramble a string
@@ -2090,7 +2090,7 @@ function scrambleString($str) {
        }
 
        // Scramble string here
-       //* DEBUG: */ echo "***Original=".$str."***<br />";
+       //* DEBUG: */ echo "***Original=" . $str."***<br />";
        for ($idx = 0; $idx < strlen($str); $idx++) {
                // Get char on scrambled position
                $char = substr($str, $scrambleNums[$idx], 1);
@@ -2100,7 +2100,7 @@ function scrambleString($str) {
        } // END - for
 
        // Return scrambled string
-       //* DEBUG: */ echo "***Scrambled=".$scrambled."***<br />";
+       //* DEBUG: */ echo "***Scrambled=" . $scrambled."***<br />";
        return $scrambled;
 }
 
@@ -2117,14 +2117,14 @@ function descrambleString($str) {
 
        // Begin descrambling
        $orig = str_repeat(" ", 40);
-       //* DEBUG: */ echo "+++Scrambled=".$str."+++<br />";
+       //* DEBUG: */ echo "+++Scrambled=" . $str."+++<br />";
        for ($idx = 0; $idx < 40; $idx++) {
                $char = substr($str, $idx, 1);
                $orig = substr_replace($orig, $char, $scrambleNums[$idx], 1);
        } // END - for
 
        // Return scrambled string
-       //* DEBUG: */ echo "+++Original=".$orig."+++<br />";
+       //* DEBUG: */ echo "+++Original=" . $orig."+++<br />";
        return $orig;
 }
 
@@ -2171,20 +2171,20 @@ function generatePassString ($passHash) {
                                $mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
                        }
                        $mod = substr(round($mod), 0, 4);
-                       $mod = str_repeat('0', 4-strlen($mod)).$mod;
-                       //* DEBUG: */ echo "*".$start.'='.$mod."*<br />";
+                       $mod = str_repeat('0', 4-strlen($mod)) . $mod;
+                       //* DEBUG: */ echo "*" . $start.'=' . $mod."*<br />";
                        $start += 4;
                        $newHash .= $mod;
                } // END - for
 
-               //* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).')');
+               //* DEBUG: */ print($passHash."<br />" . $newHash." (".strlen($newHash).')');
                $ret = generateHash($newHash, getConfig('master_salt'));
                //* DEBUG: */ print($ret."<br />\n");
        } else {
                // Hash it simple
-               //* DEBUG: */ echo "--".$passHash."--<br />\n";
+               //* DEBUG: */ echo "--" . $passHash."--<br />\n";
                $ret = md5($passHash);
-               //* DEBUG: */ echo "++".$ret."++<br />\n";
+               //* DEBUG: */ echo "++" . $ret."++<br />\n";
        }
 
        // Return result
@@ -2206,7 +2206,7 @@ function fixDeletedCookies ($cookies) {
 }
 
 // Output error messages in a fasioned way and die...
-function app_die ($F, $L, $msg) {
+function app_die ($F, $L, $message) {
        // Check if Script is already dieing and not let it kill itself another 1000 times
        if (!isset($GLOBALS['app_died'])) {
                // Make sure, that the script realy realy diese here and now
@@ -2216,16 +2216,16 @@ function app_die ($F, $L, $msg) {
                loadIncludeOnce('inc/header.php');
 
                // Prepare message for output
-               $msg = sprintf(getMessage('MXCHANGE_HAS_DIED'), basename($F), $L, $msg);
+               $message = sprintf(getMessage('MXCHANGE_HAS_DIED'), basename($F), $L, $message);
 
                // Load the message template
-               LOAD_TEMPLATE('admin_settings_saved', false, $msg);
+               LOAD_TEMPLATE('admin_settings_saved', false, $message);
 
                // Load footer
                loadIncludeOnce('inc/footer.php');
        } else {
                // Script tried to kill itself twice
-               debug_report_bug('Script wanted to kill itself more than once! Raw message=' . $msg . ', file/function=' . $F . ', line=' . $L);
+               debug_report_bug('Script wanted to kill itself more than once! Raw message=' . $message . ', file/function=' . $F . ', line=' . $L);
        }
 }
 
@@ -2267,14 +2267,14 @@ function isBooleanConstantAndTrue ($constName) { // : Boolean
        // In cache?
        if (isset($GLOBALS['cache_array']['const'][$constName])) {
                // Use cache
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-CACHE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-CACHE!<br />\n";
                $res = ($GLOBALS['cache_array']['const'][$constName] === true);
        } else {
                // Check constant
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-RESOLVE!<br />\n";
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-RESOLVE!<br />\n";
                if (defined($constName)) {
                        // Found!
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-FOUND!<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-FOUND!<br />\n";
                        $res = (constant($constName) === true);
                } // END - if
 
@@ -2405,7 +2405,7 @@ function generateErrorCodeFromUserStatus ($status) {
 // Function to search for the last modifified file
 function searchDirsRecursive ($dir, &$last_changed) {
        // Get dir as array
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=".$dir."<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir."<br />\n";
        // 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|\.svn|debug\.log|\.cache|config\.php)$@';
@@ -2423,12 +2423,12 @@ function searchDirsRecursive ($dir, &$last_changed) {
                        // $FQFN is a directory so also crawl into this directory
                        $newDir = $d;
                        if (!empty($dir)) $newDir = $dir . '/'. $d;
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: ".$newDir."<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir."<br />\n";
                        searchDirsRecursive($newDir, $last_changed);
                } elseif (isFileReadable($FQFN)) {
                        // $FQFN is a filename and no directory
                        $time = filemtime($FQFN);
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: ".$d." found. (".($last_changed['time'] - $time).")<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: " . $d." found. (".($last_changed['time'] - $time).")<br />\n";
                        if ($last_changed['time'] < $time) {
                                // This file is newer as the file before
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>) - NEWER!<br />\n";
@@ -2539,7 +2539,7 @@ function getArrayFromActualVersion () {
        // This foreach loops the $searchFor-Tags (array('Revision', 'Date', 'Tag', 'Author') --> could easaly extended in the future)
        foreach ($searchFor as $search) {
                // Searches for "$search-tag:VALUE$" or "$search-tag::VALUE$"(the stylish keywordversion ;-)) in the lates modified file
-               $res += preg_match('@\$'.$search.'(:|::) (.*) \$@U', $last_file, $t);
+               $res += preg_match('@\$' . $search.'(:|::) (.*) \$@U', $last_file, $t);
                // This trimms the search-result and puts it in the $akt_vers-return array
                if (isset($t[2])) $akt_vers[$search] = trim($t[2]);
        } // END - foreach
@@ -2590,7 +2590,7 @@ function debug_get_printable_backtrace () {
                if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
                if (!isset($trace['line'])) $trace['line'] = __LINE__;
                if (!isset($trace['args'])) $trace['args'] = array();
-               $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function'].'('.count($trace['args']).")</span></li>\n";
+               $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:" . $trace['line'].", <span class=\"backtrace_function\">" . $trace['function'].'('.count($trace['args']).")</span></li>\n";
        } // END - foreach
 
        // Close it
@@ -2618,7 +2618,7 @@ function debug_report_bug ($message = '') {
        // Add output
        $debug .= "Please report this bug at <a title=\"Direct link to the bug-tracker\" href=\"http://bugs.mxchange.org\" rel=\"external\" target=\"_blank\">bugs.mxchange.org</a> and include the logfile from <strong>inc/cache/debug.log</strong> in your report (you cannot attach files!):<pre>";
        $debug .= debug_get_printable_backtrace();
-       $debug .= "</pre>\nRequest-URI: ".$_SERVER['REQUEST_URI']."<br />\n";
+       $debug .= "</pre>\nRequest-URI: " . $_SERVER['REQUEST_URI']."<br />\n";
        $debug .= "Thank you for finding bugs.";
 
        // And abort here
@@ -2634,49 +2634,49 @@ function generateSeed () {
 
 // Converts a message code to a human-readable message
 function convertCodeToMessage ($code) {
-       $msg = '';
+       $message = '';
        switch ($code) {
-               case getCode('LOGOUT_DONE')      : $msg = getMessage('LOGOUT_DONE'); break;
-               case getCode('LOGOUT_FAILED')    : $msg = "<span class=\"guest_failed\">{--LOGOUT_FAILED--}</span>"; break;
-               case getCode('DATA_INVALID')     : $msg = getMessage('MAIL_DATA_INVALID'); break;
-               case getCode('POSSIBLE_INVALID') : $msg = getMessage('MAIL_POSSIBLE_INVALID'); break;
-               case getCode('ACCOUNT_LOCKED')   : $msg = getMessage('MEMBER_ACCOUNT_LOCKED_UNC'); break;
-               case getCode('USER_404')         : $msg = getMessage('USER_NOT_FOUND'); break;
-               case getCode('STATS_404')        : $msg = getMessage('MAIL_STATS_404'); break;
-               case getCode('ALREADY_CONFIRMED'): $msg = getMessage('MAIL_ALREADY_CONFIRMED'); break;
+               case getCode('LOGOUT_DONE')      : $message = getMessage('LOGOUT_DONE'); break;
+               case getCode('LOGOUT_FAILED')    : $message = "<span class=\"guest_failed\">{--LOGOUT_FAILED--}</span>"; break;
+               case getCode('DATA_INVALID')     : $message = getMessage('MAIL_DATA_INVALID'); break;
+               case getCode('POSSIBLE_INVALID') : $message = getMessage('MAIL_POSSIBLE_INVALID'); break;
+               case getCode('ACCOUNT_LOCKED')   : $message = getMessage('MEMBER_ACCOUNT_LOCKED_UNC'); break;
+               case getCode('USER_404')         : $message = getMessage('USER_NOT_FOUND'); break;
+               case getCode('STATS_404')        : $message = getMessage('MAIL_STATS_404'); break;
+               case getCode('ALREADY_CONFIRMED'): $message = getMessage('MAIL_ALREADY_CONFIRMED'); break;
 
                case getCode('ERROR_MAILID'):
                        if (EXT_IS_ACTIVE($ext, true)) {
-                               $msg = getMessage('ERROR_CONFIRMING_MAIL');
+                               $message = getMessage('ERROR_CONFIRMING_MAIL');
                        } else {
-                               $msg = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'mailid');
+                               $message = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'mailid');
                        }
                        break;
 
                case getCode('EXTENSION_PROBLEM'):
                        if (REQUEST_ISSET_GET('ext')) {
-                               $msg = generateExtensionInactiveNotInstalledMessage(REQUEST_GET('ext'));
+                               $message = generateExtensionInactiveNotInstalledMessage(REQUEST_GET('ext'));
                        } else {
-                               $msg = getMessage('EXTENSION_PROBLEM_UNSET_EXT');
+                               $message = getMessage('EXTENSION_PROBLEM_UNSET_EXT');
                        }
                        break;
 
-               case getCode('COOKIES_DISABLED') : $msg = getMessage('LOGIN_NO_COOKIES'); break;
-               case getCode('BEG_SAME_AS_OWN')  : $msg = getMessage('BEG_SAME_UID_AS_OWN'); break;
-               case getCode('LOGIN_FAILED')     : $msg = getMessage('LOGIN_FAILED_GENERAL'); break;
-               case getCode('MODULE_MEM_ONLY')  : $msg = sprintf(getMessage('MODULE_MEM_ONLY'), REQUEST_GET('mod')); break;
+               case getCode('COOKIES_DISABLED') : $message = getMessage('LOGIN_NO_COOKIES'); break;
+               case getCode('BEG_SAME_AS_OWN')  : $message = getMessage('BEG_SAME_UID_AS_OWN'); break;
+               case getCode('LOGIN_FAILED')     : $message = getMessage('LOGIN_FAILED_GENERAL'); break;
+               case getCode('MODULE_MEM_ONLY')  : $message = sprintf(getMessage('MODULE_MEM_ONLY'), REQUEST_GET('mod')); break;
 
                default:
                        // Missing/invalid code
-                       $msg = sprintf(getMessage('UNKNOWN_MAILID_CODE'), $code);
+                       $message = sprintf(getMessage('UNKNOWN_MAILID_CODE'), $code);
 
                        // Log it
-                       DEBUG_LOG(__FUNCTION__, __LINE__, $msg);
+                       DEBUG_LOG(__FUNCTION__, __LINE__, $message);
                        break;
        } // END - switch
 
        // Return the message
-       return $msg;
+       return $message;
 }
 
 // Generate a "link" for the given admin id (aid)
@@ -2694,7 +2694,7 @@ function generateAdminLink ($aid) {
                        // Is the extension there?
                        if (EXT_IS_ACTIVE('admins')) {
                                // Admin found
-                               $admin = "<a href=\"".adminsCreateEmailLink(getAdminEmail($aid))."\">".$login."</a>";
+                               $admin = "<a href=\"".adminsCreateEmailLink(getAdminEmail($aid))."\">" . $login."</a>";
                        } else {
                                // Extension not found
                                $admin = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins');
@@ -2712,19 +2712,19 @@ function generateAdminLink ($aid) {
 // Compile characters which are allowed in URLs
 function compileUriCode ($code, $simple=true) {
        // Compile constants
-       if (!$simple) $code = str_replace("{--", '".', str_replace("--}", '."', $code));
+       if (!$simple) $code = str_replace('{--', '".', str_replace('--}', '."', $code));
 
        // Compile QUOT and other non-HTML codes
        $code = str_replace('{DOT}', '.',
-       str_replace('{SLASH}', '/',
-       str_replace('{QUOT}', "'",
-       str_replace('{DOLLAR}', '$',
-       str_replace('{OPEN_ANCHOR}', '(',
-       str_replace('{CLOSE_ANCHOR}', ')',
-       str_replace('{OPEN_SQR}', '[',
-       str_replace('{CLOSE_SQR}', ']',
-       str_replace('{PER}', '%',
-       $code
+               str_replace('{SLASH}', '/',
+               str_replace('{QUOT}', "'",
+               str_replace('{DOLLAR}', '$',
+               str_replace('{OPEN_ANCHOR}', '(',
+               str_replace('{CLOSE_ANCHOR}', ')',
+               str_replace('{OPEN_SQR}', '[',
+               str_replace('{CLOSE_SQR}', ']',
+               str_replace('{PER}', '%',
+               $code
        )))))))));
 
        // Return compiled code
@@ -2734,7 +2734,7 @@ function compileUriCode ($code, $simple=true) {
 // Function taken from user comments on www.php.net / function eregi()
 function isUrlValidSimple ($url) {
        // Prepare URL
-       $url = strip_tags(str_replace("\\", '', compileUriCode(urldecode($url))));
+       $url = strip_tags(str_replace("\\", '', COMPILE_CODE(urldecode($url))));
 
        // Allows http and https
        $http      = "(http|https)+(:\/\/)";
@@ -2751,44 +2751,42 @@ function isUrlValidSimple ($url) {
        // ... and the string after and including question character
        $getstring1 = "([\?/]([[:alnum:]][-\._%[:alnum:]]*(=)?([-\@\._:%[:alnum:]])+)(&([[:alnum:]]([-_%[:alnum:]])*(=)?([-\@\[\._:%[:alnum:]])+(\])*))*)?";
        // Pattern for URLs like http://url/dir/doc.html?var=value
-       $pattern['d1dpg1']  = $http.$domain1.$dir.$page.$getstring1;
-       $pattern['d2dpg1']  = $http.$domain2.$dir.$page.$getstring1;
-       $pattern['ipdpg1']  = $http.$ip.$dir.$page.$getstring1;
+       $pattern['d1dpg1']  = $http . $domain1 . $dir . $page . $getstring1;
+       $pattern['d2dpg1']  = $http . $domain2 . $dir . $page . $getstring1;
+       $pattern['ipdpg1']  = $http . $ip . $dir . $page . $getstring1;
        // Pattern for URLs like http://url/dir/?var=value
-       $pattern['d1dg1']  = $http.$domain1.$dir.'/'.$getstring1;
-       $pattern['d2dg1']  = $http.$domain2.$dir.'/'.$getstring1;
-       $pattern['ipdg1']  = $http.$ip.$dir.'/'.$getstring1;
+       $pattern['d1dg1']  = $http . $domain1 . $dir.'/' . $getstring1;
+       $pattern['d2dg1']  = $http . $domain2 . $dir.'/' . $getstring1;
+       $pattern['ipdg1']  = $http . $ip . $dir.'/' . $getstring1;
        // Pattern for URLs like http://url/dir/page.ext
-       $pattern['d1dp']  = $http.$domain1.$dir.$page;
-       $pattern['d1dp']  = $http.$domain2.$dir.$page;
-       $pattern['ipdp']  = $http.$ip.$dir.$page;
+       $pattern['d1dp']  = $http . $domain1 . $dir . $page;
+       $pattern['d1dp']  = $http . $domain2 . $dir . $page;
+       $pattern['ipdp']  = $http . $ip . $dir . $page;
        // Pattern for URLs like http://url/dir
-       $pattern['d1d']  = $http.$domain1.$dir;
-       $pattern['d2d']  = $http.$domain2.$dir;
-       $pattern['ipd']  = $http.$ip.$dir;
+       $pattern['d1d']  = $http . $domain1 . $dir;
+       $pattern['d2d']  = $http . $domain2 . $dir;
+       $pattern['ipd']  = $http . $ip . $dir;
        // Pattern for URLs like http://url/?var=value
-       $pattern['d1g1']  = $http.$domain1.'/'.$getstring1;
-       $pattern['d2g1']  = $http.$domain2.'/'.$getstring1;
-       $pattern['ipg1']  = $http.$ip.'/'.$getstring1;
+       $pattern['d1g1']  = $http . $domain1 . '/' . $getstring1;
+       $pattern['d2g1']  = $http . $domain2 . '/' . $getstring1;
+       $pattern['ipg1']  = $http . $ip . '/' . $getstring1;
        // Pattern for URLs like http://url?var=value
-       $pattern['d1g12']  = $http.$domain1.$getstring1;
-       $pattern['d2g12']  = $http.$domain2.$getstring1;
-       $pattern['ipg12']  = $http.$ip.$getstring1;
+       $pattern['d1g12']  = $http . $domain1 . $getstring1;
+       $pattern['d2g12']  = $http . $domain2 . $getstring1;
+       $pattern['ipg12']  = $http . $ip . $getstring1;
        // Test all patterns
        $reg = false;
-       foreach ($pattern as $key=>$pat) {
+       foreach ($pattern as $key => $pat) {
                // Debug regex?
-               if (defined('DEBUG_REGEX')) {
-                       $pat = str_replace("[:alnum:]", "0-9a-zA-Z", $pat);
-                       $pat = str_replace("[:alpha:]", "a-zA-Z", $pat);
-                       $pat = str_replace("[:digit:]", "0-9", $pat);
-                       $pat = str_replace('.', "\.", $pat);
-                       $pat = str_replace("@", "\@", $pat);
-                       echo $key."=&nbsp;".$pat."<br />";
-               }
+               if (isDebugRegExpressionEnabled()) {
+                       // @TODO Are these convertions still required?
+                       $pat = str_replace('.', "&#92;&#46;", $pat);
+                       $pat = str_replace('@', "&#92;&#64;", $pat);
+                       echo $key."=&nbsp;" . $pat . "<br />";
+               } // END - if
 
                // Check if expression matches
-               $reg = ($reg || preg_match(("^".$pat."^"), $url));
+               $reg = ($reg || preg_match(('^' . $pat.'^'), $url));
 
                // Does it match?
                if ($reg === true) break;
@@ -2876,8 +2874,8 @@ function sendAdminNotification ($subject, $templateName, $content=array(), $uid
                SEND_ADMIN_EMAILS_PRO($subject, $templateName, $content, $uid);
        } else {
                // Send out out-dated way
-               $msg = LOAD_EMAIL_TEMPLATE($templateName, $content, $uid);
-               SEND_ADMIN_EMAILS($subject, $msg);
+               $message = LOAD_EMAIL_TEMPLATE($templateName, $content, $uid);
+               SEND_ADMIN_EMAILS($subject, $message);
        }
 }
 
@@ -2890,7 +2888,7 @@ function DEBUG_LOG ($funcFile, $line, $message, $force=true) {
 
                // Log this message away
                $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!");
-               fwrite($fp, date("d.m.Y|H:i:s", time())."|".$GLOBALS['module']."|".basename($funcFile)."|".$line."|".strip_tags($message)."\n");
+               fwrite($fp, date("d.m.Y|H:i:s", time())."|" . $GLOBALS['module']."|".basename($funcFile)."|" . $line."|".strip_tags($message)."\n");
                fclose($fp);
        } // END - if
 }
@@ -2992,7 +2990,7 @@ function convertSelectionsToTimestamp (&$POST, &$DATA, &$id, &$skip) {
 
                        // Remove data from array
                        foreach (array('ye', 'mo', 'we', 'da', 'ho', 'mi', 'se') as $rem) {
-                               unset($POST[$test.'_'.$rem]);
+                               unset($POST[$test.'_' . $rem]);
                        } // END - foreach
 
                        // Skip adding
@@ -3036,14 +3034,14 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
        $OUT = '';
 
        // Is the session data set?
-       if ((isSessionVariableSet('mxchange_'.$accessLevel.'_failures')) && (isSessionVariableSet('mxchange_'.$accessLevel.'_last_fail'))) {
+       if ((isSessionVariableSet('mxchange_' . $accessLevel.'_failures')) && (isSessionVariableSet('mxchange_' . $accessLevel.'_last_fail'))) {
                // Ignore zero values
-               if (getSession('mxchange_'.$accessLevel.'_failures') > 0) {
+               if (getSession('mxchange_' . $accessLevel.'_failures') > 0) {
                        // Non-guest has login failures found, get both data and prepare it for template
                        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
                        $content = array(
-                               'login_failures' => getSession('mxchange_'.$accessLevel.'_failures'),
-                               'last_failure'   => generateDateTime(getSession('mxchange_'.$accessLevel.'_last_fail'), '2')
+                               'login_failures' => getSession('mxchange_' . $accessLevel.'_failures'),
+                               'last_failure'   => generateDateTime(getSession('mxchange_' . $accessLevel.'_last_fail'), '2')
                        );
 
                        // Load template
@@ -3051,8 +3049,8 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
                } // END - if
 
                // Reset session data
-               setSession('mxchange_'.$accessLevel.'_failures', '');
-               setSession('mxchange_'.$accessLevel.'_last_fail', '');
+               setSession('mxchange_' . $accessLevel.'_failures', '');
+               setSession('mxchange_' . $accessLevel.'_last_fail', '');
        } // END - if
 
        // Return rendered content
@@ -3168,18 +3166,18 @@ function addNewBonusMail ($data, $mode = '', $output=true) {
 // Determines referal id and sets it
 function DETERMINE_REFID () {
        // Check if refid is set
-       if ((!empty($_GET['user'])) && (basename($_SERVER['PHP_SELF']) == "click.php")) {
+       if ((REQUEST_ISSET_GET('user')) && (basename($_SERVER['PHP_SELF']) == 'click.php')) {
                // The variable user comes from the click-counter script click.php and we only accept this here
-               $GLOBALS['refid'] = bigintval($_GET['user']);
-       } elseif (!empty($_POST['refid'])) {
+               $GLOBALS['refid'] = bigintval(REQUEST_GET('user'));
+       } elseif (REQUEST_ISSET_POST('refid')) {
                // Get referal id from variable refid (so I hope this makes my script more compatible to other scripts)
-               $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_POST['refid']));
-       } elseif (!empty($_GET['refid'])) {
+               $GLOBALS['refid'] = strip_tags(REQUEST_POST('refid'));
+       } elseif (REQUEST_ISSET_GET('refid')) {
                // Get referal id from variable refid (so I hope this makes my script more compatible to other scripts)
-               $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['refid']));
-       } elseif (!empty($_GET['ref'])) {
+               $GLOBALS['refid'] = strip_tags(REQUEST_GET('refid'));
+       } elseif (REQUEST_ISSET_GET('ref')) {
                // Set refid=ref (the referal link uses such variable)
-               $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref']));
+               $GLOBALS['refid'] = strip_tags(REQUEST_GET('ref'));
        } elseif ((isSessionVariableSet('refid')) && (getSession('refid') != 0)) {
                // Set session refid als global
                $GLOBALS['refid'] = bigintval(getSession('refid'));
@@ -3266,10 +3264,10 @@ function handleCodeMessage () {
                if (REQUEST_ISSET_GET('ext')) $ext = REQUEST_GET('ext');
 
                // Convert the 'msg' parameter from URL to a human-readable message
-               $msg = convertCodeToMessage(REQUEST_GET('msg'));
+               $message = convertCodeToMessage(REQUEST_GET('msg'));
 
                // Load message template
-               LOAD_TEMPLATE('message', false, $msg);
+               LOAD_TEMPLATE('message', false, $message);
        } // END - if
 }
 
@@ -3304,16 +3302,16 @@ function generateExtensionInactiveMessage ($ext_name) {
        } // END - if
 
        // Default message
-       $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), $ext_name);
+       $message = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), $ext_name);
 
        // Is an admin logged in?
        if (IS_ADMIN()) {
                // Then output admin message
-               $msg = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE'), $ext_name);
+               $message = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE'), $ext_name);
        } // END - if
 
        // Return prepared message
-       return $msg;
+       return $message;
 }
 
 // Generates a 'extension foo not installed' message
@@ -3325,16 +3323,16 @@ function generateExtensionNotInstalledMessage ($ext_name) {
        } // END - if
 
        // Default message
-       $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), $ext_name);
+       $message = sprintf(getMessage('EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), $ext_name);
 
        // Is an admin logged in?
        if (IS_ADMIN()) {
                // Then output admin message
-               $msg = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), $ext_name);
+               $message = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), $ext_name);
        } // END - if
 
        // Return prepared message
-       return $msg;
+       return $message;
 }
 
 // Generates a message depending on if the extension is not installed or not
index 9d68191e9ef1de86caa3a3931a935162339fd058..55cb320c4462674125d62d148035004df3fb5e3b 100644 (file)
@@ -315,33 +315,33 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                        copyFileVerified(REQUEST_POST('spath') . 'inc/config-local.php.dist', REQUEST_POST('spath') . 'inc/cache/config-local.php', 0644);
 
                                                        // Ok, all done. So we can write the config data to the php files
-                                                       if (REQUEST_POST('spath') != constant('PATH')) changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SERVER-PATH", "define('PATH', \"", "\");", REQUEST_POST('spath'), 0);
-                                                       if (REQUEST_POST('burl')  != constant('URL'))  changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "HOST-URL", "define('URL', \"", "\");", REQUEST_POST('burl'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MAIN-TITLE", "define('MAIN_TITLE', \"", "\");", REQUEST_POST('title'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SLOGAN", "define('SLOGAN', \"", "\");", REQUEST_POST('slogan'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "WEBMASTER", "define('WEBMASTER', \"", "\");", REQUEST_POST('email'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "NULLPASS-WARNING", "setConfigEntry('WARN_NO_PASS', \"", "\");", REQUEST_POST('warn_no_pass'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "WRITE-FOOTER", "setConfigEntry('WRITE_FOOTER', \"", "\");", REQUEST_POST('wfooter'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "BACKLINK", "setConfigEntry('ENABLE_BACKLINK', \"", "\");", REQUEST_POST('blink'), 0);
-                                                       // DEACTIVATED: changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", REQUEST_POST('omode'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-HOST", "  'host'     => \"", "\",", $mysql['host'], 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-DBASE", " 'dbase'    => \"", "\",", $mysql['dbase'], 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-LOGIN", " 'login'    => \"", "\",", $mysql['login'], 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-PASSWORD", "      'password' => \"", "\",", $mysql['pass1'], 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-PREFIX", "setConfigEntry('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "TABLE-TYPE", "setConfigEntry('_TABLE_TYPE', \"", "\");", $mysql['type'], 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-HOSTNAME", "setConfigEntry('SMTP_HOSTNAME', \"", "\");", REQUEST_POST('smtp_host'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-USER", "setConfigEntry('SMTP_USER', \"", "\");", REQUEST_POST('smtp_user'), 0);
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-PASSWORD", "setConfigEntry('SMTP_PASSWORD', \"", "\");", REQUEST_POST('smtp_pass1'), 0);
+                                                       if (REQUEST_POST('spath') != constant('PATH')) changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'SERVER-PATH', "define('PATH', '", "');", REQUEST_POST('spath'), 0);
+                                                       if (REQUEST_POST('burl')  != constant('URL'))  changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'HOST-URL', "define('URL', '", "');", REQUEST_POST('burl'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'MAIN-TITLE', "define('MAIN_TITLE', '", "');", REQUEST_POST('title'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'SLOGAN', "define('SLOGAN', '", "');", REQUEST_POST('slogan'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'WEBMASTER', "define('WEBMASTER', '", "');", REQUEST_POST('email'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'NULLPASS-WARNING', "setConfigEntry('WARN_NO_PASS', '", "');", REQUEST_POST('warn_no_pass'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'WRITE-FOOTER', "setConfigEntry('WRITE_FOOTER', '", "');", REQUEST_POST('wfooter'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'BACKLINK', "setConfigEntry('ENABLE_BACKLINK', '", "');", REQUEST_POST('blink'), 0);
+                                                       // DEACTIVATED: changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'OUTPUT-MODE', "define('OUTPUT_MODE', '", "');", REQUEST_POST('omode'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'MYSQL-HOST', "  'host'     => '", "',", $mysql['host'], 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'MYSQL-DBASE', " 'dbase'    => '", "',", $mysql['dbase'], 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'MYSQL-LOGIN', " 'login'    => '", "',", $mysql['login'], 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'MYSQL-PASSWORD', "      'password' => '", "',", $mysql['pass1'], 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'MYSQL-PREFIX', "setConfigEntry('_MYSQL_PREFIX', '", "');", $mysql['prefix'], 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'TABLE-TYPE', "setConfigEntry('_TABLE_TYPE', '", "');", $mysql['type'], 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'SMTP-HOSTNAME', "setConfigEntry('SMTP_HOSTNAME', '", "');", REQUEST_POST('smtp_host'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'SMTP-USER', "setConfigEntry('SMTP_USER', '", "');", REQUEST_POST('smtp_user'), 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'SMTP-PASSWORD', "setConfigEntry('SMTP_PASSWORD', '", "');", REQUEST_POST('smtp_pass1'), 0);
 
                                                        // Generate a long site key
                                                        $siteKey = generatePassword(50);
 
                                                        // And write it
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SITE-KEY", "setConfigEntry('SITE_KEY', \"", "\");", $siteKey, 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'SITE-KEY', "setConfigEntry('SITE_KEY', '", "');", $siteKey, 0);
 
                                                        // Script is now installed
-                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "INSTALLED", "setConfigEntry('MXCHANGE_INSTALLED', \"", "\");", 'Y', 0);
+                                                       changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', 'INSTALLED', "setConfigEntry('MXCHANGE_INSTALLED', '", "');", 'Y', 0);
                                                } // END - if
                                        } // END - if
                                } // END - if
index edd70710bf42201e6cc37338af9129dab5ce3d05..531741c3e2ba9e664026a9074832c30fb069b45e 100644 (file)
@@ -80,7 +80,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                                                        // Is a sponsor alread in the db?
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                // Yes, he is!
-                                                               if (($GLOBALS['what'] == "add_sponsor") || ($NO_UPDATE)) {
+                                                               if (($GLOBALS['what'] == 'add_sponsor') || ($NO_UPDATE)) {
                                                                        // Already found!
                                                                        $ALREADY = true;
                                                                } else {
@@ -94,15 +94,15 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                                                }
                                                break;
 
-                                       case "pass1":
+                                       case 'pass1':
                                                $k = ''; $v = '';
                                                break;
 
-                                       case "pass2":
-                                               $k = "password"; $v = md5($v);
+                                       case 'pass2':
+                                               $k = 'password'; $v = md5($v);
                                                break;
 
-                                       case "url":
+                                       case 'url':
                                                if (!isUrlValid($v)) $SAVE = false;
                                                break;
 
index 392978204e99cc39004bd018f2612d89b9a9240f..bbf56465680a37f68c9e57b727d58a3b0472e1a2 100644 (file)
@@ -51,21 +51,27 @@ function SURFBAR_ADMIN_ADD_URL ($url, $limit, $reload) {
        // Do some pre-checks
        if (!IS_ADMIN()) {
                // Not an admin
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Not admin.", $url, $limit, $reload));
                return false;
        } elseif (!isUrlValid($url)) {
                // URL invalid
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Invalid URL.", $url, $limit, $reload));
                return false;
        } elseif (SURFBAR_LOOKUP_BY_URL($url, '0')) {
                // URL already found in surfbar!
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Already added.", $url, $limit, $reload));
                return false;
        } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
                // No more allowed!
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : No more URLs allowed.", $url, $limit, $reload));
                return false;
-       } elseif (''.($limit + 0).'' != ''.$limit.'') {
-               // Invalid amount entered
+       } elseif ('' . ($limit + 0) . '' != '' . $limit . '') {
+               // Invalid limit entered
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Invalid limit entered.", $url, $limit, $reload));
                return false;
-       } elseif (''.($reload + 0).'' != ''.$reload.'') {
+       } elseif ('' . ($reload + 0) . '' != '' . $reload . '') {
                // Invalid amount entered
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Invalid reload entered.", $url, $limit, $reload));
                return false;
        }
 
@@ -159,7 +165,7 @@ function SURFBAR_MEMBER_ADD_URL ($url, $limit) {
        if (!IS_MEMBER()) {
                // Not a member
                return false;
-       } elseif (!isUrlValid($url)) {
+       } elseif ((!isUrlValid($url)) && (!IS_ADMIN())) {
                // URL invalid
                return false;
        } elseif (SURFBAR_LOOKUP_BY_URL($url, getUserId())) {
index a861f8c0b7524ab3b3ef62c31778a97a3bc46cef..27ec67fe21b9e88cb28609e43539ab0c542c0da3 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 function alpha ($sortby, $colspan, $return=false) {
        if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', 0);
        $add = "&amp;page=".REQUEST_GET('page')."&amp;offset=".REQUEST_GET('offset');
-       if (REQUEST_ISSET_GET(('mode'))) $add .= "&amp;mode=".REQUEST_GET(('mode'));
+       if (REQUEST_ISSET_GET('mode')) $add .= "&amp;mode=".REQUEST_GET('mode');
 
        /* Creates the list of letters and makes them a link. */
        $alphabet = explode(',', getMessage('_ALL2') . 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z' . getMessage('_OTHERS'));
@@ -59,7 +59,7 @@ function alpha ($sortby, $colspan, $return=false) {
                } else {
                        // Output link to letter
                        $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$GLOBALS['what'];
-                       if (REQUEST_ISSET_GET(('mode'))) $OUT .= "&amp;mode=".REQUEST_GET(('mode'));
+                       if (REQUEST_ISSET_GET('mode')) $OUT .= "&amp;mode=".REQUEST_GET('mode');
                        $OUT .= "&amp;letter=".$ltr."&amp;sortby=".$sortby.$add."\">".$ltr."</a>";
                }
 
@@ -94,7 +94,7 @@ function SortLinks ($letter, $sortby, $colspan, $return=false) {
 
        // Add status or mode
        if (REQUEST_ISSET_GET(('status'))) $add .= "&amp;mode=".REQUEST_GET(('status'));
-       elseif (REQUEST_ISSET_GET(('mode'))) $add .= "&amp;mode=".REQUEST_GET(('mode'));
+       elseif (REQUEST_ISSET_GET('mode')) $add .= "&amp;mode=".REQUEST_GET('mode');
 
        // Makes order by links..
        if ($letter == "front") $letter = getMessage('_ALL2');
@@ -156,18 +156,18 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
                if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
                        $OUT .= "<strong>-";
                } else {
-                       if (!REQUEST_ISSET_GET(('letter'))) REQUEST_SET_GET('letter', getMessage('_ALL2'));
-                       if (!REQUEST_ISSET_GET(('sortby'))) REQUEST_SET_GET('sortby', 'userid');
+                       if (!REQUEST_ISSET_GET('letter')) REQUEST_SET_GET('letter', getMessage('_ALL2'));
+                       if (!REQUEST_ISSET_GET('sortby')) REQUEST_SET_GET('sortby', 'userid');
 
                        // Base link
                        $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$GLOBALS['what'];
 
                        // Add status or mode
                        if (REQUEST_ISSET_GET(('status'))) $OUT .= "&amp;mode=".REQUEST_GET(('status'));
-                       elseif (REQUEST_ISSET_GET(('mode'))) $OUT .= "&amp;mode=".REQUEST_GET(('mode'));
+                       elseif (REQUEST_ISSET_GET('mode')) $OUT .= "&amp;mode=".REQUEST_GET('mode');
 
                        // Letter and so on
-                       $OUT .= "&amp;letter=".REQUEST_GET(('letter'))."&amp;sortby=".REQUEST_GET(('sortby'))."&amp;page=".$page."&amp;offset=".$offset."\">";
+                       $OUT .= "&amp;letter=".REQUEST_GET('letter')."&amp;sortby=".REQUEST_GET('sortby')."&amp;page=".$page."&amp;offset=".$offset."\">";
                }
 
                $OUT .= $page;
index 121dc2871b14db00f4eb30b48e88827273ba7bc5..56302d59e66111f31ec5a272116ca2c2fa10f152 100644 (file)
@@ -327,7 +327,7 @@ function WERNIS_TRANSFER_STATUS ($status) {
 function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '', $status = '') {
        // Register this wernis movement
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type`,`wernis_api_message`,`wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
-       array(getUserId(), bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__);
+               array(getUserId(), bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__);
 }
 
 // Take fees and factor
index 5694614ce01d06362ed414c6c318530147495813..4675398ce0491babca50a2e7ab2d7c3a3c513fcc 100644 (file)
@@ -353,15 +353,15 @@ LIMIT 1",
 
                                                        case 'NL_UNSUBSCRIBE': // Newsletter unsubscriptions
                                                                $result = SQL_QUERY_ESC("SELECT nl_timespan FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-                                                               array(bigintval($uid)), __FILE__, __LINE__);
+                                                                       array(bigintval($uid)), __FILE__, __LINE__);
                                                                list($span) = SQL_FETCHROW($result);
                                                                SQL_FREERESULT($result);
 
                                                                if ($span > 0) {
                                                                        // Undone unscubscribe request
                                                                        $content = array(
-                                                       'uid' => $uid,
-                                                       'id'  => $tid
+                                                                               'uid' => $uid,
+                                                                               'id'  => $tid
                                                                        );
                                                                        $OUT .= LOAD_TEMPLATE('admin_newsletter_tsk', true, $content);
                                                                } else {
@@ -422,8 +422,8 @@ LIMIT 1",
                        $content['assigned_admin'] = generateAdminLink($content['assigned_admin']);
 
                        // Generate infos
-                       switch ($content['task_type'])
-                       {
+                       // @TODO Try to move this in includes
+                       switch ($content['task_type']) {
                                case 'EXTENSION':
                                case 'EXTENSION_UPDATE':
                                        $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ':') - 1);
index 521ebfcdae2322d714cacd3fc7d797798e20c92b..e0cd01575d8921c9ef1bf1835801e54f7b942507 100644 (file)
@@ -46,15 +46,19 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 // Was an URL added?
-if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST('url'))) {
-       // Dummy variables
-       $DATA = array(); $id = "reload_ye"; $skip = false;
+if ((REQUEST_ISSET_POST('add')) && (REQUEST_ISSET_POST('url'))) {
+       // Initialize variables
+       $DATA = array();
+       $id = 'reload_ye';
+       $skip = false;
+       $POST = REQUEST_POST_ARRAY();
 
        // Convert the "reload selections"
-       convertSelectionsToTimestamp(REQUEST_POST_ARRAY(), $DATA, $id, $skip);
+       // @TODO Find all convertSelectionsToTimestamp() calls and rewrite REQUEST_POST() calls to $POST
+       convertSelectionsToTimestamp($POST, $DATA, $id, $skip);
 
        // Then add this URL
-       if (SURFBAR_ADMIN_ADD_URL(REQUEST_POST('url'), REQUEST_POST('limit'), REQUEST_POST('reload'))) {
+       if (SURFBAR_ADMIN_ADD_URL($POST['url'], $POST['limit'], $POST['reload'])) {
                // URL was added
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_URL_ADDED'));
        } else {
@@ -65,11 +69,11 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST('url'))) {
 
 // Prepare content for template
 $content = array(
-       'reload' => createTimeSelections(0, "reload", "WDhms")
+       'reload' => createTimeSelections(0, 'reload', 'WDhms')
 );
 
 // Load template
-LOAD_TEMPLATE("admin_add_surfbar_url", false, $content);
+LOAD_TEMPLATE('admin_add_surfbar_url', false, $content);
 
 //
 ?>
index 2e04c48598732b0ae2c98565970c885548a9f93e..d9fd08a64d190bc4582b96f07f8e153a11ffa789 100644 (file)
@@ -70,7 +70,7 @@ if ($FORM === true) {
        if (!REQUEST_ISSET_POST('email')) REQUEST_SET_POST('email', '');
 
        // Load form from template
-       LOAD_TEMPLATE("admin_admins_add");
+       LOAD_TEMPLATE('admin_admins_add', REQUEST_POST_ARRAY());
 } // END - if
 
 //
index 19fe918eed2d8b5b6a1037e9e342c4f889755a17..14cb4574196860cddf7094554aaa93c5df52134f 100644 (file)
@@ -54,7 +54,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
        foreach (REQUEST_POST('sel') as $id => $selected) {
                // Load data for the ID
                $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE `id`=%s LIMIT 1",
-               array(bigintval($id)), __FILE__, __LINE__);
+                       array(bigintval($id)), __FILE__, __LINE__);
                list($aid, $act, $wht, $mode) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
 
@@ -62,25 +62,28 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                $content = array(
                        'sw'               => $SW,
                        'id'               => $id,
-                       'admins_selection' => generateOptionList('admins', 'id', "login", $aid, "default_acl"),
-                       'action_selection' => ADMIN_MENU_SELECTION("action", $act, $id),
-                       'what_selection'   => ADMIN_MENU_SELECTION("what", $wht, $id),
+                       'admins_selection' => generateOptionList('admins', 'id', 'login', $aid, 'default_acl'),
+                       'action_selection' => ADMIN_MENU_SELECTION('action', $act, $id),
+                       'what_selection'   => ADMIN_MENU_SELECTION('what', $wht, $id),
                        'mode_options'     => generateOptionList(
                                '/ARRAY/',
-               array("allow", "deny"),
-               array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')),
-               $mode
-               ),
+                               array('allow', 'deny'),
+                               array(
+                                       constant('ADMINS_ALLOW_MODE'),
+                                       constant('ADMINS_DENY_MODE')
+                               ),
+                               $mode
+                       ),
                );
 
                // Load row template
-               $OUT .= LOAD_TEMPLATE("admin_config_admins_edit_row", true, $content);
+               $OUT .= LOAD_TEMPLATE('admin_config_admins_edit_row', true, $content);
                $SW = 3 - $SW;
        }
        define('__ACL_ROWS', $OUT);
 
        // Load main template
-       LOAD_TEMPLATE("admin_config_admins_edit");
+       LOAD_TEMPLATE('admin_config_admins_edit');
 } elseif ((REQUEST_ISSET_POST('change')) && ($SEL > 0)) {
        // Change entries
        foreach (REQUEST_POST('sel') as $id => $selected) {
@@ -90,21 +93,21 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                // Update entries
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_acls` SET admin_id=%s, action_menu='%s', what_menu='%s', access_mode='%s' WHERE `id`=%s LIMIT 1",
                array(
-               REQUEST_POST('admin', $id),
-               REQUEST_POST('action_menu', $id),
-               REQUEST_POST('what_menu', $id),
-               REQUEST_POST('mode', $id),
-               $id
+                       REQUEST_POST('admin', $id),
+                       REQUEST_POST('action_menu', $id),
+                       REQUEST_POST('what_menu', $id),
+                       REQUEST_POST('mode', $id),
+                       $id
                ),__FILE__, __LINE__);
-       }
+       } // END - foreach
 
        // Update cache when installed
        if (EXT_IS_ACTIVE('cache')) {
-               if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) $GLOBALS['cache_instance']->destroyCacheFile();
 
                // Purge menu cache
                cachePurgeAdminMenu(REQUEST_POST('admin', $id));
-       }
+       } // END - if
 
        // Entries changed
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_CHANGED'));
@@ -114,7 +117,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
        foreach (REQUEST_POST('sel') as $id => $selected) {
                // Load data for the ID
                $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE `id`=%s LIMIT 1",
-               array(bigintval($id)), __FILE__, __LINE__);
+                       array(bigintval($id)), __FILE__, __LINE__);
                list($admin, $act, $wht, $mode) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
 
@@ -139,27 +142,28 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                );
 
                // Load row template and switch colors
-               $OUT .= LOAD_TEMPLATE("admin_config_admins_del_row", true, $content);
+               $OUT .= LOAD_TEMPLATE('admin_config_admins_del_row', true, $content);
                $SW = 3 - $SW;
-       }
+       } // END - foreach
        define('__ACL_ROWS', $OUT);
 
        // Load main template
-       LOAD_TEMPLATE("admin_config_admins_del");
+       LOAD_TEMPLATE('admin_config_admins_del');
 } elseif ((REQUEST_ISSET_POST('remove')) && ($SEL > 0)) {
        // Remove entries
+       // @TODO Rewrite this to filter 'run_sqls'
        foreach (REQUEST_POST('sel') as $id => $selected) {
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE `id`=%s LIMIT 1",
-               array(bigintval($id)),__FILE__, __LINE__);
-       }
+                       array(bigintval($id)),__FILE__, __LINE__);
+       } // END - foreach
 
        // Update cache when installed
        if (EXT_IS_ACTIVE('cache')) {
-               if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) $GLOBALS['cache_instance']->destroyCacheFile();
 
                // @TODO This causes the whole (!) menu cache being rebuild
                cachePurgeAdminMenu();
-       }
+       } // END - if
 
        // Entries deleted
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_DELETED'));
@@ -169,33 +173,33 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
 
        // Default ACL is false
        $ACL = false;
-       if (REQUEST_ISSET_POST(('what_menu'))) {
+       if (REQUEST_ISSET_POST('what_menu')) {
                // Check parent ACL
                $ACL = adminsCheckAdminAcl(getModeAction('admin', REQUEST_POST('what_menu')), '');
-       }
+       } // END - if
 
-       if ($mode != REQUEST_POST('mode') || ($ACL)) {
+       if (($mode != REQUEST_POST('mode')) || ($ACL)) {
                // Mode is fine
-               $BOTH = ((REQUEST_ISSET_POST(('action_menu'))) && (REQUEST_ISSET_POST(('what_menu'))));
-               if (((REQUEST_ISSET_POST(('action_menu'))) || (REQUEST_ISSET_POST(('what_menu')))) && (!$BOTH)) {
+               $BOTH = ((REQUEST_ISSET_POST('action_menu')) && (REQUEST_ISSET_POST('what_menu')));
+               if (((REQUEST_ISSET_POST('action_menu')) || (REQUEST_ISSET_POST('what_menu'))) && (!$BOTH)) {
                        // Main or sub menu selected
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1",
-                       array(bigintval(REQUEST_POST('admin_id')), REQUEST_POST('action_menu'), REQUEST_POST('what_menu')), __FILE__, __LINE__);
+                               array(bigintval(REQUEST_POST('admin_id')), REQUEST_POST('action_menu'), REQUEST_POST('what_menu')), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 0) {
                                // Finally add the new ACL
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins_acls` (admin_id, action_menu, what_menu, access_mode)
 VALUES ('%s','%s','%s','%s')",
                                array(
-                               bigintval(REQUEST_POST('admin_id')),
-                               REQUEST_POST('action_menu'),
-                               REQUEST_POST('what_menu'),
-                               REQUEST_POST('mode')
+                                       bigintval(REQUEST_POST('admin_id')),
+                                       REQUEST_POST('action_menu'),
+                                       REQUEST_POST('what_menu'),
+                                       REQUEST_POST('mode')
                                ), __FILE__, __LINE__);
                                $content = getMessage('ADMIN_ADMINS_ACL_SAVED');
 
                                // Update cache when installed
                                if (EXT_IS_ACTIVE('cache')) {
-                                       if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
+                                       if ($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) $GLOBALS['cache_instance']->destroyCacheFile();
 
                                        // Purge cache
                                        cachePurgeAdminMenu(REQUEST_POST('admin_id'), REQUEST_POST('action_menu'), REQUEST_POST('what_menu'));
@@ -221,6 +225,8 @@ VALUES ('%s','%s','%s','%s')",
 } else {
        // List all ACLs
        $result_acls = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, id", __FILE__, __LINE__);
+
+       // Entries found?
        if (SQL_NUMROWS($result_acls) > 0) {
                // List ACLs
                $OUT = ''; $SW = 2;
@@ -243,35 +249,33 @@ VALUES ('%s','%s','%s','%s')",
                        );
 
                        // Load row template and switch colors
-                       $OUT .= LOAD_TEMPLATE("admin_config_admins_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE('admin_config_admins_row', true, $content);
                        $SW = 3 - $SW;
-               }
+               } // END - while
 
                // Free memory
                SQL_FREERESULT($result);
                define('__ACL_ROWS', $OUT);
 
                // Load main template
-               LOAD_TEMPLATE("admin_config_admins");
-       }
+               LOAD_TEMPLATE('admin_config_admins');
+       } // END - if
 
        // Prepare some constants for the template
-       define('_ADMINS_SELECTION', generateOptionList('admins', 'id', "login", '', "default_acl"));
-       define('_ACTION_SELECTION', ADMIN_MENU_SELECTION("action"));
-       define('_WHAT_SELECTION'  , ADMIN_MENU_SELECTION("what"));
-       define('_MODE_OPTIONS'    ,
-       generateOptionList(
-                       '/ARRAY/',
-       array("allow", "deny"),
-       array(
-       getMessage('ADMINS_ALLOW_MODE'),
-       getMessage('ADMINS_DENY_MODE')
-       )
-       )
-       );
+       define('_ADMINS_SELECTION', generateOptionList('admins', 'id', 'login', '', 'default_acl'));
+       define('_ACTION_SELECTION', ADMIN_MENU_SELECTION('action'));
+       define('_WHAT_SELECTION'  , ADMIN_MENU_SELECTION('what'));
+       define('_MODE_OPTIONS'    , generateOptionList(
+               '/ARRAY/',
+               array('allow', 'deny'),
+               array(
+                       getMessage('ADMINS_ALLOW_MODE'),
+                       getMessage('ADMINS_DENY_MODE')
+               )
+       ));
 
        // Load template for adding new ACL
-       LOAD_TEMPLATE("admin_admins_add_acl");
+       LOAD_TEMPLATE('admin_admins_add_acl');
 }
 
 //
index cc1f7295d9a81e90de0d45afcc64223e9028d50a..e0da7d40b17f736b5038072c60ba069d489e58f3 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
+if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET('mode'))) {
        // Check for selected sponsor
        $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
        array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
@@ -100,7 +100,7 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
                define('__INTERVAL'   , createTimeSelections($DATA['warning_interval'], "warning_interval", "MWDh"));
 
                // Init variables here
-               $TPL = sprintf("admin_edit_sponsor_%s", REQUEST_GET(('mode')));
+               $TPL = sprintf("admin_edit_sponsor_%s", REQUEST_GET('mode'));
                INIT_SQLS();
 
                // Sponsor was found
@@ -183,7 +183,7 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
 
                                default: // Unknown mode
                                        DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", REQUEST_GET('mode')));
-                                       $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), REQUEST_GET(('mode')));
+                                       $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), REQUEST_GET('mode'));
                                        break;
                        }
 
@@ -199,7 +199,7 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
                        LOAD_TEMPLATE($TPL);
                } else {
                        // Template not found!
-                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_MODUS_TPL_404'), REQUEST_GET(('mode'))));
+                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_MODUS_TPL_404'), REQUEST_GET('mode')));
                }
        } else {
                // Sponsor not found!
index 103d448c6cea7bf42c6c479ec25dd21f761902f6..f27255b6664fc0ef770931e31ea644ebbd6c03b9 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (!REQUEST_ISSET_GET(('mode'))) {
+if (!REQUEST_ISSET_GET('mode')) {
        // Chosse the overview page as default
        REQUEST_GET('mode', "overview");
 } else {
index a0143e28a06c820d230a694c4240fc994bb8c862..52d2998e15abc677b5e247ad7448b3a85e3cecc0 100644 (file)
@@ -54,9 +54,9 @@ $listHeader = getMessage('ADMIN_ALL_ACCOUNTS');
 if (REQUEST_ISSET_GET(('status'))) {
        // Set title according to the 'status'
        $listHeader = getMessage(sprintf("ADMIN_LIST_STATUS_%s_ACCOUNTS", strtoupper(REQUEST_GET(('status')))));
-} elseif (REQUEST_ISSET_GET(('mode'))) {
+} elseif (REQUEST_ISSET_GET('mode')) {
        // Set title according to the "mode"
-       $listHeader = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(REQUEST_GET(('mode')))));
+       $listHeader = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(REQUEST_GET('mode'))));
 }
 
 // Remember it
@@ -89,9 +89,9 @@ if (EXT_IS_ACTIVE('country')) {
        $MORE .= ", country";
 }
 
-// Init unset data (bad that we change $_GET here!)
-if (!REQUEST_ISSET_GET(('letter'))) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
-if (!REQUEST_ISSET_GET(('sortby'))) { REQUEST_SET_GET('sortby', 'userid');            }
+// Init unset data
+if (!REQUEST_ISSET_GET('letter')) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
+if (!REQUEST_ISSET_GET('sortby')) { REQUEST_SET_GET('sortby', 'userid');            }
 if (!REQUEST_ISSET_GET('page'))   { REQUEST_SET_GET('page'  , '1');                 }
 
 // Set base URL
@@ -112,9 +112,9 @@ LIMIT 1",
                $DATA  = SQL_FETCHARRAY($result_user);
 
                // Get count/sum of refs, selected categories, unconfirmed mails
-               $REFS  = GET_TOTAL_DATA($uid, "refsystem", "counter");
-               $CATS  = GET_TOTAL_DATA($uid, "user_cats", 'id', 'userid', true);
-               $LINKS = GET_TOTAL_DATA($uid, "user_links", 'id', 'userid', true);
+               $REFS  = GET_TOTAL_DATA($uid, 'refsystem', 'counter');
+               $CATS  = GET_TOTAL_DATA($uid, 'user_cats', 'id', 'userid', true);
+               $LINKS = GET_TOTAL_DATA($uid, 'user_links', 'id', 'userid', true);
 
                // Add links to the numbers
                if ($LINKS > 0) $LINKS = $base."&amp;what=list_links&amp;uid=".$uid."\">".$LINKS."</a>]";
@@ -192,7 +192,7 @@ LIMIT 1",
                }
 
                // Load user-details template
-               LOAD_TEMPLATE("admin_user_details", false, $uid);
+               LOAD_TEMPLATE('admin_user_details', false, $uid);
        } else {
                // Account does not exist!
                LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), $uid));
@@ -202,11 +202,11 @@ LIMIT 1",
        SQL_FREERESULT($result_user);
 } else {
        $whereStatement = '';
-       if ((REQUEST_GET('letter') != getMessage('_ALL2')) && (REQUEST_GET('letter') != getMessage('_OTHERS')) && (REQUEST_ISSET_GET(('letter')))) {
+       if ((REQUEST_GET('letter') != getMessage('_ALL2')) && (REQUEST_GET('letter') != getMessage('_OTHERS')) && (REQUEST_ISSET_GET('letter'))) {
                // List only persons w
-               $whereStatement = " WHERE family LIKE '".REQUEST_GET('letter')."%'";
+               $whereStatement = " WHERE family LIKE '".REQUEST_GET('letter') . "%'";
        } // END - if
-       if (REQUEST_GET('sortby') == "family_name") REQUEST_SET_GET('sortby', "family");
+       if (REQUEST_GET('sortby') == 'family_name') REQUEST_SET_GET('sortby', 'family');
 
        // Parse the status or mode parameter
        if (REQUEST_ISSET_GET(('status'))) {
@@ -218,7 +218,7 @@ LIMIT 1",
                        // Start a new one
                        $whereStatement = sprintf(" WHERE `status`='%s'", SQL_ESCAPE(strip_tags(strtoupper(REQUEST_GET('status')))));
                }
-       } elseif (REQUEST_ISSET_GET(('mode'))) {
+       } elseif (REQUEST_ISSET_GET('mode')) {
                // Choose what we need to list
                switch (REQUEST_GET('mode')) {
                        case "norefs": // Users w/o refs
@@ -232,13 +232,13 @@ LIMIT 1",
                                break;
 
                        default: // Invalid list mode
-                               DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid list mode %s detected.", REQUEST_GET(('mode'))));
+                               DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid list mode %s detected.", REQUEST_GET('mode')));
                                break;
                }
        } // END = if
 
        // Prepare SQL and run it
-       $sql = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".REQUEST_GET(('sortby'));
+       $sql = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".REQUEST_GET('sortby');
        $result_master = SQL_QUERY($sql, __FILE__, __LINE__);
 
        // Calculate page count (0.5 fixes a bug with page count)
index 21b8a84e9c6f8ec494b3d78494156783cd662ff5..cbeb3d53d4e3f1604af3895a5d8c672fa8089faa 100644 (file)
@@ -58,7 +58,7 @@ if (REQUEST_ISSET_POST('sel')) $SEL = countPostSelection();
 
 if (isFormSent()) {
        // Fix older calls from add-new-banner-form
-       if (!REQUEST_ISSET_GET(('mode'))) REQUEST_SET_GET('mode', 'add');
+       if (!REQUEST_ISSET_GET('mode')) REQUEST_SET_GET('mode', 'add');
        $sql = '';
        switch (REQUEST_GET('mode'))
        {
index 5e9794bf2d5c3c4385892daa9365669fe073de6c..120b6d63c37ccc93e5f08d9c4fb18fa047796018 100644 (file)
@@ -62,7 +62,7 @@ if (isFormSent()) {
        define('__OPTION_LINES', generateCategoryOptionsList(REQUEST_GET('mode')));
 
        // Store send mode
-       define('__MODE', REQUEST_GET(('mode')));
+       define('__MODE', REQUEST_GET('mode'));
 
        if (EXT_IS_ACTIVE('html_mail')) {
                // If HTML extension is active
index 2d2d5485d4b5a2489d254c6342b9a2b98f4cfd8b..efdeb0878256c2196456c5fb05e33ef97033bd46 100644 (file)
@@ -48,7 +48,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('guest', __FILE__);
 
 $mode = '';
-if (REQUEST_ISSET_GET(('mode'))) {
+if (REQUEST_ISSET_GET('mode')) {
        // A "special" mode of the login system was requested
        switch (REQUEST_GET('mode'))
        {
index 3c12d48d5c02f6c73a449d1fb71f46efa85e8d95..8dc193c3b430c6124546e0bde7f9982717e18f17 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('guest', __FILE__);
 
 // Derterminate which stats we want and set mode and title for the link below stats block
-if (!REQUEST_ISSET_GET(('mode'))) REQUEST_SET_GET('mode', strtolower(getConfig('guest_stats')));
+if (!REQUEST_ISSET_GET('mode')) REQUEST_SET_GET('mode', strtolower(getConfig('guest_stats')));
 
 switch (REQUEST_GET('mode')) {
        case 'members' :
index f9b5405b394e2444738264e426c9de7c193665c7..e9bf25cbf547d416e1d2493b472b1663915c16b4 100644 (file)
@@ -57,7 +57,7 @@ $TPTS = 0;
 while ($content = SQL_FETCHARRAY($result_depths)) {
        // Load referal points
        $result_points = SQL_QUERY_ESC("SELECT points FROM `{!_MYSQL_PREFIX_user_points!}` WHERE userid=%s AND ref_depth=%d LIMIT 1",
-       array(getUserId(), bigintval($content['level'])), __FILE__, __LINE__);
+               array(getUserId(), bigintval($content['level'])), __FILE__, __LINE__);
 
        // Entry found?
        if (SQL_NUMROWS($result_points) == 1) {
@@ -66,7 +66,7 @@ while ($content = SQL_FETCHARRAY($result_depths)) {
 
                // Add them to total
                $TPTS += $points;
-       }
+       } // END - if
 
        // Free result
        SQL_FREERESULT($result_points);
@@ -76,13 +76,13 @@ while ($content = SQL_FETCHARRAY($result_depths)) {
 SQL_FREERESULT($result_depths);
 
 // Get used points
-$USED = GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
+$USED = GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
 
 // Translate point into comma
 $TPTS = translateComma($TPTS - $USED);
 
 // Sanity check...
-if (empty($TPTS)) $TPTS = "0.00000";
+if (empty($TPTS)) $TPTS = '0.00000';
 
 if (!REQUEST_ISSET_GET(('payout'))) {
        // Load payout types
@@ -140,7 +140,7 @@ ORDER BY p.payout_timestamp DESC",
                                );
 
                                // Load row template and switch colors
-                               $OUT .= LOAD_TEMPLATE("member_payout_row", true, $content);
+                               $OUT .= LOAD_TEMPLATE('member_payout_row', true, $content);
                                $SW = 3 - $SW;
                        }
 
@@ -149,7 +149,7 @@ ORDER BY p.payout_timestamp DESC",
                        define('__PAYOUT_ROWS', $OUT);
 
                        // Load template
-                       LOAD_TEMPLATE("member_payout");
+                       LOAD_TEMPLATE('member_payout');
                }
 
                // Free memory
@@ -161,7 +161,7 @@ ORDER BY p.payout_timestamp DESC",
 } else {
        // Chedk if he can get paid by selected type
        $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url AS allow FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
-       array(bigintval(REQUEST_GET('payout'))), __FILE__, __LINE__);
+               array(bigintval(REQUEST_GET('payout'))), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result) == 1) {
                // ID is valid so load the data
@@ -199,58 +199,58 @@ ORDER BY p.payout_timestamp DESC",
                                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_payouts` (userid, payout_total, payout_id, payout_timestamp, status, target_url, link_text, banner_url)
 VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')",
                                        array(
-                                       getUserId(),
-                                       bigintval(REQUEST_POST('payout')),
-                                       bigintval(REQUEST_GET('payout')),
-                                       REQUEST_POST('turl'),
-                                       REQUEST_POST('alt'),
-                                       REQUEST_POST('banner')
+                                               getUserId(),
+                                               bigintval(REQUEST_POST('payout')),
+                                               bigintval(REQUEST_GET('payout')),
+                                               REQUEST_POST('turl'),
+                                               REQUEST_POST('alt'),
+                                               REQUEST_POST('banner')
                                        ), __FILE__, __LINE__);
 
                                        // Load templates
-                                       $msg_mem = LOAD_EMAIL_TEMPLATE("member_payout_request_banner", array(), getUserId());
+                                       $msg_mem = LOAD_EMAIL_TEMPLATE('member_payout_request_banner', REQUEST_POST_ARRAY(), getUserId());
                                        if (GET_EXT_VERSION('admins') >= '0.4.1') {
-                                               $adm_tpl = "admin_payout_request_banner";
+                                               $adm_tpl = 'admin_payout_request_banner';
                                        } else {
-                                               $msg_adm = LOAD_EMAIL_TEMPLATE("admin_payout_request_banner", array(), getUserId());
+                                               $msg_adm = LOAD_EMAIL_TEMPLATE('admin_payout_request_banner', REQUEST_POST_ARRAY(), getUserId());
                                        }
                                } else {
                                        // e-currency payout requested
                                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_payouts` (userid, payout_total, target_account, target_bank, payout_id, payout_timestamp, status, password)
 VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
                                        array(
-                                       getUserId(),
-                                       bigintval(REQUEST_POST('payout')),
-                                       bigintval(REQUEST_POST('account')),
-                                       REQUEST_POST('bank'),
-                                       bigintval(REQUEST_GET('payout')),
-                                       REQUEST_POST('pass')
+                                               getUserId(),
+                                               bigintval(REQUEST_POST('payout')),
+                                               bigintval(REQUEST_POST('account')),
+                                               REQUEST_POST('bank'),
+                                               bigintval(REQUEST_GET('payout')),
+                                               REQUEST_POST('pass')
                                        ), __FILE__, __LINE__);
 
                                        // Load templates
-                                       $msg_mem = LOAD_EMAIL_TEMPLATE("member_payout_request", array(), getUserId());
-                                       $msg_adm = LOAD_EMAIL_TEMPLATE("admin_payout_request", array(), getUserId());
+                                       $msg_mem = LOAD_EMAIL_TEMPLATE('member_payout_request', REQUEST_POST_ARRAY(), getUserId());
+                                       $msg_adm = LOAD_EMAIL_TEMPLATE('admin_payout_request', REQUEST_POST_ARRAY(), getUserId());
                                        $admin_tpl = '';
 
                                        // @TODO Rewrite this to a filter
                                        if (GET_EXT_VERSION('admins') >= '0.4.1') {
-                                               $admin_tpl = "admin_payout_request";
-                                       }
+                                               $admin_tpl = 'admin_payout_request';
+                                       } // END - if
                                }
 
                                // Generate task
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, status, task_type, subject, text, task_created, userid)
 VALUES (0, 'NEW','PAYOUT_REQUEST','[payout:] {--PAYOUT_REQUEST_ADMIN--}','%s', UNIX_TIMESTAMP(), %s)",
                                array(
-                               $msg_adm,
-                               getUserId()
+                                       $msg_adm,
+                                       getUserId()
                                ), __FILE__, __LINE__);
 
                                // Send out mails
                                sendEmail(getUserId(), getMessage('PAYOUT_REQUEST_MEMBER'), $msg_mem);
 
                                // To admin(s)
-                               sendAdminNotification(getMessage('PAYOUT_REQUEST_ADMIN'), $admin_tpl, array(), getUserId());
+                               sendAdminNotification(getMessage('PAYOUT_REQUEST_ADMIN'), $admin_tpl, REQUEST_POST_ARRAY(), getUserId());
 
                                // Load template and output it
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_REQUEST_SENT'));
@@ -261,7 +261,7 @@ VALUES (0, 'NEW','PAYOUT_REQUEST','[payout:] {--PAYOUT_REQUEST_ADMIN--}','%s', U
                                );
 
                                // Generate banner order form
-                               LOAD_TEMPLATE("member_payout_form_banner", false, $content);
+                               LOAD_TEMPLATE('member_payout_form_banner', false, $content);
                        } else {
                                // Prepare content
                                $content = array(
@@ -269,7 +269,7 @@ VALUES (0, 'NEW','PAYOUT_REQUEST','[payout:] {--PAYOUT_REQUEST_ADMIN--}','%s', U
                                );
 
                                // Generate normal form
-                               LOAD_TEMPLATE("member_payout_form", false, $content);
+                               LOAD_TEMPLATE('member_payout_form', false, $content);
                        }
                } else {
                        // Not enougth points
index 7cc98acb71a6f46b791335a32508740a72fab479..deff292584e75a051cb4a1792b2644108892267f 100644 (file)
@@ -63,7 +63,7 @@ if ((getConfig('primera_api_name') == '') || (getConfig('primera_api_md5') == ''
 $content = array(); $points = false;
 
 // Is the mode set (payout only)
-if (!REQUEST_ISSET_GET(('mode'))) {
+if (!REQUEST_ISSET_GET('mode')) {
        // Get referal id
        $content['refid'] = getConfig(('primera_refid'));
 
@@ -81,7 +81,7 @@ if (!REQUEST_ISSET_GET(('mode'))) {
        SQL_FREERESULT($result);
 
        // Is there an ID?
-       if ((!empty($content['primera_nickname'])) && (!REQUEST_ISSET_GET(('mode')))) {
+       if ((!empty($content['primera_nickname'])) && (!REQUEST_ISSET_GET('mode'))) {
                // Then use an other "mode"
                REQUEST_SET_GET('mode', "list");
 
@@ -151,12 +151,12 @@ if (REQUEST_GET('mode') == "pay") {
        SQL_FREERESULT($result);
 } else {
        // Invalid mode!
-       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MODE_INVALID'), REQUEST_GET(('mode'))));
+       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MODE_INVALID'), REQUEST_GET('mode')));
        return;
 }
 
 // Is the formular sent?
-if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
+if ((isFormSent()) && (REQUEST_ISSET_GET('mode'))) {
        // Check input data depending on the mode and execute the requested mode
        switch (REQUEST_GET('mode')) {
                case "pay": // Payout this exchange -> Primus
@@ -214,13 +214,13 @@ if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
 
                default: // Invalid mode!
                        DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", REQUEST_GET('mode')));
-                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MODE_INVALID'), REQUEST_GET(('mode'))));
+                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MODE_INVALID'), REQUEST_GET('mode')));
                        return;
        }
 } // END - if
 
 // Prepare mode for template name
-$mode = sprintf("member_primera_mode_%s", REQUEST_GET(('mode')));
+$mode = sprintf("member_primera_mode_%s", REQUEST_GET('mode'));
 
 // Load the template
 LOAD_TEMPLATE($mode, false, $content);
index e7691f0cf9584d3fb70d5678d11bc3a494748641..c094189b334be9f17a0cb7acbbac893e6904a5f7 100644 (file)
@@ -59,7 +59,7 @@ list($opt_in) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 
 $mode = '';
-if (REQUEST_ISSET_GET(('mode'))) $mode = REQUEST_GET('mode');
+if (REQUEST_ISSET_GET('mode')) $mode = REQUEST_GET('mode');
 
 // Check for "faker"
 if (($opt_in == 'N') && ($mode == "new")) $mode = '';
index bc7327ded42b57a8f741727dc3b29018178c209b..ba5d83c97aeefbf316193744e89b1299daf0909a 100644 (file)
@@ -62,14 +62,14 @@ if ((getConfig('wernis_api_id') == '') || (getConfig('wernis_api_md5') == '')) {
 $content = array(); $points = false;
 
 // Is the mode set (withdraw or payout)
-if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
+if ((!REQUEST_ISSET_GET('mode')) || (REQUEST_GET('mode') == 'choose')) {
        // Let the user choose what he wants to do
        $content['refid']    = getConfig(('wernis_refid'));
        $content['wds66_id'] = 0;
 
        // Get WDS66 id
        $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-       array(getUserId()), __FILE__, __LINE__);
+               array(getUserId()), __FILE__, __LINE__);
 
        // Are there some entries?
        if (SQL_NUMROWS($result) == 1) {
@@ -81,13 +81,13 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        SQL_FREERESULT($result);
 
        // Is there an ID?
-       if ((!empty($content['wds66_id'])) && (!REQUEST_ISSET_GET(('mode')))) {
+       if ((!empty($content['wds66_id'])) && (!REQUEST_ISSET_GET('mode'))) {
                // Then use an other "mode"
-               REQUEST_SET_GET('mode', "list");
+               REQUEST_SET_GET('mode', 'list');
 
                // And load all rows!
                $result = SQL_QUERY_ESC("SELECT `id`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC",
-               array(getUserId()), __FILE__, __LINE__);
+                       array(getUserId()), __FILE__, __LINE__);
 
                // Load all rows
                $content['rows'] = ''; $SW = 2;
@@ -103,7 +103,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
                        );
 
                        // Load row template
-                       $content['rows'] .= LOAD_TEMPLATE("member_wernis_mode_list_row", true, $rowContent);
+                       $content['rows'] .= LOAD_TEMPLATE('member_wernis_mode_list_row', true, $rowContent);
                        $SW = 3 - $SW;
                }
 
@@ -111,8 +111,8 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
                SQL_FREERESULT($result);
        } else {
                // Default links are not active!
-               $content['payout_link']   = "<em>{--WERNIS_MEMBER_PAYOUT_DISABLED--}</em>";
-               $content['withdraw_link'] = "<em>{--WERNIS_MEMBER_WITHDRAW_DISABLED--}</em>";
+               $content['payout_link']   = '<em>{--WERNIS_MEMBER_PAYOUT_DISABLED--}</em>';
+               $content['withdraw_link'] = '<em>{--WERNIS_MEMBER_WITHDRAW_DISABLED--}</em>';
 
                // Is the payout mode active?
                if (getConfig('wernis_payout_active') == 'Y') {
@@ -127,11 +127,11 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
                } // END - if
 
                // Mode chooser! ;-)
-               REQUEST_SET_GET('mode', "choose");
+               REQUEST_SET_GET('mode', 'choose');
        }
 } elseif ((REQUEST_GET('mode') == 'payout') && (getConfig('wernis_payout_active') == 'Y')) {
        // Get total points and check if the user can request a payout
-       $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
+       $points = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
 
        // Remove the registration fee
        $points = $points - getConfig('points_register');
@@ -160,7 +160,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        // Get WDS66 id
        $content['wds66_id'] = '';
        $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-       array(getUserId()), __FILE__, __LINE__);
+               array(getUserId()), __FILE__, __LINE__);
 
        // Are there some entries?
        if (SQL_NUMROWS($result) == 1) {
@@ -170,9 +170,9 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
 
        // Free result
        SQL_FREERESULT($result);
-} elseif ((REQUEST_GET('mode') == "withdraw") && (getConfig('wernis_withdraw_active') == 'Y')) {
+} elseif ((REQUEST_GET('mode') == 'withdraw') && (getConfig('wernis_withdraw_active') == 'Y')) {
        // Get total points for just displaying them
-       $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
+       $points = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
 
        // Prepare data for the template
        $content['points']     = translateComma($points);
@@ -184,7 +184,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
 
        // Get WDS66 id
        $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-       array(getUserId()), __FILE__, __LINE__);
+               array(getUserId()), __FILE__, __LINE__);
 
        // Are there some entries?
        if (SQL_NUMROWS($result) == 1) {
@@ -196,12 +196,12 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        SQL_FREERESULT($result);
 } else {
        // Invalid mode!
-       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MODE_INVALID'), REQUEST_GET(('mode'))));
+       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MODE_INVALID'), REQUEST_GET('mode')));
        return;
 }
 
 // Is the formular sent?
-if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
+if ((isFormSent()) && (REQUEST_ISSET_GET('mode'))) {
        // Is the user ID and password set?
        if (!REQUEST_ISSET_POST(('wds66_id'))) {
                // Nothing entered in WDS66 user ID
@@ -228,14 +228,14 @@ if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
                                } else {
                                        // All is fine here so do the withdraw
                                        $success = WERNIS_EXECUTE_WITHDRAW(REQUEST_POST('wds66_id'), md5(REQUEST_POST('wds66_password')), REQUEST_POST('amount'));
-                                       if ($success) {
+                                       if ($success === true) {
                                                // Add it to this amount
                                                unset($GLOBALS['ref_level']);
                                                ADD_POINTS_REFSYSTEM_DIRECT('wernis_withdraw', getUserId(), bigintval(REQUEST_POST('amount')));
 
                                                // Update the user data as well..
                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
-                                               array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
+                                                       array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
 
                                                // All done!
                                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_WITHDRAW_DONE'));
@@ -260,18 +260,18 @@ if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
                                } else {
                                        // All is fine here so do the withdraw
                                        $success = WERNIS_EXECUTE_PAYOUT(REQUEST_POST('wds66_id'), REQUEST_POST('amount'));
-                                       if ($success) {
+                                       if ($success === true) {
                                                // Sub points
-                                               SUB_POINTS("wernis_payout", getUserId(), REQUEST_POST('amount'));
+                                               SUB_POINTS('wernis_payout', getUserId(), REQUEST_POST('amount'));
 
                                                // Update WDS66 id
                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
-                                               array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
+                                                       array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
 
                                                // All done!
                                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_PAYOUT_DONE'));
                                                return;
-                                       } elseif ((GET_WERNIS_ERROR_CODE() == "user_failed") || (GET_WERNIS_ERROR_CODE() == "own_failed") || (GET_WERNIS_ERROR_CODE() == "amount_failed") || (GET_WERNIS_ERROR_CODE() == "api_amount_failed")) {
+                                       } elseif ((GET_WERNIS_ERROR_CODE() == 'user_failed') || (GET_WERNIS_ERROR_CODE() == 'own_failed') || (GET_WERNIS_ERROR_CODE() == 'amount_failed') || (GET_WERNIS_ERROR_CODE() == 'api_amount_failed')) {
                                                // Wrong login data
                                                LOAD_TEMPLATE('admin_settings_saved', false, GET_WERNIS_ERROR_MESSAGE());
                                        } else {
@@ -283,14 +283,14 @@ if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
 
                        default: // Invalid mode!
                                DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", REQUEST_GET('mode')));
-                               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MODE_INVALID'), REQUEST_GET(('mode'))));
+                               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MODE_INVALID'), REQUEST_GET('mode')));
                                return;
                }
        }
 } // END - if
 
 // Prepare mode for template name
-$mode = sprintf("member_wernis_mode_%s", REQUEST_GET(('mode')));
+$mode = sprintf("member_wernis_mode_%s", REQUEST_GET('mode'));
 
 // Load the template
 LOAD_TEMPLATE($mode, false, $content);
index 7bf73db0fbb7e8cce49af4171a5fa9ac3b7bec12..446518563af4851587ea218b24a246efe7a9b225 100644 (file)
@@ -57,6 +57,9 @@ foreach (array('request-functions', 'session-functions', 'config-functions', 'co
 // Set error handler
 set_error_handler('__errorHandler');
 
+// Init request
+initRequest();
+
 // Set important header_sent
 $GLOBALS['header_sent'] = 0;
 
index 7504db5bada6386c885206e7849867c7d58ef9a5..2d5d26fa9af300d84339cf283937fcf42e9b7e2e 100644 (file)
@@ -819,12 +819,15 @@ function sendModeMails ($mod, $modes) {
                                                        $DATA[4] = COUNTRY_GENERATE_INFO(REQUEST_POST('country_code'));
                                                } // END - if
 
+                                               // Merge content with data from POST
+                                               $content = merge_array($content, REQUEST_POST_ARRAY());
+
                                                // Load template
-                                               $msg = LOAD_EMAIL_TEMPLATE("member_mydata_notify", $content, getUserId());
+                                               $msg = LOAD_EMAIL_TEMPLATE('member_mydata_notify', $content, getUserId());
 
                                                if (getConfig('admin_notify') == 'Y') {
                                                        // The admin needs to be notified about a profile change
-                                                       $msg_admin = "admin_mydata_notify";
+                                                       $msg_admin = 'admin_mydata_notify';
                                                        $sub_adm   = getMessage('ADMIN_CHANGED_DATA');
                                                } else {
                                                        // No mail to admin
@@ -839,10 +842,10 @@ function sendModeMails ($mod, $modes) {
                                                $content = "<span class=\"member_done\">{--MYDATA_MAIL_SENT--}</span>";
                                                break;
 
-                                                               default:
-                                                                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
-                                                                       $content = "<span class=\"member_failed\">{--UNKNOWN_MODULE--}</span>";
-                                                                       break;
+                                       default: // Unsupported module!
+                                               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
+                                               $content = "<span class=\"member_failed\">{--UNKNOWN_MODULE--}</span>";
+                                               break;
                                } // END - switch
                        } else {
                                // Could not load profile data
index c50fa5558c209e13fa26a795163c1473ff6f02b7..5f9f1e263bb2b36378af1ddf877dc7d161a2c130 100644 (file)
@@ -48,15 +48,15 @@ function REQUEST_GET ($element) {
        $value = null;
 
        // Is the element cached or there?
-       if (isset($GLOBALS['cache_array']['request_get'][$element])) {
+       if (isset($GLOBALS['cache_request']['request_get'][$element])) {
                // Then use the cache
-               $value = $GLOBALS['cache_array']['request_get'][$element];
+               $value = $GLOBALS['cache_request']['request_get'][$element];
        } elseif (REQUEST_ISSET_GET($element)) {
                // Then get it directly
-               $value = SQL_ESCAPE($_GET[$element]);
+               $value = SQL_ESCAPE($GLOBALS['raw_request']['get'][$element]);
 
                // Store it in cache
-               $GLOBALS['cache_array']['request_get'][$element] = $value;
+               $GLOBALS['cache_request']['request_get'][$element] = $value;
        } // END - if
 
        // Return value
@@ -66,20 +66,20 @@ function REQUEST_GET ($element) {
 // Checks if an element in $_GET exists
 function REQUEST_ISSET_GET ($element, $subElement = '') {
        if (empty($subElement)) {
-               return ((isset($_GET[$element])) && (!empty($_GET[$element])));
+               return ((isset($GLOBALS['raw_request']['get'][$element])) && (!empty($GLOBALS['raw_request']['get'][$element])));
        } else {
-               return ((isset($_GET[$element][$subElement])) && (!empty($_GET[$element][$subElement])));
+               return ((isset($GLOBALS['raw_request']['get'][$element][$subElement])) && (!empty($GLOBALS['raw_request']['get'][$element][$subElement])));
        }
 }
 
 // Removes an element from $_GET
 function REQUEST_UNSET_GET ($element) {
-       unset($_GET[$element]);
+       unset($GLOBALS['raw_request']['get'][$element]);
 }
 
 // Getter for whole $_GET array
 function REQUEST_GET_ARRAY () {
-       return $_GET;
+       return $GLOBALS['raw_request']['get'];
 }
 
 // Counts entries in $_GET or returns false if not an array
@@ -101,24 +101,41 @@ function REQUEST_GET_COUNT () {
 
 // Setter for element in $_GET
 function REQUEST_SET_GET ($element, $value) {
-       $_GET[SQL_ESCAPE($element)] = SQL_ESCAPE($value);
+       // Escape both
+       $element = SQL_ESCAPE($element);
+       $value   = SQL_ESCAPE($value);
+
+       // Set in $_GET
+       $GLOBALS['raw_request']['get'][$element] = $value;
+
+       // Update cache
+       $GLOBALS['cache_request']['request_get'][$element] = $value;
 }
 
 // Wrapper for elements in $_POST
-function REQUEST_POST ($element, $subElement=null) {
+function REQUEST_POST ($element, $subElement=-1) {
        // By default no element is there
        $value = null;
 
-       // Is the element there?
-       if (REQUEST_ISSET_POST($element)) {
+       // Is the element in cache?
+       if (isset($GLOBALS['cache_request']['request_post'][$element][$subElement])) {
+               // Then use it
+               $value = $GLOBALS['cache_request']['request_post'][$element][$subElement];
+       } elseif (REQUEST_ISSET_POST($element)) {
                // Then use it
-               $value = $_POST[$element];
+               $value = $GLOBALS['raw_request']['post'][$element];
 
                // Is $subElement set?
-               if ((!is_null($subElement)) && (REQUEST_ISSET_POST($element, $subElement))) {
+               if (($subElement != -1) && (REQUEST_ISSET_POST($element, $subElement))) {
                        // Then use this
-                       $value = $value[$subElement];
-               } // END - if
+                       $value = SQL_ESCAPE($value[$subElement]);
+               } else {
+                       // Escape it here
+                       $value = SQL_ESCAPE($value);
+               }
+
+               // Set it in cache
+               $GLOBALS['cache_request']['request_post'][$element][$subElement] = SQL_ESCAPE($value);
        } // END - if
 
        // Return value
@@ -128,20 +145,25 @@ function REQUEST_POST ($element, $subElement=null) {
 // Checks if an element in $_POST exists
 function REQUEST_ISSET_POST ($element, $subElement=null) {
        if (is_null($subElement)) {
-               return ((isset($_POST[$element])) && (!empty($_POST[$element])));
+               return ((isset($GLOBALS['raw_request']['post'][$element])) && (!empty($GLOBALS['raw_request']['post'][$element])));
        } else {
-               return ((isset($_POST[$element][$subElement])) && (!empty($_POST[$element][$subElement])));
+               return ((isset($GLOBALS['raw_request']['post'][$element][$subElement])) && (!empty($GLOBALS['raw_request']['post'][$element][$subElement])));
        }
 }
 
 // Removes an element from $_POST
 function REQUEST_UNSET_POST ($element) {
-       unset($_POST[$element]);
+       unset($GLOBALS['raw_request']['post'][$element]);
 }
 
 // Getter for whole $_POST array
 function REQUEST_POST_ARRAY () {
-       return $_POST;
+       return $GLOBALS['raw_request']['post'];
+}
+
+// Setter for whole $_POST array
+function REQUEST_SET_POST_ARRAY (array $POST) {
+       $GLOBALS['raw_request']['post'] = $POST;
 }
 
 // Counts entries in $_POST or returns false if not an array
@@ -166,7 +188,7 @@ function REQUEST_SET_POST ($element, $value) {
        // Is $element or $value an array?
        if (is_array($element)) {
                // Set array
-               $eval = "\$_POST['";
+               $eval = "\$GLOBALS['raw_request']['post']['";
 
                // Add all entries
                $eval .= implode("']['", $element);
@@ -177,12 +199,22 @@ function REQUEST_SET_POST ($element, $value) {
                // And run it
                eval($eval);
        } elseif (is_array($value)) {
+               // Escape element
+               $element = SQL_ESCAPE($element);
+
                // Value is an array so set it directly
-               $_POST[SQL_ESCAPE($element)] = $value;
+               $GLOBALS['raw_request']['post'][$element] = $value;
        } else {
+               // Escape both
+               $element = SQL_ESCAPE($element);
+               $value   = SQL_ESCAPE($value);
+
                // Set regular entry
-               $_POST[SQL_ESCAPE($element)] = SQL_ESCAPE($value);
+               $GLOBALS['raw_request']['post'][$element] = $value;
        }
+
+       // Update cache
+       $GLOBALS['cache_request']['request_post'][$element] = $value;
 }
 
 // Checks wether a form was sent. If so, the $_POST['ok'] element must be set
@@ -191,5 +223,11 @@ function isFormSent () {
        return REQUEST_ISSET_POST('ok');
 }
 
+// Initialize the request elements
+function initRequest () {
+       $GLOBALS['raw_request']['get']  = $_GET;
+       $GLOBALS['raw_request']['post'] = $_POST;
+}
+
 //
 ?>
index 5d27ca58265e2582b7332ef9b2a41767e17dcd51..7068fdc8bb5baee5a5d0b658101fd58d621ccfe5 100644 (file)
@@ -325,6 +325,12 @@ function isDebugModeEnabled () {
        return (getConfig('DEBUG_MODE') == 'Y');
 }
 
+// Checks wether we shall debug regular expressions
+function isDebugRegExpressionEnabled () {
+       // Simply check it
+       return (getConfig('DEBUG_REGEX') == 'Y');
+}
+
 // Checks wether the cache instance is valid
 function isCacheInstanceValid () {
        return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
index db66acde3c521f59f55ca3c46c1c1f8098859f49..4da0ecff2af4ac9125d49006c29a97fd8c4581eb 100644 (file)
@@ -20,9 +20,9 @@ Nachname: $content[family]
 Email-Adresse: $content[email]
 ------------------------------
 Auszahlungsart: {--PAYOUT_TYPE_VALUE--}
-Auszahlungshoehe: $_POST[payout]
-An Konto: $_POST[account]
-Bei Bank/Webseite: $_POST[bank]
+Auszahlungshoehe: $content[payout]
+An Konto: $content[account]
+Bei Bank/Webseite: $content[bank]
 ------------------------------
 
 Bitte ueberpruefen Sie diese Daten und ueberweisen Sie dann den geforderten Betrag.
index a6ea5e8feebe9cf35030909e4a074fb70c4f4d9f..234a3d5db2b8e83da061f5832d5cd4782e4c250f 100644 (file)
@@ -20,11 +20,11 @@ Nachname: $content[family]
 Email-Adresse: $content[email]
 ------------------------------
 Auszahlungsart: {--PAYOUT_TYPE_VALUE--}
-Auszahlungshoehe: $_POST[payout]
+Auszahlungshoehe: $content[payout]
 ------------------------------
-Ziel-URL: $_POST[turl]
-Linktext: $_POST[alt]
-Banner-URL: $_POST[banner]
+Ziel-URL: $content[turl]
+Linktext: $content[alt]
+Banner-URL: $content[banner]
 ------------------------------
 
 Bitte ueberpruefen Sie diese Daten und ueberweisen Sie dann den geforderten Betrag.
index 536724eb7bc3b364c441a82a370f9ef0702c2a3f..c830f46831bb55b26d2129618255296607fe218b 100644 (file)
@@ -19,8 +19,8 @@ Vorname: $content[surname]
 Nachname: $content[family]
 Email-Adresse: $content[email]
 ------------------------------
-Auszahlungshoehe: $_POST[payout]
-An Konto: $_POST[account]
+Auszahlungshoehe: $content[payout]
+An Konto: $content[account]
 ------------------------------
 
 Bitte ueberpruefen Sie diese Daten und ueberweisen Sie dann den geforderten Betrag.
index dbcb835fa30e449bb0318f50b7da284315136148..64c1143a7a3e95abf1b665f2b8907788c5c63be3 100644 (file)
@@ -12,7 +12,7 @@ Hallo $DATA[1] $DATA[2],
 {--ZIP--}: $DATA[5]
 {--CITY--}: $DATA[6]
 {--ADDY--}: $DATA[7]
-{--PASS_1--}: $_POST[pass1]
+{--PASS_1--}: $content[pass1]
 ------------------------------------------
 IP-Nummer: $REMOTE_ADDR
 ------------------------------------------
index daeb5c590d5eb5848109b3d84d051eeced24524d..c4555b4bb1d7b7597b32c8e24e5929274d7d88a9 100644 (file)
@@ -12,9 +12,9 @@ Nachname: $content[family]
 Email-Adresse: $content[email]
 ------------------------------
 Auszahlungsart: {--PAYOUT_TYPE_VALUE--}
-Auszahlungshoehe: $_POST[payout]
-An Konto: $_POST[account]
-Bei Bank/Webseite: $_POST[bank]
+Auszahlungshoehe: $content[payout]
+An Konto: $content[account]
+Bei Bank/Webseite: $content[bank]
 ------------------------------
 
 Die dazu noetigen {--PAYOUT_POINTS_VALUE--} haben wir Ihnen bereits abgezogen.
index dc300f55e48ad23495b5b46c1c861dd681196df3..f33bc30331a9e2d11a91029c534367137c2df7b3 100644 (file)
@@ -12,11 +12,11 @@ Nachname: $content[family]
 Email-Adresse: $content[email]
 ------------------------------
 Auszahlungsart: {--PAYOUT_TYPE_VALUE--}
-Auszahlungshoehe: $_POST[payout]
+Auszahlungshoehe: $content[payout]
 ------------------------------
-Ziel-URL: $_POST[turl]
-Linktext: $_POST[alt]
-Banner-URL: $_POST[banner]
+Ziel-URL: $content[turl]
+Linktext: $content[alt]
+Banner-URL: $content[banner]
 ------------------------------
 
 Die dazu noetigen {--PAYOUT_POINTS_VALUE--} haben wir Ihnen bereits abgezogen.
index 38e9bd591ee9e65d7ef67429efb37baa89abf494..45e391626cef0f6b6057caf0c7dc327722f57096 100644 (file)
@@ -11,8 +11,8 @@ Vorname: $content[surname]
 Nachname: $content[family]
 Email-Adresse: $content[email]
 ------------------------------
-Auszahlungshoehe: $_POST[payout]
-An Konto: $_POST[account]
+Auszahlungshoehe: $content[payout]
+An Konto: $content[account]
 ------------------------------
 
 Die dazu noetigen {!WERNIS_POINTS_VALUE!} Wernis haben wir Ihnen bereits abgezogen.
index dbf86f0c570baf35fa2a6d7215696667e6e148c5..4ff1ef47be4c375ab34bf28fe183e4631785346e 100644 (file)
@@ -11,7 +11,7 @@
                <td width="235" align="right">{--ADMIN_ADMINS_ENTER_LOGIN--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td width="235"><input type="text" name="login"
-                       class="admin_normal" size="10" maxlength="255" value="$_POST[login]"></td>
+                       class="admin_normal" size="10" maxlength="255" value="$content[login]"></td>
        </tr>
        <tr>
                <td colspan="3" height="5" class="seperator">&nbsp;</td>
@@ -20,7 +20,7 @@
                <td align="right">{--ADMIN_ADMINS_ENTER_EMAIL--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td><input type="text" name="email" class="admin_normal"
-                       size="25" maxlength="255" value="$_POST[email]"></td>
+                       size="25" maxlength="255" value="$content[email]"></td>
        </tr>
        <tr>
                <td colspan="3" height="5" class="seperator">&nbsp;</td>