Fix bug 1963: Web UI throws warnings during previously open login session after user account is deleted
common_logged_in() returned bogus results because it checks against null specifically, but common_current_user() was sticking 'false' into $_cur because that's what User::staticGet() returned from a failed lookup. Now we skip over a failed lookup here, so we keep null and all is well.
This commit is contained in:
parent
f600fa3b1a
commit
7f8dbb8e45
|
@ -350,10 +350,13 @@ function common_current_user()
|
||||||
common_ensure_session();
|
common_ensure_session();
|
||||||
$id = isset($_SESSION['userid']) ? $_SESSION['userid'] : false;
|
$id = isset($_SESSION['userid']) ? $_SESSION['userid'] : false;
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$_cur = User::staticGet($id);
|
$user = User::staticGet($id);
|
||||||
|
if ($user) {
|
||||||
|
$_cur = $user;
|
||||||
return $_cur;
|
return $_cur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// that didn't work; try to remember; will init $_cur to null on failure
|
// that didn't work; try to remember; will init $_cur to null on failure
|
||||||
$_cur = common_remembered_user();
|
$_cur = common_remembered_user();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user