]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Fixes for rallye, thanks to WernisMan
[mailer.git] / inc / wrapper-functions.php
index 2ad98e13dab1434b5319428a77be691e02c36272..26187489f3450b0c4264429c305456d912a4af33 100644 (file)
@@ -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'];
 }