mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Use $grav['accounts'] instead of $grav['users']
This commit is contained in:
@@ -652,7 +652,7 @@ class Admin
|
||||
$data[$type] = $obj;
|
||||
} elseif (preg_match('|users/|', $type)) {
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $this->grav['users'];
|
||||
$users = $this->grav['accounts'];
|
||||
|
||||
$obj = $users->load(preg_replace('|users/|', '', $type));
|
||||
$obj->update($this->cleanUserPost($post));
|
||||
@@ -660,7 +660,7 @@ class Admin
|
||||
$data[$type] = $obj;
|
||||
} elseif (preg_match('|user/|', $type)) {
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $this->grav['users'];
|
||||
$users = $this->grav['accounts'];
|
||||
|
||||
$obj = $users->load(preg_replace('|user/|', '', $type));
|
||||
$obj->update($this->cleanUserPost($post));
|
||||
|
||||
@@ -147,7 +147,7 @@ class AdminController extends AdminBaseController
|
||||
|
||||
if (isset($data['password'])) {
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $this->grav['users'];
|
||||
$users = $this->grav['accounts'];
|
||||
|
||||
$username = isset($data['username']) ? strip_tags(strtolower($data['username'])) : null;
|
||||
$user = $username ? $users->load($username) : null;
|
||||
@@ -217,7 +217,7 @@ class AdminController extends AdminBaseController
|
||||
$login = $this->grav['login'];
|
||||
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $this->grav['users'];
|
||||
$users = $this->grav['accounts'];
|
||||
|
||||
$username = isset($data['username']) ? strip_tags(strtolower($data['username'])) : '';
|
||||
$user = !empty($username) ? $users->load($username) : null;
|
||||
@@ -685,7 +685,7 @@ class AdminController extends AdminBaseController
|
||||
if ($this->view === 'user') {
|
||||
if ($obj->username === $this->grav['user']->username) {
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $this->grav['users'];
|
||||
$users = $this->grav['accounts'];
|
||||
|
||||
//Editing current user. Reload user object
|
||||
unset($this->grav['user']->avatar);
|
||||
|
||||
@@ -25,7 +25,7 @@ class Utils
|
||||
$grav = Grav::instance();
|
||||
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $grav['users'];
|
||||
$users = $grav['accounts'];
|
||||
|
||||
return $users->find($email, ['email']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user