mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Fire new OnAdminPage event only if user has been logged in
This commit is contained in:
@@ -384,6 +384,7 @@ class AdminPlugin extends Plugin
|
||||
$page = new Page;
|
||||
$page->expires(0);
|
||||
|
||||
if ($this->grav['user']->authorize('admin.login')) {
|
||||
$event = new Event(['page' => $page]);
|
||||
$event = $this->grav->fireEvent('onAdminPage', $event);
|
||||
$page = $event['page'];
|
||||
@@ -391,6 +392,7 @@ class AdminPlugin extends Plugin
|
||||
if ($page->slug()) {
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
|
||||
// Look in the pages provided by the Admin plugin itself
|
||||
if (file_exists(__DIR__ . "/pages/admin/{$self->template}.md")) {
|
||||
|
||||
Reference in New Issue
Block a user