Removed unnecessary cache file check.. no real performance difference

This commit is contained in:
Andy Miller
2015-12-10 16:14:13 -07:00
parent 7b5117ed64
commit 72cd1099cd

View File

@@ -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.