mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Improve admin user
This commit is contained in:
@@ -147,8 +147,10 @@ class Admin
|
||||
if ($flex && !$user instanceof FlexObjectInterface) {
|
||||
$managed = !method_exists($flex, 'isManaged') || $flex->isManaged('user-accounts');
|
||||
$directory = $managed ? $flex->getDirectory('user-accounts') : null;
|
||||
|
||||
// Convert old user to Flex User.
|
||||
/** @var UserObject|null $test */
|
||||
$test = $directory ? $directory->getObject($user->username) : null;
|
||||
$test = $directory ? $directory->createObject($user->toArray(), $user->username) : null;
|
||||
if ($test) {
|
||||
$test->authenticated = $user->authenticated;
|
||||
$test->authorized = $user->authorized;
|
||||
|
||||
Reference in New Issue
Block a user