summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-11-06 13:52:25 +0100
committerLukas Reschke <lukas@owncloud.com>2014-11-06 13:52:25 +0100
commitf73d65303601574e1bcc68e0aa8ae8ef4853a118 (patch)
treebdeb0ba2133c3c434691f5575511e3ced69cc683 /lib/private
parentbb15028a00da22496fe3e0b5e1fe86a0fa9705b4 (diff)
parent1eefc21329e1256989fc50a5fe7597989324e47f (diff)
downloadnextcloud-server-f73d65303601574e1bcc68e0aa8ae8ef4853a118.tar.gz
nextcloud-server-f73d65303601574e1bcc68e0aa8ae8ef4853a118.zip
Merge pull request #11972 from owncloud/usermanager-remove-delete
Remove confusingly names \OC\User\Manager::delete and fix the automatic ...
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/user.php3
-rw-r--r--lib/private/user/manager.php24
2 files changed, 5 insertions, 22 deletions
diff --git a/lib/private/user.php b/lib/private/user.php
index 3c23c19b015..2358f4a14e4 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -211,9 +211,6 @@ class OC_User {
// Delete the users entry in the storage table
\OC\Files\Cache\Storage::remove('home::' . $uid);
-
- // Remove it from the Cache
- self::getManager()->delete($uid);
}
return true;
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