X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=26187489f3450b0c4264429c305456d912a4af33;hp=2ad98e13dab1434b5319428a77be691e02c36272;hb=6809d445c472e918ac3bf8a6cb0914b3a996764d;hpb=9f6c30cc0e06098171d773d671292081ecee3d29 diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 2ad98e13da..26187489f3 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -727,9 +727,12 @@ function getUserData ($column) { } // Geter for whole user data array -function gerUserDataArray () { +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 @@ -749,6 +752,10 @@ function setCurrentUserId ($userid) { // 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']; }