Logout is one step now

This commit is contained in:
Andy Miller
2017-12-01 16:08:52 -07:00
parent dcea3f9889
commit 1b97769ea5
7 changed files with 19 additions and 36 deletions

View File

@@ -691,10 +691,12 @@ class AdminController extends AdminBaseController
*/
protected function taskLogout()
{
$language = $this->grav['user']->authenticated ? $this->grav['user']->language : ($this->grav['language']->getLanguage() ?: 'en');
$message = $this->admin->translate('PLUGIN_ADMIN.LOGGED_OUT');
$this->admin->session()->invalidate()->start();
$this->setRedirect('/logout/lang:' . $language);
$this->grav['session']->setFlashCookieObject(Admin::TMP_COOKIE_NAME, ['message' => $message, 'status' => 'info']);
$this->setRedirect('/');
return true;
}