diff options
author | Malf Furious <m@lfurio.us> | 2016-03-26 23:56:38 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-03-26 23:56:38 -0400 |
commit | 85cead8ab00b13abaa7f729052792fc845756857 (patch) | |
tree | 4cb0bf7e68285037e799e7bb6a3c137f50a2363b /app | |
parent | 62cdc987190be53909df29dbb3a3b44c6fbc51f0 (diff) | |
download | scrott-85cead8ab00b13abaa7f729052792fc845756857.tar.gz scrott-85cead8ab00b13abaa7f729052792fc845756857.zip |
Fix bug in Framework::getCurrentUser() function
If, by some means, the GUID for a logged in user is not valid, that session should be terminated ("$this->setCurrentUser();")
This might happen if the database gets flushed, or if an account gets removed while it is in use...
Diffstat (limited to 'app')
-rw-r--r-- | app/class/framework.class.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/class/framework.class.php b/app/class/framework.class.php index 74c4b14..4223d68 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -57,7 +57,14 @@ abstract class Framework function getCurrentUser() { if (isset($_SESSION['userguid'])) - return new User($_SESSION['userguid']); + { + $user = new User($_SESSION['userguid']); + + if ($user->type == "user") + return $user; + + $this->setCurrentUser(); + } return false; } |