mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-07 13:55:55 +01:00
Removed unnecessary cache file check.. no real performance difference
This commit is contained in:
10
admin.php
10
admin.php
@@ -91,10 +91,6 @@ class AdminPlugin extends Plugin
|
|||||||
|
|
||||||
$this->base = '/' . trim($route, '/');
|
$this->base = '/' . trim($route, '/');
|
||||||
$this->uri = $this->grav['uri'];
|
$this->uri = $this->grav['uri'];
|
||||||
$register_check = CACHE_DIR . 'register-check-' . $this->grav['cache']->getKey();
|
|
||||||
|
|
||||||
// See if we have performed register check recently
|
|
||||||
if (!file_exists($register_check)) {
|
|
||||||
|
|
||||||
// check for existence of a user account
|
// check for existence of a user account
|
||||||
$account_dir = $file_path = $this->grav['locator']->findResource('account://');
|
$account_dir = $file_path = $this->grav['locator']->findResource('account://');
|
||||||
@@ -103,15 +99,9 @@ class AdminPlugin extends Plugin
|
|||||||
// If no users found, go to register
|
// If no users found, go to register
|
||||||
if (!count($user_check) > 0) {
|
if (!count($user_check) > 0) {
|
||||||
if (!$this->isAdminPath()) {
|
if (!$this->isAdminPath()) {
|
||||||
|
|
||||||
$this->grav->redirect($this->base);
|
$this->grav->redirect($this->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->template = 'register';
|
$this->template = 'register';
|
||||||
|
|
||||||
} else {
|
|
||||||
touch($register_check);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only activate admin if we're inside the admin path.
|
// Only activate admin if we're inside the admin path.
|
||||||
|
|||||||
Reference in New Issue
Block a user