mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 10:06:12 +02:00
Fixed admin not detecting any existing users when Flex users are being used
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* Fixed admin cache to detect moved and deleted pages
|
||||
* Fixed avatar URLs with `?` in them being broken
|
||||
* Fixed issue saving page with language that was not exactly `2` or `5` chars long [#1667](https://github.com/getgrav/grav-plugin-admin/issues/1667)
|
||||
* Fixed admin not detecting any existing users when Flex users are being used
|
||||
|
||||
# v1.9.3
|
||||
## 04/22/2019
|
||||
|
||||
@@ -480,11 +480,16 @@ class Admin
|
||||
*/
|
||||
public static function doAnyUsersExist()
|
||||
{
|
||||
// check for existence of a user account
|
||||
$accounts = Grav::instance()['accounts'] ?? null;
|
||||
if ($accounts instanceof \Countable) {
|
||||
return $accounts->count() > 0;
|
||||
}
|
||||
|
||||
// TODO: remove old way to check for existence of a user account (Grav < v1.6.9)
|
||||
$account_dir = $file_path = Grav::instance()['locator']->findResource('account://');
|
||||
$user_check = glob($account_dir . '/*.yaml');
|
||||
|
||||
return $user_check ? true : false;
|
||||
return $user_check;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user