Fixed admin not detecting any existing users when Flex users are being used

This commit is contained in:
Matias Griese
2019-05-02 14:13:52 +03:00
parent 3c471ba864
commit 474571f2eb
2 changed files with 8 additions and 2 deletions

View File

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

View File

@@ -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;
}
/**