$content = SQL_FETCHARRAY($result);
if ($content['status'] == "CONFIRMED") {
// Check if form was submitted or not
- if (!empty($_POST['ok'])) {
+ if (IS_FORM_SENT()) {
// Check passwords
- if (empty($_POST['pass_old'])) {
+ if (!REQUEST_ISSET_POST(('pass_old'))) {
// No current password entered
$MSG = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED');
- } elseif (md5($_POST['pass_old']) != get_session('sponsorpass')) {
+ } elseif (md5(REQUEST_POST('pass_old')) != get_session('sponsorpass')) {
// Entered password didn't match password in DB
$MSG = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB');
- } elseif ((!empty($_POST['pass1'])) && (!empty($_POST['pass2'])) && ($_POST['pass1'] != $_POST['pass2'])) {
+ } elseif ((REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
// Both new passwords did not match
$MSG = getMessage('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH');
- } elseif ((empty($_POST['pass1'])) && (!empty($_POST['pass2']))) {
+ } elseif ((!REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) {
// No password one entered
$MSG = getMessage('SPONSOR_PASSWORD_ONE_EMPTY');
- } elseif ((!empty($_POST['pass1'])) && (empty($_POST['pass2']))) {
+ } elseif ((REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass2')))) {
// No password two entered
$MSG = getMessage('SPONSOR_PASSWORD_TWO_EMPTY');
- } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < getConfig('pass_len'))) {
+ } elseif ((REQUEST_ISSET_POST(('pass1'))) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) {
// Too short password
$MSG = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len'));
} else {
$PASS_AND = ""; $PASS_DATA = "";
// Check if we want to change password or not
- if (($_POST['pass1'] == $_POST['pass2']) && (!empty($_POST['pass1'])) && ($_POST['pass1'] != $_POST['pass_old'])) {
+ if ((REQUEST_POST('pass1') == REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass_old'))) {
// Change current password
$PASS_AND = ", password='%s'";
- $PASS_DATA = md5($_POST['pass1']);
+ $PASS_DATA = md5(REQUEST_POST('pass1'));
}
// Unsecure data which we don't want here
// Remove all (maybe spoofed) unsafe data from array
foreach ($UNSAFE as $remove) {
- unset($_POST[$remove]);
+ REQUEST_UNSET_POST($remove);
}
// Set last change timestamp
- $_POST['last_change'] = time();
+ REQUEST_SET_POST('last_change', "UNIX_TIMESTAMP()");
// Save data
- $MSG = SPONSOR_SAVE_DATA($_POST, $content);
+ $MSG = SPONSOR_SAVE_DATA(REQUEST_POST_ARRAY(), $content);
}
if (!empty($MSG)) {