]> source.dussan.org Git - nextcloud-server.git/commitdiff
- adding default value for $recoveryPassword
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 24 Jul 2014 10:50:39 +0000 (12:50 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 24 Jul 2014 10:50:39 +0000 (12:50 +0200)
- set password correctly in lost password

core/lostpassword/controller/lostcontroller.php
lib/private/user/user.php
lib/public/iuser.php

index b1be65b4f01968e0fe1d3fd0921736f68e9e32cf..e4d51fde077b8c8c8aa1a3356c1d53e8e5d13ea5 100644 (file)
@@ -20,13 +20,36 @@ use \OC\Core\LostPassword\EncryptedDataException;
 
 class LostController extends Controller {
 
+       /**
+        * @var \OCP\IURLGenerator
+        */
        protected $urlGenerator;
+
+       /**
+        * @var \OCP\IUserManager
+        */
        protected $userManager;
+
+       /**
+        * @var \OC_Defaults
+        */
        protected $defaults;
+
+       /**
+        * @var IL10N
+        */
        protected $l10n;
        protected $from;
        protected $isDataEncrypted;
+
+       /**
+        * @var IConfig
+        */
        protected $config;
+
+       /**
+        * @var IUserSession
+        */
        protected $userSession;
 
        public function __construct($appName,
@@ -110,7 +133,7 @@ class LostController extends Controller {
                                throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid'));
                        }
 
-                       if (!$user->setPassword($userId, $password)) {
+                       if (!$user->setPassword($password)) {
                                throw new \Exception();
                        }
 
index f9c2cb4d130e98a63cf7a04ee14b8c2d01bb05c5..993fb4c0c64531bc26e2af3cf45b8050bac2bd8a 100644 (file)
@@ -156,7 +156,7 @@ class User implements IUser {
         * @param string $recoveryPassword for the encryption app to reset encryption keys
         * @return bool
         */
-       public function setPassword($password, $recoveryPassword) {
+       public function setPassword($password, $recoveryPassword = null) {
                if ($this->emitter) {
                        $this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword));
                }
index dc4acc7658fdc0445d8f1d77e9443a8806e2ee8d..c15edcd14ddc9de6985b83075c5070436e6054cd 100644 (file)
@@ -18,14 +18,14 @@ interface IUser {
        public function getUID();
 
        /**
-        * get the displayname for the user, if no specific displayname is set it will fallback to the user id
+        * get the display name for the user, if no specific display name is set it will fallback to the user id
         *
         * @return string
         */
        public function getDisplayName();
 
        /**
-        * set the displayname for the user
+        * set the display name for the user
         *
         * @param string $displayName
         * @return bool
@@ -59,7 +59,7 @@ interface IUser {
         * @param string $recoveryPassword for the encryption app to reset encryption keys
         * @return bool
         */
-       public function setPassword($password, $recoveryPassword);
+       public function setPassword($password, $recoveryPassword = null);
 
        /**
         * get the users home folder to mount