More other options moved out (to config_order)
[mailer.git] / inc / modules / admin / what-config_other.php
index eb64e61a1b8a1f385c105df4e9213a7de46d54df..ad5dc9e0c32973fb7e90487406b2373d80b962b7 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!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") == "")) {
@@ -41,16 +40,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
        ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "other"));
        return;
 }
-global $link;
 
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
 // Stop saving data if one input field is !isset
-if (isset($_POST['ok']))
-{
-       if (function_exists('CREATE_TIME_SELECTIONS'))
-       {
+if (isset($_POST['ok'])) {
+       if (function_exists('CREATE_TIME_SELECTIONS')) {
                // 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);
@@ -76,161 +72,122 @@ if (isset($_POST['ok']))
        if (!isset($_POST['reject_url']))            { unset($_POST['ok']); }
 }
 
-OPEN_TABLE("100%", "admin_content admin_content_align", "");
-if (isset($_POST['ok']))
-{
+if (isset($_POST['ok'])) {
        // Update stamps directly
        ADMIN_SAVE_SETTINGS($_POST);
-}
- else
-{
-       // Transfer config data into constants for the template (DO NOT set $CONFIG as global in LOAD_TEMPLATE!!!)
-       define('_CFG_UNCONFIRMED'   , $CONFIG['unconfirmed']);
-       define('_CFG_MAX_TLENGTH'   , $CONFIG['max_tlength']);
-       define('_CFG_CODE_LENGTH'   , $CONFIG['code_length']);
-       define('_CFG_ACT_SYSTEM'    , $CONFIG['activate_xchange']);
-       define('_CFG_MAX_SEND'      , $CONFIG['max_send']);
-       define('_CFG_REJECT_URL'    , $CONFIG['reject_url']);
+} else {
+       // Transfer config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!)
+       define('_CFG_CODE_LENGTH'   , $_CONFIG['code_length']);
+       define('_CFG_ACT_SYSTEM'    , $_CONFIG['activate_xchange']);
+       define('_CFG_MAX_SEND'      , $_CONFIG['max_send']);
+       define('_CFG_REJECT_URL'    , $_CONFIG['reject_url']);
 
        // Is there the pro-version function avaiable to create selection boxes instead of input boxes?
-       if (function_exists('CREATE_TIME_SELECTIONS'))
-       {
+       if (function_exists('CREATE_TIME_SELECTIONS')) {
                // Only pro versions: time selection boxes
-               define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS($CONFIG['online_timeout'], "ip_timeout"           , "ms"));
-               define('_CFG_URL_TLOCK'     , CREATE_TIME_SELECTIONS($CONFIG['url_tlock']     , "url_tlock"            , "WDh"));
-               define('_CFG_PROFILE_LOCK'  , CREATE_TIME_SELECTIONS($CONFIG['profile_lock']  , "profile_lock"         , "WDh"));
-               define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS($CONFIG['profile_update'], "profile_update"       , "YM"));
-               define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS($CONFIG['resend_profile_update'] , "resend_profile_update", "MWD"));
-       }
-        else
-       {
+               define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['online_timeout'], "ip_timeout"           , "ms"));
+               define('_CFG_URL_TLOCK'     , CREATE_TIME_SELECTIONS($_CONFIG['url_tlock']     , "url_tlock"            , "WDh"));
+               define('_CFG_PROFILE_LOCK'  , CREATE_TIME_SELECTIONS($_CONFIG['profile_lock']  , "profile_lock"         , "WDh"));
+               define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS($_CONFIG['profile_update'], "profile_update"       , "YM"));
+               define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS($_CONFIG['resend_profile_update'] , "resend_profile_update", "MWD"));
+       } else {
                // Normal input boxes
-               define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$CONFIG['online_timeout']."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
-               define('_CFG_URL_TLOCK'     , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$CONFIG['url_tlock']     ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
-               define('_CFG_PROFILE_LOCK'  , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$CONFIG['profile_lock']  ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
-               define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".$CONFIG['profile_update']."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
-               define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$CONFIG['resend_profile_update'] ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
+               define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['online_timeout']."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
+               define('_CFG_URL_TLOCK'     , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['url_tlock']     ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
+               define('_CFG_PROFILE_LOCK'  , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['profile_lock']  ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
+               define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".$_CONFIG['profile_update']."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
+               define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['resend_profile_update'] ."\"> <FONT class=\"tiny\">(".SECS.")</FONT>");
        }
 
-       if ($CONFIG['test_text'] == 'N')
-       {
-               define('_CFG_TEST_TEXT_N', " checked");
-               define('_CFG_TEST_TEXT_Y', "");
-       }
-        else
-       {
-               define('_CFG_TEST_TEXT_N', "");
-               define('_CFG_TEST_TEXT_Y', " checked");
-       }
-       if ($CONFIG['test_subj'] == 'N')
-       {
-               define('_CFG_TEST_SUBJ_N', " checked");
-               define('_CFG_TEST_SUBJ_Y', "");
-       }
-        else
-       {
-               define('_CFG_TEST_SUBJ_N', "");
-               define('_CFG_TEST_SUBJ_Y', " checked");
-       }
-       if ($CONFIG['url_blacklist'] == 'N')
-       {
-               define('_CFG_URL_BLIST_N', " checked");
-               define('_CFG_URL_BLIST_Y', "");
-       }
-        else
-       {
-               define('_CFG_URL_BLIST_N', "");
-               define('_CFG_URL_BLIST_Y', " checked");
-       }
-       if ($CONFIG['order_multi_page'] == 'N')
-       {
-               define('_CFG_ORDER_MULTI_N', " checked");
+       if ($_CONFIG['order_multi_page'] == 'N') {
+               define('_CFG_ORDER_MULTI_N', ' checked');
                define('_CFG_ORDER_MULTI_Y', "");
-       }
-        else
-       {
+       } else {
                define('_CFG_ORDER_MULTI_N', "");
-               define('_CFG_ORDER_MULTI_Y', " checked");
+               define('_CFG_ORDER_MULTI_Y', ' checked');
        }
-       if ($CONFIG['autosend_active'] == 'N')
-       {
-               define('_CFG_AUTOSEND_ACTIVE_N', " checked");
+
+       if ($_CONFIG['autosend_active'] == 'N') {
+               define('_CFG_AUTOSEND_ACTIVE_N', ' checked');
                define('_CFG_AUTOSEND_ACTIVE_Y', "");
-       }
-        else
-       {
+       } else {
                define('_CFG_AUTOSEND_ACTIVE_N', "");
-               define('_CFG_AUTOSEND_ACTIVE_Y', " checked");
+               define('_CFG_AUTOSEND_ACTIVE_Y', ' checked');
        }
-       if ($CONFIG['send_prof_update'] == 'N')
-       {
-               define('_CFG_SEND_UPDATE_N', " checked");
+
+       if ($_CONFIG['send_prof_update'] == 'N') {
+               define('_CFG_SEND_UPDATE_N', ' checked');
                define('_CFG_SEND_UPDATE_Y', "");
-       }
-        else
-       {
+       } else {
                define('_CFG_SEND_UPDATE_N', "");
-               define('_CFG_SEND_UPDATE_Y', " checked");
+               define('_CFG_SEND_UPDATE_Y', ' checked');
        }
-       if ($CONFIG['admin_notify'] == 'N')
-       {
-               define('_CFG_ADMIN_NOTIFY_N', " checked");
+
+       if ($_CONFIG['admin_notify'] == 'N') {
+               define('_CFG_ADMIN_NOTIFY_N', ' checked');
                define('_CFG_ADMIN_NOTIFY_Y', "");
-       }
-        else
-       {
+       } else {
                define('_CFG_ADMIN_NOTIFY_N', "");
-               define('_CFG_ADMIN_NOTIFY_Y', " checked");
+               define('_CFG_ADMIN_NOTIFY_Y', ' checked');
        }
-       if ($CONFIG['css_php'] == "DIRECT")
-       {
-               define('_CFG_CSS_PHP_DIRECT', " checked");
+
+       if ($_CONFIG['css_php'] == "DIRECT") {
+               define('_CFG_CSS_PHP_DIRECT', ' checked');
                define('_CFG_CSS_PHP_FILE', "");
-       }
-        else
-       {
+       } else {
                define('_CFG_CSS_PHP_DIRECT', "");
-               define('_CFG_CSS_PHP_FILE', " checked");
+               define('_CFG_CSS_PHP_FILE', ' checked');
        }
-       if ($CONFIG['guest_menu'] == 'Y') {
-               define('_CFG_GUEST_MENU_ACTIVE', " checked");
+
+       if ($_CONFIG['guest_menu'] == 'Y') {
+               define('_CFG_GUEST_MENU_ACTIVE', ' checked');
                define('_CFG_GUEST_MENU_INACTIVE', "");
        } else {
                define('_CFG_GUEST_MENU_ACTIVE', "");
-               define('_CFG_GUEST_MENU_INACTIVE', " checked");
+               define('_CFG_GUEST_MENU_INACTIVE', ' checked');
        }
-       if ($CONFIG['member_menu'] == 'Y') {
-               define('_CFG_MEMBER_MENU_ACTIVE', " checked");
+
+       if ($_CONFIG['member_menu'] == 'Y') {
+               define('_CFG_MEMBER_MENU_ACTIVE', ' checked');
                define('_CFG_MEMBER_MENU_INACTIVE', "");
        } else {
                define('_CFG_MEMBER_MENU_ACTIVE', "");
-               define('_CFG_MEMBER_MENU_INACTIVE', " checked");
+               define('_CFG_MEMBER_MENU_INACTIVE', ' checked');
        }
-       if ($CONFIG['youre_here'] == 'Y') {
-               define('_CFG_YOURE_HERE_ACTIVE', " checked");
+
+       if ($_CONFIG['youre_here'] == 'Y') {
+               define('_CFG_YOURE_HERE_ACTIVE', ' checked');
                define('_CFG_YOURE_HERE_INACTIVE', "");
        } else {
                define('_CFG_YOURE_HERE_ACTIVE', "");
-               define('_CFG_YOURE_HERE_INACTIVE', " checked");
+               define('_CFG_YOURE_HERE_INACTIVE', ' checked');
        }
-       if ($CONFIG['show_timings'] == 'Y') {
-               define('_CFG_FOOTER_STATS_Y', " checked");
-               define('_CFG_FOOTER_STATS_N', "");
+
+       if ($_CONFIG['show_timings'] == 'Y') {
+               define('_CFG_SHOW_TIMINGS_Y', ' checked');
+               define('_CFG_SHOW_TIMINGS_N', "");
        } else {
-               define('_CFG_FOOTER_STATS_Y', "");
-               define('_CFG_FOOTER_STATS_N', " checked");
+               define('_CFG_SHOW_TIMINGS_Y', "");
+               define('_CFG_SHOW_TIMINGS_N', ' checked');
        }
 
-       for ($i = 0; $i <= 5; $i++)
-       {
+       if ($_CONFIG['mailid_error_redirect'] == 'index') {
+               define('_CFG_MAILID_REDIRECT_INDEX', ' checked');
+               define('_CFG_MAILID_REDIRECT_REJECT', "");
+       } else {
+               define('_CFG_MAILID_REDIRECT_INDEX', "");
+               define('_CFG_MAILID_REDIRECT_REJECT', ' checked');
+       }
+
+       for ($i = 0; $i <= 5; $i++) {
                $eval = "define('_COMMA_DEF_".$i."', \"\");";
-               if ($CONFIG['max_comma'] == $i) $eval = "define('_COMMA_DEF_".$i."', \" selected\");";
+               if ($_CONFIG['max_comma'] == $i) $eval = "define('_COMMA_DEF_".$i."', \" selected\");";
                eval($eval);
        }
 
        // Load template
        LOAD_TEMPLATE("admin_config_other");
 }
-CLOSE_TABLE();
+
 //
 ?>