[Pkg-owncloud-commits] [owncloud] 07/61: - adding default value for $recoveryPassword - set password correctly in lost password

David Prévot taffit at moszumanska.debian.org
Thu Jul 31 03:51:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit f33c49e2be7be32af7090da77101b35743e87ee0
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Thu Jul 24 12:50:39 2014 +0200

    - adding default value for $recoveryPassword
    - set password correctly in lost password
---
 core/lostpassword/controller/lostcontroller.php | 25 ++++++++++++++++++++++++-
 lib/private/user/user.php                       |  2 +-
 lib/public/iuser.php                            |  6 +++---
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/core/lostpassword/controller/lostcontroller.php b/core/lostpassword/controller/lostcontroller.php
index b1be65b..e4d51fd 100644
--- a/core/lostpassword/controller/lostcontroller.php
+++ b/core/lostpassword/controller/lostcontroller.php
@@ -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();
 			}
 
diff --git a/lib/private/user/user.php b/lib/private/user/user.php
index f9c2cb4..993fb4c 100644
--- a/lib/private/user/user.php
+++ b/lib/private/user/user.php
@@ -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));
 		}
diff --git a/lib/public/iuser.php b/lib/public/iuser.php
index dc4acc7..c15edcd 100644
--- a/lib/public/iuser.php
+++ b/lib/public/iuser.php
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list