Updating session variables to add phpci_ prefix.

Fixes #652
This commit is contained in:
Dan Cryer 2014-12-01 15:56:33 +00:00
commit a92585fcb8
8 changed files with 29 additions and 26 deletions

View file

@ -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');
}