diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2017-04-26 00:11:55 +0200 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2017-04-26 00:50:38 +0200 |
commit | 241e397326545ee3ecad1a6a50dbe7839faa5c21 (patch) | |
tree | 6d33b4e4cc22bb1bf4753d83f44e1bb8422082e3 /lib/private | |
parent | 0f0b04b7d9b4fa8c3c74218c222194f0f2f9e8b7 (diff) | |
parent | 255c7df3bdbaccf00ba8e9fb00e750ffb9a50356 (diff) | |
download | nextcloud-server-241e397326545ee3ecad1a6a50dbe7839faa5c21.tar.gz nextcloud-server-241e397326545ee3ecad1a6a50dbe7839faa5c21.zip |
Merge branch 'master' into contactsmenu
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Session/CryptoSessionData.php | 7 | ||||
-rw-r--r-- | lib/private/Session/Internal.php | 2 | ||||
-rw-r--r-- | lib/private/User/User.php | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php index 4e0b852cb35..31fcea4a7a6 100644 --- a/lib/private/Session/CryptoSessionData.php +++ b/lib/private/Session/CryptoSessionData.php @@ -64,7 +64,12 @@ class CryptoSessionData implements \ArrayAccess, ISession { * Close session if class gets destructed */ public function __destruct() { - $this->close(); + try { + $this->close(); + } catch (SessionNotAvailableException $e){ + // This exception can occur if session is already closed + // So it is safe to ignore it and let the garbage collector to proceed + } } protected function initializeSession() { diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index 22878154c05..72af5727a54 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -151,7 +151,7 @@ class Internal extends Session { */ private function validateSession() { if ($this->sessionClosed) { - throw new \Exception('Session has been closed - no further changes to the session are allowed'); + throw new SessionNotAvailableException('Session has been closed - no further changes to the session are allowed'); } } } diff --git a/lib/private/User/User.php b/lib/private/User/User.php index a3be0c24bb9..f55807bc769 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -342,9 +342,13 @@ class User implements IUser { * @param bool $enabled */ public function setEnabled($enabled) { + $oldStatus = $this->isEnabled(); $this->enabled = $enabled; $enabled = ($enabled) ? 'true' : 'false'; - $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled); + if ($oldStatus !== $this->enabled) { + $this->triggerChange('enabled', $enabled); + $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled); + } } /** |