mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 20:05:53 +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)
|
public function authenticate($form)
|
||||||
{
|
{
|
||||||
if (!$this->user->authenticated && isset($form['username']) && isset($form['password'])) {
|
if (!$this->user->authenticated && isset($form['username']) && isset($form['password'])) {
|
||||||
$file = CompiledYamlFile::instance($this->grav['locator']->findResource('account://' . $form['username'] . YAML_EXT));
|
$user = User::load($form['username']);
|
||||||
if ($file->exists()) {
|
if ($user->exists()) {
|
||||||
$user = new User($file->content());
|
|
||||||
$user->authenticated = true;
|
$user->authenticated = true;
|
||||||
|
|
||||||
// Authenticate user.
|
// Authenticate user.
|
||||||
|
|||||||
Reference in New Issue
Block a user