always emit the preSetPassword hook, this should only indicate the intention. Finally the post-hooks indicate if it was successful or not

This commit is contained in:
Björn Schießle 2013-06-06 13:30:18 +02:00
parent 97e05b71f8
commit fdaab7372e
1 changed files with 3 additions and 3 deletions

View File

@ -131,10 +131,10 @@ class User {
* @return bool
*/
public function setPassword($password, $recoveryPassword) {
if ($this->emitter) {
$this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword));
}
if ($this->backend->implementsActions(\OC_USER_BACKEND_SET_PASSWORD)) {
if ($this->emitter) {
$this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword));
}
$result = $this->backend->setPassword($this->uid, $password);
if ($this->emitter) {
$this->emitter->emit('\OC\User', 'postSetPassword', array($this, $password, $recoveryPassword));