summaryrefslogtreecommitdiffstats
path: root/lib/private/User
diff options
context:
space:
mode:
authorLeon Klingele <leon@struktur.de>2019-03-06 13:07:41 +0100
committerMorris Jobke <hey@morrisjobke.de>2019-04-11 10:11:05 +0200
commitf420647add0f5ffc917301335d82d951a1df502e (patch)
tree8d16e655c9ba13f97991c720eeb0fbfc88a8add3 /lib/private/User
parent36618b111fde55ba5c8ddedc294e58927257d107 (diff)
downloadnextcloud-server-f420647add0f5ffc917301335d82d951a1df502e.tar.gz
nextcloud-server-f420647add0f5ffc917301335d82d951a1df502e.zip
lib/private/User: do not change user properties if value has not changed
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/User')
-rw-r--r--lib/private/User/User.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index a47ef8dc543..48c913db2a9 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -158,12 +158,12 @@ class User implements IUser {
*/
public function setEMailAddress($mailAddress) {
$oldMailAddress = $this->getEMailAddress();
- if($mailAddress === '') {
- $this->config->deleteUserValue($this->uid, 'settings', 'email');
- } else {
- $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress);
- }
if($oldMailAddress !== $mailAddress) {
+ if($mailAddress === '') {
+ $this->config->deleteUserValue($this->uid, 'settings', 'email');
+ } else {
+ $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress);
+ }
$this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress);
}
}
@@ -407,8 +407,8 @@ class User implements IUser {
$quota = OC_Helper::computerFileSize($quota);
$quota = OC_Helper::humanFileSize($quota);
}
- $this->config->setUserValue($this->uid, 'files', 'quota', $quota);
if($quota !== $oldQuota) {
+ $this->config->setUserValue($this->uid, 'files', 'quota', $quota);
$this->triggerChange('quota', $quota, $oldQuota);
}
}