Skip to content
Snippets Groups Projects
Unverified Commit 36618b11 authored by Morris Jobke's avatar Morris Jobke
Browse files

Pass old value to user triggerChange hook


Signed-off-by: default avatarMorris Jobke <hey@morrisjobke.de>
parent aac22ba4
No related branches found
No related tags found
No related merge requests found
......@@ -436,7 +436,7 @@ class User {
if (!empty($oldName) && $user instanceof \OC\User\User) {
// if it was empty, it would be a new record, not a change emitting the trigger could
// potentially cause a UniqueConstraintViolationException, depending on some factors.
$user->triggerChange('displayName', $displayName);
$user->triggerChange('displayName', $displayName, $oldName);
}
}
return $displayName;
......
......@@ -145,9 +145,8 @@ class User implements IUser {
$this->triggerChange('displayName', $displayName);
}
return $result !== false;
} else {
return false;
}
return false;
}
/**
......@@ -365,7 +364,8 @@ class User implements IUser {
$oldStatus = $this->isEnabled();
$this->enabled = $enabled;
if ($oldStatus !== $this->enabled) {
$this->triggerChange('enabled', $enabled);
// TODO: First change the value, then trigger the event as done for all other properties.
$this->triggerChange('enabled', $enabled, $oldStatus);
$this->config->setUserValue($this->uid, 'core', 'enabled', $enabled ? 'true' : 'false');
}
}
......@@ -409,7 +409,7 @@ class User implements IUser {
}
$this->config->setUserValue($this->uid, 'files', 'quota', $quota);
if($quota !== $oldQuota) {
$this->triggerChange('quota', $quota);
$this->triggerChange('quota', $quota, $oldQuota);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment