// Geter for whole user data array
function getUserDataArray () {
+ // User id should not be zero
+ if (getCurrentUserId() == 0) debug_report_bug('User id is zero.');
+
// Get the whole array
- return $GLOBALS['user_data'];
+ return $GLOBALS['user_data'][getCurrentUserId()];
}
// Checks if the user data is valid, this may indicate that the user has logged
// Getter for current userid
function getCurrentUserId () {
+ // Return zero if not set
+ if (!isset($GLOBALS['current_userid'])) return 0;
+
+ // Return the userid
return $GLOBALS['current_userid'];
}