]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/sponsor/account.php
Global removed on many places, rewritten to use incrementConfigEntry()
[mailer.git] / inc / modules / sponsor / account.php
index f9912e53d9788a4bd9b1d9d1496cbd3511ba9a4d..c402de5dbd94d50ab0b6823a01634459cc643e91 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
+} elseif ((!EXT_IS_ACTIVE("sponsor"))
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 } elseif (!IS_SPONSOR()) {
@@ -73,9 +73,9 @@ if (SQL_NUMROWS($result) == 1) {
                        } elseif ((!empty($_POST['pass1'])) && (empty($_POST['pass2']))) {
                                // No password two entered
                                $MSG = SPONSOR_PASSWORD_TWO_EMPTY;
-                       } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < $CONFIG['pass_len'])) {
+                       } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < getConfig('pass_len'))) {
                                // Too short password
-                               $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.$CONFIG['pass_len'].SPONSOR_PASSWORD_TOO_SHORT_2;
+                               $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.getConfig('pass_len').SPONSOR_PASSWORD_TOO_SHORT_2;
                        } else {
                                // Default is we don't want to change password!
                                $PASS_AND = ""; $PASS_DATA = "";
@@ -88,7 +88,7 @@ if (SQL_NUMROWS($result) == 1) {
                                }
 
                                // Unsecure data which we don't want here
-                               $UNSAFE = array('receive_warnings', 'warning_interval');
+                                       $UNSAFE = array('receive_warnings', 'warning_interval');
 
                                // Remove all (maybe spoofed) unsafe data from array
                                foreach ($UNSAFE as $remove) {
@@ -114,21 +114,21 @@ if (SQL_NUMROWS($result) == 1) {
                        switch ($content['gender'])
                        {
                        case "M": // Male
-                               define('__GENDER_M', " selected");
+                               define('__GENDER_M', " selected=\"selected\"");
                                define('__GENDER_F', "");
                                define('__GENDER_C', "");
                                break;
 
                        case "F": // Female
                                define('__GENDER_M', "");
-                               define('__GENDER_F', " selected");
+                               define('__GENDER_F', " selected=\"selected\"");
                                define('__GENDER_C', "");
                                break;
 
                        case "C": // Company
                                define('__GENDER_M', "");
                                define('__GENDER_F', "");
-                               define('__GENDER_C', " selected");
+                               define('__GENDER_C', " selected=\"selected\"");
                                break;
                        }