mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-29 01:06:38 +01:00
Use $grav['accounts'] instead of $grav['users']
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
1. [](#improved)
|
||||
* Improved the UI for the Parent Page Route dropdown when adding a new Page / Folder
|
||||
* Use `$grav['accounts']` instead of `$grav['users']`
|
||||
1. [](#bugfix)
|
||||
* Fixed user edit links if Flex Objects plugin is installed but user isn't Flex User
|
||||
* Fixed deprecated `sameas()` Twig test
|
||||
|
||||
@@ -300,7 +300,7 @@ class AdminPlugin extends Plugin
|
||||
$data['access'] = ['admin' => ['login' => true, 'super' => true], 'site' => ['login' => true]];
|
||||
|
||||
/** @var UserCollectionInterface $users */
|
||||
$users = $this->grav['users'];
|
||||
$users = $this->grav['accounts'];
|
||||
|
||||
// Create user object and save it
|
||||
$user = $users->load($username);
|
||||
|
||||
@@ -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