// Geter for whole user data array
function getUserDataArray () {
+ // Get user id
+ $uid = getCurrentUserId();
+
// User id should not be zero
- if (getCurrentUserId() < 1) debug_report_bug(__FUNCTION__.': User id is zero.');
+ if ($uid < 1) debug_report_bug(__FUNCTION__.': User id is zero.');
- // Get the whole array
- return $GLOBALS['user_data'][getCurrentUserId()];
+ // Get the whole array if found
+ if (isset($GLOBALS['user_data'][$uid])) {
+ // Found, so return it
+ return $GLOBALS['user_data'][$uid];
+ } else {
+ // Return empty array
+ return array();
+ }
}
// Checks if the user data is valid, this may indicate that the user has logged