parent
1d55ae11b2
commit
a92585fcb8
8 changed files with 29 additions and 26 deletions
|
|
@ -29,15 +29,15 @@ class Application extends b8\Application
|
|||
|
||||
// Inlined as a closure to fix "using $this when not in object context" on 5.3
|
||||
$validateSession = function () {
|
||||
if (!empty($_SESSION['user_id'])) {
|
||||
$user = b8\Store\Factory::getStore('User')->getByPrimaryKey($_SESSION['user_id']);
|
||||
if (!empty($_SESSION['phpci_user_id'])) {
|
||||
$user = b8\Store\Factory::getStore('User')->getByPrimaryKey($_SESSION['phpci_user_id']);
|
||||
|
||||
if ($user) {
|
||||
$_SESSION['user'] = $user;
|
||||
$_SESSION['phpci_user'] = $user;
|
||||
return true;
|
||||
}
|
||||
|
||||
unset($_SESSION['user_id']);
|
||||
unset($_SESSION['phpci_user_id']);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -52,7 +52,7 @@ class Application extends b8\Application
|
|||
$response->setResponseCode(401);
|
||||
$response->setContent('');
|
||||
} else {
|
||||
$_SESSION['login_redirect'] = substr($request->getPath(), 1);
|
||||
$_SESSION['phpci_login_redirect'] = substr($request->getPath(), 1);
|
||||
$response = new RedirectResponse($response);
|
||||
$response->setHeader('Location', PHPCI_URL.'session/login');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue