If user not logged in redirect to base path (#445)

Solved problem when  user not logged in can go to admin/something and view admin dashboard with Error 404.
This commit is contained in:
Oscar Recio
2016-04-21 15:08:37 +02:00
committed by Flavio Copes
parent 2cc07fe883
commit b180e13e8e

View File

@@ -374,6 +374,7 @@ class AdminPlugin extends Plugin
};
if (empty($this->grav['page'])) {
if($this->session->user->count()){
$event = $this->grav->fireEvent('onPageNotFound');
if (isset($event->page)) {
@@ -382,6 +383,9 @@ class AdminPlugin extends Plugin
} else {
throw new \RuntimeException('Page Not Found', 404);
}
}else{
$this->grav->redirect($this->base);
}
}
// Explicitly set a timestamp on assets