From: Roland Häder <roland@mxchange.org>
Date: Wed, 4 Nov 2009 09:19:46 +0000 (+0000)
Subject: Fixes for login
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1c6f1e3a075bb30911a3ac6cf6f90c9125261ec5;p=mailer.git

Fixes for login
---

diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index 9c0e40109c..e379a695a5 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -634,6 +634,9 @@ function isMember () {
 
 // Fetch user data for given user id
 function fetchUserData ($userid, $column='userid') {
+	// Set it here
+	setCurrentUserId($userid);
+
 	// Don't look for invalid userids...
 	if ($userid < 1) {
 		// Invalid, so abort here
diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php
index 9d61c0cf94..26187489f3 100644
--- a/inc/wrapper-functions.php
+++ b/inc/wrapper-functions.php
@@ -752,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'];
 }