mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-29 01:49:27 +00:00
Fix: method getAuthUID of the helper fhcauth_herpel.php, sometimes it
misses the uid
This commit is contained in:
@@ -65,16 +65,30 @@ function getAuthUID()
|
||||
|
||||
// If uid hasn't never been set and is present in CI session
|
||||
if ($uid === false && isset($ci->session->uid))
|
||||
{
|
||||
$uid = $ci->session->uid;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try to check if uid is stored elsewhere
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
$uid = $_SERVER['PHP_AUTH_USER'];
|
||||
}
|
||||
else if (isset($_SESSION['uid']))
|
||||
{
|
||||
$uid = $_SESSION['uid'];
|
||||
}
|
||||
// Workaround for a strange behavior
|
||||
// Sometimes $_SERVER['PHP_AUTH_USER'] is not set here, but is set when
|
||||
// used by authentication object
|
||||
else
|
||||
{
|
||||
$auth = new authentication();
|
||||
$uid = $auth->getUser();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If uid is set and uid in CI session is not set
|
||||
if ($uid !== false && !isset($ci->session->uid))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user