************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
// Was the form submitted?
-if (isset($_POST['ok'])) {
+if (IS_FORM_SENT()) {
// Replace german decimal comma with computer decimal dot
- if (isset($_POST['surfbar_static_reward'])) $_POST['surfbar_static_reward'] = str_replace(",", ".", $_POST['surfbar_static_reward']);
- if (isset($_POST['surfbar_static_costs'])) $_POST['surfbar_static_costs'] = str_replace(",", ".", $_POST['surfbar_static_costs']);
- if (isset($_POST['surfbar_dynamic_percent'])) $_POST['surfbar_dynamic_percent'] = str_replace(",", ".", $_POST['surfbar_dynamic_percent']);
+ if (REQUEST_ISSET_POST(('surfbar_static_reward'))) REQUEST_SET_POST('surfbar_static_reward' , REVERT_COMMA(REQUEST_POST('surfbar_static_reward')));
+ if (REQUEST_ISSET_POST(('surfbar_static_costs'))) REQUEST_SET_POST('surfbar_static_costs' , REVERT_COMMA(REQUEST_POST('surfbar_static_costs')));
+ if (REQUEST_ISSET_POST(('surfbar_dynamic_percent'))) REQUEST_SET_POST('surfbar_dynamic_percent', REVERT_COMMA(REQUEST_POST('surfbar_dynamic_percent')));
// Save settings
- ADMIN_SAVE_SETTINGS($_POST);
+ ADMIN_SAVE_SETTINGS_POST();
} else {
// Prepare content
$content = array(
- 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
- 'surfbar_static_costs' => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']),
- // @TODO Rewrite this to tiny selection boxes
- 'surfbar_static_time' => $_CONFIG['surfbar_static_time'],
- // @TODO Rewrite this to tiny selection boxes
- 'surfbar_restart_time' => $_CONFIG['surfbar_restart_time'],
- 'surfbar_static_lock' => $_CONFIG['surfbar_static_lock'],
- 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
- 'surfbar_max_order' => $_CONFIG['surfbar_max_order'],
- // @TODO Rewrite this to tiny selection boxes
- 'surfbar_stats_reload' => $_CONFIG['surfbar_stats_reload'],
- // @TODO Rewrite this to tiny selection boxes
- 'surfbar_purge_deleted' => $_CONFIG['surfbar_purge_deleted'],
- // @TODO Rewrite this to tiny selection boxes
- 'surfbar_purge_migrated' => $_CONFIG['surfbar_purge_migrated'],
- 'surfbar_pause_url' => $_CONFIG['surfbar_pause_url'],
- 'surfbar_warn_low_points' => $_CONFIG['surfbar_warn_low_points'],
- // @TODO Rewrite this to tiny selection boxes
- 'surfbar_low_interval' => $_CONFIG['surfbar_low_interval'],
+ 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
+ 'surfbar_static_costs' => TRANSLATE_COMMA(getConfig('surfbar_static_costs')),
+ 'surfbar_static_time' => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_time') , "surfbar_static_time" , "ms" , "left"),
+ 'surfbar_static_lock' => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_lock') , "surfbar_static_lock" , "hm" , "left"),
+ 'surfbar_restart_time' => CREATE_TIME_SELECTIONS(getConfig('surfbar_restart_time') , "surfbar_restart_time" , "ms" , "left"),
+ 'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')),
+ 'surfbar_max_order' => getConfig('surfbar_max_order'),
+ 'surfbar_stats_reload' => CREATE_TIME_SELECTIONS(getConfig('surfbar_stats_reload') , "surfbar_stats_reload" , "ms" , "left"),
+ 'surfbar_purge_deleted' => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_deleted') , "surfbar_purge_deleted" , "WDh", "left"),
+ 'surfbar_purge_migrated' => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_migrated'), "surfbar_purge_migrated", "WDh", "left"),
+ 'surfbar_pause_url' => getConfig('surfbar_pause_url'),
+ 'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'),
+ 'surfbar_low_interval' => CREATE_TIME_SELECTIONS(getConfig('surfbar_low_interval') , "surfbar_low_interval" , "WDh", "left"),
);
// Prepare payment model for template
- if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
+ if (getConfig('surfbar_pay_model') == "STATIC") {
// Static model
define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\"");
define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', "");
}
// Prepare auto-sart
- if ($_CONFIG['surfbar_autostart'] == "Y") {
+ if (getConfig('surfbar_autostart') == "Y") {
// Yes selected
define('__CONFIG_SURFBAR_AUTOSTART_Y', " checked=\"checked\"");
define('__CONFIG_SURFBAR_AUTOSTART_N', "");
}
// Prepare notify limits
- if ($_CONFIG['surfbar_notify_limits'] == "Y") {
+ if (getConfig('surfbar_notify_limits') == "Y") {
// Yes selected
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', " checked=\"checked\"");
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', "");
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', " checked=\"checked\"");
}
+ // Prepare notify admin about unlocked emails
+ if (getConfig('surfbar_notify_admin_unlock') == "Y") {
+ // Yes selected
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', " checked=\"checked\"");
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', "");
+ } else {
+ // No selected
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', "");
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\"");
+ }
+
// Prepare order migration
- if ($_CONFIG['surfbar_migrate_order'] == "Y") {
+ if (getConfig('surfbar_migrate_order') == "Y") {
// Yes selected
define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', " checked=\"checked\"");
define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', "");
}
// Pause URL mode
- if ($_CONFIG['surfbar_pause_mode'] == "INTERNAL") {
+ if (getConfig('surfbar_pause_mode') == "INTERNAL") {
// Internal pause page
define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', " checked=\"checked\"");
define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "");
}
// Notification mode
- if ($_CONFIG['surfbar_notification_mode'] == "INSTANT") {
+ if (getConfig('surfbar_notification_mode') == "INSTANT") {
// Instant notification
define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', " selected=\"selected\"");
define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET' , "");