Uggg fixed admin redirect much more simply

This commit is contained in:
Andy Miller
2015-07-28 12:09:53 -06:00
parent c24060d834
commit 3f40858ccc
2 changed files with 3 additions and 22 deletions

View File

@@ -153,7 +153,8 @@ class Admin
/** @var Grav $grav */
$grav = $this->grav;
$redirect_route =$this->getLoginRedirect() ?: $this->uri->route();
// $redirect_route =$this->getLoginRedirect() ?: $this->uri->route();
$redirect_route = $this->uri->route();
$grav->redirect($redirect_route);
}
}
@@ -523,24 +524,4 @@ class Admin
return false;
}
}
public function setLoginRedirect()
{
$uri = $this->grav['uri'];
setcookie(LOGIN_REDIRECT_COOKIE, $uri->path(), time() + (86400 * 30), $this->grav['base_url_relative']);
}
public function getLoginRedirect()
{
if (isset($_COOKIE[LOGIN_REDIRECT_COOKIE])) {
$this->removeLoginRedirect();
return $_COOKIE[LOGIN_REDIRECT_COOKIE];
}
return false;
}
public function removeLoginRedirect()
{
return setcookie(LOGIN_REDIRECT_COOKIE, '', time() - 3600);
}
}