summaryrefslogtreecommitdiffstats
path: root/lib/private/user/manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/user/manager.php')
-rw-r--r--lib/private/user/manager.php24
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php
index 5c155c27aba..4d1612a35ce 100644
--- a/lib/private/user/manager.php
+++ b/lib/private/user/manager.php
@@ -46,17 +46,17 @@ class Manager extends PublicEmitter implements IUserManager {
*/
public function __construct($config = null) {
$this->config = $config;
- $cachedUsers = $this->cachedUsers;
+ $cachedUsers = &$this->cachedUsers;
$this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) {
- $i = array_search($user, $cachedUsers);
- if ($i !== false) {
- unset($cachedUsers[$i]);
- }
+ /** @var \OC\User\User $user */
+ unset($cachedUsers[$user->getUID()]);
});
$this->listen('\OC\User', 'postLogin', function ($user) {
+ /** @var \OC\User\User $user */
$user->updateLastLoginTimestamp();
});
$this->listen('\OC\User', 'postRememberedLogin', function ($user) {
+ /** @var \OC\User\User $user */
$user->updateLastLoginTimestamp();
});
}
@@ -135,20 +135,6 @@ class Manager extends PublicEmitter implements IUserManager {
}
/**
- * remove deleted user from cache
- *
- * @param string $uid
- * @return bool
- */
- public function delete($uid) {
- if (isset($this->cachedUsers[$uid])) {
- unset($this->cachedUsers[$uid]);
- return true;
- }
- return false;
- }
-
- /**
* Check if the password is valid for the user
*
* @param string $loginname