mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Check for existence of a user account
This commit is contained in:
@@ -137,6 +137,13 @@ class AdminPlugin extends Plugin
|
||||
$this->session->expert = false;
|
||||
}
|
||||
|
||||
// check for existence of a user account
|
||||
$account_dir = $file_path = $this->grav['locator']->findResource('account://');
|
||||
$user_check = (array) glob($account_dir . '/*.yaml');
|
||||
if (!count($user_check) > 0) {
|
||||
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.NO_USER_ACCOUNTS'), 'info');
|
||||
}
|
||||
|
||||
/** @var Pages $pages */
|
||||
$pages = $this->grav['pages'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user