Security line in all includes changed
[mailer.git] / inc / modules / admin / what-config_doubler.php
index e835bbd..04355fd 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!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__));
 
-if (isset($_POST['ok']))
-{
+if (isset($_POST['ok'])) {
        // Replace commata with decimal dot
        $_POST['doubler_charge'] = str_replace(",", ".", ($_POST['doubler_charge'] / 100));
        $_POST['doubler_ref']    = str_replace(",", ".", ($_POST['doubler_ref'] / 100));
@@ -51,9 +50,7 @@ if (isset($_POST['ok']))
 
        // Save settings
        ADMIN_SAVE_SETTINGS($_POST);
-}
- else
-{
+} else {
        // Prepare data for the template
        // - Charge rate
        define('__DOUBLER_CHARGE', TRANSLATE_COMMA(($_CONFIG['doubler_charge'] * 100), false));
@@ -74,13 +71,13 @@ if (isset($_POST['ok']))
        switch ($_CONFIG['doubler_jackpot'])
        {
        case 'Y':
-               define('__DOUBLER_JACKPOT_Y', " checked");
+               define('__DOUBLER_JACKPOT_Y', ' checked');
                define('__DOUBLER_JACKPOT_N', "");
                break;
 
        case 'N':
                define('__DOUBLER_JACKPOT_Y', "");
-               define('__DOUBLER_JACKPOT_N', " checked");
+               define('__DOUBLER_JACKPOT_N', ' checked');
                break;
        }
 
@@ -88,13 +85,13 @@ if (isset($_POST['ok']))
        switch ($_CONFIG['doubler_own'])
        {
        case 'Y':
-               define('__DOUBLER_OWN_Y', " checked");
+               define('__DOUBLER_OWN_Y', ' checked');
                define('__DOUBLER_OWN_N', "");
                break;
 
        case 'N':
                define('__DOUBLER_OWN_Y', "");
-               define('__DOUBLER_OWN_N', " checked");
+               define('__DOUBLER_OWN_N', ' checked');
                break;
        }
 
@@ -102,13 +99,13 @@ if (isset($_POST['ok']))
        switch ($_CONFIG['doubler_send_mode'])
        {
        case "DIRECT":
-               define('__DOUBLER_SEND_DIRECT', " checked");
+               define('__DOUBLER_SEND_DIRECT', ' checked');
                define('__DOUBLER_SEND_RESET' , "");
                break;
 
        case "RESET":
                define('__DOUBLER_SEND_DIRECT', "");
-               define('__DOUBLER_SEND_RESET' , " checked");
+               define('__DOUBLER_SEND_RESET' , ' checked');
                break;
        }
 
@@ -116,18 +113,18 @@ if (isset($_POST['ok']))
        switch ($_CONFIG['doubler_sent_all'])
        {
        case 'Y':
-               define('__DOUBLER_SENT_ALL_Y', " checked");
+               define('__DOUBLER_SENT_ALL_Y', ' checked');
                define('__DOUBLER_SENT_ALL_N', "");
                break;
 
        case 'N':
                define('__DOUBLER_SENT_ALL_Y', "");
-               define('__DOUBLER_SENT_ALL_N', " checked");
+               define('__DOUBLER_SENT_ALL_N', ' checked');
                break;
        }
 
        // Transfer options (!!!) to __MEMBER_SELECTION
-       ADD_MEMBER_SELECTION_BOX(false, true, true, $_CONFIG['doubler_uid']);
+       ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true);
 
        // Number of rows to display (option lines!!!)
        define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_new']));