diff --git a/lib/user/user.php b/lib/user/user.php
index f9466b71499ff638e8d10e9293839b8d8bc77983..55d7848a979c80e8b229cb41949e22f979709ad3 100644
--- a/lib/user/user.php
+++ b/lib/user/user.php
@@ -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));