mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 02:46:04 +01:00
use User::load to create user object [fixes #27]
This commit is contained in:
@@ -136,9 +136,8 @@ class Admin
|
||||
public function authenticate($form)
|
||||
{
|
||||
if (!$this->user->authenticated && isset($form['username']) && isset($form['password'])) {
|
||||
$file = CompiledYamlFile::instance($this->grav['locator']->findResource('account://' . $form['username'] . YAML_EXT));
|
||||
if ($file->exists()) {
|
||||
$user = new User($file->content());
|
||||
$user = User::load($form['username']);
|
||||
if ($user->exists()) {
|
||||
$user->authenticated = true;
|
||||
|
||||
// Authenticate user.
|
||||
|
||||
Reference in New Issue
Block a user