}
break;
- case 'pass1':
+ case 'password1':
$k = ''; $v = '';
break;
- case 'pass2':
+ case 'password2':
$k = 'password'; $v = md5($v);
break;
// Unsecure data which we don't want
$UNSAFE = array('password', 'id', 'remote_addr', 'sponsor_created', 'last_online', 'status', 'ref_count',
'points_amount', 'points_used', 'refid', 'hash', 'last_payment', 'last_currency',
- 'pass_old', 'ok', 'pass1', 'pass2');
+ 'pass_old', 'ok', 'password1', 'password2');
// Set default message ("not saved")
$message = '{--SPONSOR_ACCOUNT_DATA_NOT_SAVED--}';
// Check for submitted passwords
- if ((!empty($postData['pass1'])) && (!empty($postData['pass2']))) {
+ if ((!empty($postData['password1'])) && (!empty($postData['password2']))) {
// Are both passwords the same?
- if ($postData['pass1'] == $postData['pass2']) {
- // Okay, then set password and remove pass1 and pass2
- $postData['password'] = md5($postData['pass1']);
+ if ($postData['password1'] == $postData['password2']) {
+ // Okay, then set password and remove password1 and password2
+ $postData['password'] = md5($postData['password1']);
} // END - if
} // END - if
$content['surname'] = postRequestElement('surname');
$content['family'] = postRequestElement('family');
$content['timestamp'] = generateDateTime(time(), 0);
- $content['password'] = postRequestElement('pass1');
+ $content['password'] = postRequestElement('password1');
// Generate email and send it to the new sponsor
$message = loadEmailTemplate('sponsor_confirm', $content, $id);
setCurrentSponsorId($sponsor_id);
// Don't look for invalid sponsor_ids...
- if (!isValidUserId($sponsor_id)) {
+ if (!isValidId($sponsor_id)) {
// Invalid, so abort here
reportBug(__FUNCTION__, __LINE__, 'Sponsor id ' . $sponsor_id . ' is invalid.');
} elseif (isSponsorDataValid()) {
$data = '';
// Can we fetch the sponsor data?
- if ((isValidSponsorId($sponsor_id)) && (fetchSponsorData($sponsor_id, $keyColumn))) {
+ if ((isValidId($sponsor_id)) && (fetchSponsorData($sponsor_id, $keyColumn))) {
// Now get the data back
$data = getSponsorData($valueColumn);
} // END - if
// Checks if current sponsor_id is set
function isCurrentSponsorIdSet () {
- return ((isset($GLOBALS['current_sponsor_id'])) && (isValidSponsorId($GLOBALS['current_sponsor_id'])));
-}
-
-// Is given sponsor_id valid?
-function isValidSponsorId ($sponsor_id) {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__][$sponsor_id])) {
- // Check it out
- $GLOBALS[__FUNCTION__][$sponsor_id] = ((!is_null($sponsor_id)) && (!empty($sponsor_id)) && ($sponsor_id > 0));
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__][$sponsor_id];
+ return ((isset($GLOBALS['current_sponsor_id'])) && (isValidId($GLOBALS['current_sponsor_id'])));
}
// Getter for sponsor data
function getSponsorData ($column) {
// Sponsor id should not be zero
- if (!isValidUserId(getCurrentSponsorId())) {
+ if (!isValidId(getCurrentSponsorId())) {
reportBug(__FUNCTION__, __LINE__, 'Sponsor id is zero.');
} // END - if