setCurrentSponsorId($sponsor_id);
// Don't look for invalid sponsor_ids...
- if ($sponsor_id < 1) {
+ if (!isValidUserId($sponsor_id)) {
// Invalid, so abort here
debug_report_bug(__FUNCTION__, __LINE__, 'Sponsor id ' . $sponsor_id . ' is invalid.');
} elseif (isSponsorDataValid()) {
// Getter for sponsor data
function getSponsorData ($column) {
// Sponsor id should not be zero
- if (getCurrentSponsorId() < 1) debug_report_bug(__FUNCTION__, __LINE__, 'Sponsor id is zero.');
+ if (!isValidUserId(getCurrentSponsorId())) {
+ debug_report_bug(__FUNCTION__, __LINE__, 'Sponsor id is zero.');
+ } // END - if
// Return the value
return $GLOBALS['sponsor_data'][getCurrentSponsorId()][$column];
setCurrentUserId($userid);
// Don't look for invalid userids...
- if ($userid < 1) {
+ if (!isValidUserId($userid)) {
// Invalid, so abort here
debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $userid . ' is invalid.');
} elseif (isUserDataValid()) {
// Init user data array
function initUserData () {
// User id should not be zero
- if (getCurrentUserId() < 1) debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ if (!isValidUserId(getCurrentUserId())) {
+ // Should be always valid
+ debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ } // END - if
// Init the user
$GLOBALS['user_data'][getCurrentUserId()] = array();
// Getter for user data
function getUserData ($column) {
// User id should not be zero
- if (getCurrentUserId() < 1) debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ if (!isValidUserId(getCurrentUserId())) {
+ // Should be always valid
+ debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ } // END - if
// Return the value
return $GLOBALS['user_data'][getCurrentUserId()][$column];
// Geter for whole user data array
function getUserDataArray () {
// Get user id
- $uid = getCurrentUserId();
+ $userid = getCurrentUserId();
// Is the current userid valid?
- if (!isValidUserId($uid)) {
+ if (!isValidUserId($userid)) {
// Should be always valid
- debug_report_bug(__FUNCTION__, __LINE__, 'User id is zero.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'User id is invalid.');
} // END - if
// Get the whole array if found
- if (isset($GLOBALS['user_data'][$uid])) {
+ if (isset($GLOBALS['user_data'][$userid])) {
// Found, so return it
- return $GLOBALS['user_data'][$uid];
+ return $GLOBALS['user_data'][$userid];
} else {
// Return empty array
return array();