]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Fixes for last activity in mailid.php
[mailer.git] / inc / wrapper-functions.php
index aa7b6a0218667ddee3c6af8257d6c3e5232d826f..26187489f3450b0c4264429c305456d912a4af33 100644 (file)
@@ -728,8 +728,11 @@ function getUserData ($column) {
 
 // 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
@@ -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'];
 }