<?php
/************************************************************************
- * MXChange v0.2.1 Start: 10/11/2003 *
- * =============== Last change: 09/21/2004 *
+ * Mailer v0.2.1-FINAL Start: 10/11/2003 *
+ * =================== Last change: 09/21/2004 *
* *
* -------------------------------------------------------------------- *
* File : what-config_other.php *
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-} elseif (!EXT_IS_ACTIVE("other")) {
- // Missing extension!
- addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "other");
- return;
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addYouAreHereLink('admin', __FILE__);
// Stop saving data if one input field is !isset
-if (IS_FORM_SENT()) {
+if (isFormSent('save_config')) {
// Calculate stamps and set calculated stamps
- 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()));
+ setPostRequestElement('online_timeout' , createEpocheTimeFromSelections('online_timeout' , postRequestArray()));
+ setPostRequestElement('url_tlock' , createEpocheTimeFromSelections('url_tlock' , postRequestArray()));
// Online-Timeout shall be > 0 or your database will crow and crow and crow...
- if (!REQUEST_ISSET_POST(('online_timeout'))) { REQUEST_UNSET_POST('ok'); }
+ if (!isPostRequestElementSet('online_timeout')) { unsetPostRequestElement('ok'); }
// Chedck other timestamps (which can be zero!)
- 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'); }
+ if (!isPostRequestElementSet('url_tlock')) { unsetPostRequestElement('ok'); }
// Check other settings
- 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 (!isPostRequestElementSet('max_send')) { unsetPostRequestElement('ok'); }
+ if (!isPostRequestElementSet('code_length')) { unsetPostRequestElement('ok'); }
+ if (!isPostRequestElementSet('reject_url')) { unsetPostRequestElement('ok'); }
+} // END - if
-if (IS_FORM_SENT()) {
+if (isFormSent('save_config')) {
// Update stamps directly
- ADMIN_SAVE_SETTINGS_POST();
+ adminSaveSettingsFromPostData();
} else {
- // 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_REJECT_URL' , getConfig('reject_url'));
- define('_CFG_MIN_AGE' , getConfig('min_age'));
-
// Time selection boxes
- define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('online_timeout'), "ip_timeout" , "ms"));
- define('_CFG_URL_TLOCK' , CREATE_TIME_SELECTIONS(getConfig('url_tlock') , "url_tlock" , "WDh"));
- define('_CFG_PROFILE_LOCK' , CREATE_TIME_SELECTIONS(getConfig('profile_lock') , "profile_lock" , "WDh"));
- 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') != "Y") {
- define('_CFG_ORDER_MULTI_N', " checked=\"checked\"");
- define('_CFG_ORDER_MULTI_Y', "");
- } else {
- define('_CFG_ORDER_MULTI_N', "");
- define('_CFG_ORDER_MULTI_Y', " checked=\"checked\"");
- }
-
- if (getConfig('autosend_active') != "Y") {
- define('_CFG_AUTOSEND_ACTIVE_N', " checked=\"checked\"");
- define('_CFG_AUTOSEND_ACTIVE_Y', "");
- } else {
- define('_CFG_AUTOSEND_ACTIVE_N', "");
- define('_CFG_AUTOSEND_ACTIVE_Y', " checked=\"checked\"");
- }
-
- if (getConfig('send_prof_update') != "Y") {
- define('_CFG_SEND_UPDATE_N', " checked=\"checked\"");
- define('_CFG_SEND_UPDATE_Y', "");
- } else {
- define('_CFG_SEND_UPDATE_N', "");
- define('_CFG_SEND_UPDATE_Y', " checked=\"checked\"");
- }
-
- if (getConfig('admin_notify') != "Y") {
- define('_CFG_ADMIN_NOTIFY_N', " checked=\"checked\"");
- define('_CFG_ADMIN_NOTIFY_Y', "");
- } else {
- define('_CFG_ADMIN_NOTIFY_N', "");
- define('_CFG_ADMIN_NOTIFY_Y', " checked=\"checked\"");
- }
-
- if (getConfig('css_php') == "DIRECT") {
- define('_CFG_CSS_PHP_DIRECT', " checked=\"checked\"");
- define('_CFG_CSS_PHP_FILE', "");
- } else {
- define('_CFG_CSS_PHP_DIRECT', "");
- define('_CFG_CSS_PHP_FILE', " checked=\"checked\"");
- }
-
- if (getConfig('guest_menu') == "Y") {
- define('_CFG_GUEST_MENU_ACTIVE', " checked=\"checked\"");
- define('_CFG_GUEST_MENU_INACTIVE', "");
- } else {
- define('_CFG_GUEST_MENU_ACTIVE', "");
- define('_CFG_GUEST_MENU_INACTIVE', " checked=\"checked\"");
- }
-
- if (getConfig('member_menu') == "Y") {
- define('_CFG_MEMBER_MENU_ACTIVE', " checked=\"checked\"");
- define('_CFG_MEMBER_MENU_INACTIVE', "");
- } else {
- define('_CFG_MEMBER_MENU_ACTIVE', "");
- define('_CFG_MEMBER_MENU_INACTIVE', " checked=\"checked\"");
- }
-
- if (getConfig('youre_here') == "Y") {
- define('_CFG_YOURE_HERE_ACTIVE', " checked=\"checked\"");
- define('_CFG_YOURE_HERE_INACTIVE', "");
- } else {
- define('_CFG_YOURE_HERE_ACTIVE', "");
- define('_CFG_YOURE_HERE_INACTIVE', " checked=\"checked\"");
- }
+ $content['online_timeout'] = createConfigurationTimeSelections('online_timeout' , 'ms');
+ $content['url_tlock'] = createConfigurationTimeSelections('url_tlock' , 'WDh');
- if (getConfig('show_timings') == "Y") {
- define('_CFG_SHOW_TIMINGS_Y', " checked=\"checked\"");
- define('_CFG_SHOW_TIMINGS_N', "");
- } else {
- define('_CFG_SHOW_TIMINGS_Y', "");
- define('_CFG_SHOW_TIMINGS_N', " checked=\"checked\"");
- }
+ // Prepare more
+ foreach (array('css_php_direct','css_php_file','css_php_inline','mailid_error_redirect_index','mailid_error_redirect_reject') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
- if (getConfig('show_points_unconfirmed') == "Y") {
- define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', " checked=\"checked\"");
- define('_CFG_SHOW_POINTS_UNCONFIRMED_N', "");
- } else {
- define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', "");
- define('_CFG_SHOW_POINTS_UNCONFIRMED_N', " checked=\"checked\"");
- }
+ for ($i = '0'; $i <= 5; $i++) {
+ $content['max_comma_' . $i] = '';
+ } // END - for
- if (getConfig('mailid_error_redirect') == 'INDEX') {
- define('_CFG_MAILID_REDIRECT_INDEX', " checked=\"checked\"");
- define('_CFG_MAILID_REDIRECT_REJECT', "");
- } else {
- define('_CFG_MAILID_REDIRECT_INDEX', "");
- define('_CFG_MAILID_REDIRECT_REJECT', " checked=\"checked\"");
- }
+ // Set selections
+ $content = merge_array($content, getCheckedConfig(array('css_php', 'mailid_error_redirect')));
- for ($i = 0; $i <= 5; $i++) {
- $eval = "define('_COMMA_DEF_".$i."', \"\");";
- if (getConfig('max_comma') == $i) $eval = "define('_COMMA_DEF_".$i."', ' selected=\"selected\"');";
- eval($eval);
- }
+ // Set selection
+ $content = merge_array($content, getSelectedConfig(array('max_comma')));
// Load template
- LOAD_TEMPLATE("admin_config_other");
+ loadTemplate('admin_config_other', FALSE, $content);
}
-//
+// [EOF]
?>