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

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