]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_other.php
A lot while() conditions rewritten to SQL_FETCHARRAY(), see bug #107, @TODO tags...
[mailer.git] / inc / modules / admin / what-config_other.php
index 58fe215f3a2d2e36e79eab00869efcb5495dae10..f678104a677876b33b1b4a8f4db8bd03145d044f 100644 (file)
@@ -35,9 +35,9 @@
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("other")) || (GET_EXT_VERSION("other") == "")) {
+} elseif (!EXT_IS_ACTIVE("other")) {
        // Missing extension!
        // Missing extension!
-       addFatalMessage(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "other"));
+       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "other");
        return;
 }
 
        return;
 }
 
@@ -45,34 +45,34 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR("admin", __FILE__);
 
 // Stop saving data if one input field is !isset
 ADD_DESCR("admin", __FILE__);
 
 // Stop saving data if one input field is !isset
-if (isset($_POST['ok'])) {
+if (IS_FORM_SENT()) {
        // Calculate stamps and set calculated stamps
        // Calculate stamps and set calculated stamps
-       $_POST['online_timeout']        = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout"           , $_POST);
-       $_POST['url_tlock']             = CREATE_TIMESTAMP_FROM_SELECTIONS("url_tlock"            , $_POST);
-       $_POST['profile_lock']          = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_lock"         , $_POST);
-       $_POST['profile_update']        = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_update"       , $_POST);
-       $_POST['resend_profile_update'] = CREATE_TIMESTAMP_FROM_SELECTIONS("resend_profile_update", $_POST);
+       REQUEST_POST('online_timeout')        = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout"           , REQUEST_POST_ARRAY());
+       REQUEST_POST('url_tlock')             = CREATE_TIMESTAMP_FROM_SELECTIONS("url_tlock"            , REQUEST_POST_ARRAY());
+       REQUEST_POST('profile_lock')          = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_lock"         , REQUEST_POST_ARRAY());
+       REQUEST_POST('profile_update')        = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_update"       , REQUEST_POST_ARRAY());
+       REQUEST_SET_POST('resend_profile_update', CREATE_TIMESTAMP_FROM_SELECTIONS("resend_profile_update", REQUEST_POST_ARRAY()));
 
        // Online-Timeout shall be > 0 or your database will crow and crow and crow...
 
        // Online-Timeout shall be > 0 or your database will crow and crow and crow...
-       if (!isset($_POST['online_timeout']))        { unset($_POST['ok']); }
+       if (!REQUEST_ISSET_POST(('online_timeout')))        { REQUEST_UNSET_POST('ok'); }
 
        // Chedck other timestamps (which can be zero!)
 
        // Chedck other timestamps (which can be zero!)
-       if (!isset($_POST['profile_lock']))          { unset($_POST['ok']); }
-       if (!isset($_POST['url_tlock']))             { unset($_POST['ok']); }
-       if (!isset($_POST['profile_update']))        { unset($_POST['ok']); }
-       if (!isset($_POST['resend_profile_update'])) { unset($_POST['ok']); }
+       if (!REQUEST_ISSET_POST(('profile_lock')))          { REQUEST_UNSET_POST('ok'); }
+       if (!REQUEST_ISSET_POST(('url_tlock')))             { REQUEST_UNSET_POST('ok'); }
+       if (!REQUEST_ISSET_POST(('profile_update')))        { REQUEST_UNSET_POST('ok'); }
+       if (!REQUEST_ISSET_POST(('resend_profile_update'))) { REQUEST_UNSET_POST('ok'); }
 
        // Check other settings
 
        // Check other settings
-       if (!isset($_POST['max_send']))              { unset($_POST['ok']); }
-       if (!isset($_POST['code_length']))           { unset($_POST['ok']); }
-       if (!isset($_POST['reject_url']))            { unset($_POST['ok']); }
+       if (!REQUEST_ISSET_POST(('max_send')))              { REQUEST_UNSET_POST('ok'); }
+       if (!REQUEST_ISSET_POST(('code_length')))           { REQUEST_UNSET_POST('ok'); }
+       if (!REQUEST_ISSET_POST(('reject_url')))            { REQUEST_UNSET_POST('ok'); }
 }
 
 }
 
-if (isset($_POST['ok'])) {
+if (IS_FORM_SENT()) {
        // Update stamps directly
        // Update stamps directly
-       ADMIN_SAVE_SETTINGS($_POST);
+       ADMIN_SAVE_SETTINGS_POST();
 } else {
 } else {
-       // Transfer config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!)
+       // Transfer config data into constants for the template
        define('_CFG_CODE_LENGTH', getConfig('code_length'));
        define('_CFG_ACT_SYSTEM' , getConfig('activate_xchange'));
        define('_CFG_MAX_SEND'   , getConfig('max_send'));
        define('_CFG_CODE_LENGTH', getConfig('code_length'));
        define('_CFG_ACT_SYSTEM' , getConfig('activate_xchange'));
        define('_CFG_MAX_SEND'   , getConfig('max_send'));
@@ -86,7 +86,7 @@ if (isset($_POST['ok'])) {
        define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS(getConfig('profile_update'), "profile_update"       , "YM"));
        define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS(getConfig('resend_profile_update') , "resend_profile_update", "MWD"));
 
        define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS(getConfig('profile_update'), "profile_update"       , "YM"));
        define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS(getConfig('resend_profile_update') , "resend_profile_update", "MWD"));
 
-       if (getConfig('order_multi_page') == "N") {
+       if (getConfig('order_multi_page') != "Y") {
                define('_CFG_ORDER_MULTI_N', " checked=\"checked\"");
                define('_CFG_ORDER_MULTI_Y', "");
        } else {
                define('_CFG_ORDER_MULTI_N', " checked=\"checked\"");
                define('_CFG_ORDER_MULTI_Y', "");
        } else {
@@ -94,7 +94,7 @@ if (isset($_POST['ok'])) {
                define('_CFG_ORDER_MULTI_Y', " checked=\"checked\"");
        }
 
                define('_CFG_ORDER_MULTI_Y', " checked=\"checked\"");
        }
 
-       if (getConfig('autosend_active') == "N") {
+       if (getConfig('autosend_active') != "Y") {
                define('_CFG_AUTOSEND_ACTIVE_N', " checked=\"checked\"");
                define('_CFG_AUTOSEND_ACTIVE_Y', "");
        } else {
                define('_CFG_AUTOSEND_ACTIVE_N', " checked=\"checked\"");
                define('_CFG_AUTOSEND_ACTIVE_Y', "");
        } else {
@@ -102,7 +102,7 @@ if (isset($_POST['ok'])) {
                define('_CFG_AUTOSEND_ACTIVE_Y', " checked=\"checked\"");
        }
 
                define('_CFG_AUTOSEND_ACTIVE_Y', " checked=\"checked\"");
        }
 
-       if (getConfig('send_prof_update') == "N") {
+       if (getConfig('send_prof_update') != "Y") {
                define('_CFG_SEND_UPDATE_N', " checked=\"checked\"");
                define('_CFG_SEND_UPDATE_Y', "");
        } else {
                define('_CFG_SEND_UPDATE_N', " checked=\"checked\"");
                define('_CFG_SEND_UPDATE_Y', "");
        } else {
@@ -110,7 +110,7 @@ if (isset($_POST['ok'])) {
                define('_CFG_SEND_UPDATE_Y', " checked=\"checked\"");
        }
 
                define('_CFG_SEND_UPDATE_Y', " checked=\"checked\"");
        }
 
-       if (getConfig('admin_notify') == "N") {
+       if (getConfig('admin_notify') != "Y") {
                define('_CFG_ADMIN_NOTIFY_N', " checked=\"checked\"");
                define('_CFG_ADMIN_NOTIFY_Y', "");
        } else {
                define('_CFG_ADMIN_NOTIFY_N', " checked=\"checked\"");
                define('_CFG_ADMIN_NOTIFY_Y', "");
        } else {