diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-11-05 15:45:58 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-11-05 15:45:58 +0100 |
commit | 1eefc21329e1256989fc50a5fe7597989324e47f (patch) | |
tree | 9cfcf96f01686c51c3d2337384cff7c6a09bfea4 /lib/private/user | |
parent | f0d6a47a67b87c544d44ecacf2ba2e9a36659053 (diff) | |
download | nextcloud-server-1eefc21329e1256989fc50a5fe7597989324e47f.tar.gz nextcloud-server-1eefc21329e1256989fc50a5fe7597989324e47f.zip |
Remove confusingly names \OC\User\Manager::delete and fix the automatic cache cleanup instead
Diffstat (limited to 'lib/private/user')
-rw-r--r-- | lib/private/user/manager.php | 24 |
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 |