]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-mydata.php
Complete rewrite of and , wrapper functions added, see bug #101
[mailer.git] / inc / modules / member / what-mydata.php
index d742a4fbeeb3c9fa3d2d75d6a085e9797bdecbeb..419708c9a5a0caa06c3ce218eaa8c224785cc1af 100644 (file)
@@ -49,9 +49,9 @@ define('UID_VALUE', $GLOBALS['userid']); $URL = "";
 
 // Detect what the member wants to do
 $MODE = "show"; // Show his data
-if (!empty($_POST['save']))   $MODE = "save";   // Save entered data
-if (isset($_POST['edit']))   $MODE = "edit";   // Edit data
-if (!empty($_POST['notify'])) $MODE = "notify"; // Switch off notification
+if (REQUEST_ISSET_POST(('save')))   $MODE = "save";   // Save entered data
+if (REQUEST_ISSET_POST(('edit')))    $MODE = "edit";   // Edit data
+if (REQUEST_ISSET_POST(('notify'))) $MODE = "notify"; // Switch off notification
 
 switch ($MODE)
 {
@@ -194,13 +194,13 @@ case "save": // Save entered data
                $DATA[3] = MAKE_DATETIME($DATA[3] + getConfig('profile_lock'), "0");
                // You cannot change your account
                LOAD_TEMPLATE("member_mydata_locked");
-       } elseif (!VALIDATE_EMAIL($_POST['addy'])) {
+       } elseif (!VALIDATE_EMAIL(REQUEST_POST('addy'))) {
                // Invalid email address!
                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('INVALID_EMAIL_ADDRESS_ENTERED'));
        } else {
                // Generate hash
-               $hash = generateHash($_POST['pass1'], substr($DATA[1], 0, -40));
-               if ((($hash == $DATA[1]) || ($_POST['pass1'] == $_POST['pass2'])) && (!empty($_POST['pass1']))) {
+               $hash = generateHash(REQUEST_POST('pass1'), substr($DATA[1], 0, -40));
+               if ((($hash == $DATA[1]) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) && (REQUEST_ISSET_POST(('pass1')))) {
                        // Only on simple changes normal mode is active = no email or password changed
                        $MODE = "normal"; $AND = "";
 
@@ -208,10 +208,10 @@ case "save": // Save entered data
                        if ($hash != $DATA[1]) { $AND = ", password='".$hash."'"; $MODE = "pass"; }
 
                        // Or did he changed his password?
-                       if ($_POST['addy'] != $DATA[0]) {
+                       if (REQUEST_POST('addy') != $DATA[0]) {
                                // Jupp
                                if ($MODE == "normal") { $MODE = "email"; } else { $MODE .= ";email"; }
-                               $_POST['old_addy'] = $DATA[0];
+                               REQUEST_SET_POST('old_addy', $DATA[0]);
                        }
 
                        // Update member's profile
@@ -229,18 +229,18 @@ notified='N',
 last_profile_sent=UNIX_TIMESTAMP()
 WHERE userid=%s AND password='%s' LIMIT 1",
 array(
-       $_POST['gender'],
-       $_POST['surname'],
-       $_POST['family_name'],
-       $_POST['street_nr'],
-       bigintval($_POST['country_code']),
-       bigintval($_POST['zip']),
-       $_POST['city'],
-       $_POST['addy'],
-       bigintval($_POST['day']),
-       bigintval($_POST['month']),
-       bigintval($_POST['year']),
-       bigintval($_POST['max_mails']),
+       REQUEST_POST('gender'),
+       REQUEST_POST('surname'),
+       REQUEST_POST('family'),
+       REQUEST_POST('street_nr'),
+       bigintval(REQUEST_POST('country_code')),
+       bigintval(REQUEST_POST('zip')),
+       REQUEST_POST('city'),
+       REQUEST_POST('addy'),
+       bigintval(REQUEST_POST('day')),
+       bigintval(REQUEST_POST('month')),
+       bigintval(REQUEST_POST('year')),
+       bigintval(REQUEST_POST('max_mails')),
        UID_VALUE,
        get_session('u_hash')
  ), __FILE__, __LINE__);
@@ -258,18 +258,18 @@ notified='N',
 last_profile_sent=UNIX_TIMESTAMP()
 WHERE userid=%s AND password='%s' LIMIT 1",
 array(
-       $_POST['gender'],
-       $_POST['surname'],
-       $_POST['family_name'],
-       $_POST['street_nr'],
-       $_POST['cntry'],
-       bigintval($_POST['zip']),
-       $_POST['city'],
-       $_POST['addy'],
-       bigintval($_POST['day']),
-       bigintval($_POST['month']),
-       bigintval($_POST['year']),
-       bigintval($_POST['max_mails']),
+       REQUEST_POST('gender'),
+       REQUEST_POST('surname'),
+       REQUEST_POST('family'),
+       REQUEST_POST('street_nr'),
+       REQUEST_POST('cntry'),
+       bigintval(REQUEST_POST('zip')),
+       REQUEST_POST('city'),
+       REQUEST_POST('addy'),
+       bigintval(REQUEST_POST('day')),
+       bigintval(REQUEST_POST('month')),
+       bigintval(REQUEST_POST('year')),
+       bigintval(REQUEST_POST('max_mails')),
        UID_VALUE,
        get_session('u_hash')
  ), __FILE__, __LINE__);