Last modified: 2013-11-19 13:46:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59075, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57075 - Harmonize functions User::setNewPassword() and User:setPassword(): allow null to reset the temporary password
Harmonize functions User::setNewPassword() and User:setPassword(): allow null...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
1.23.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-14 20:40 UTC by T. Gries
Modified: 2013-11-19 13:46 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description T. Gries 2013-11-14 20:40:37 UTC
I suggest to harmonize the two functions with the goal, that also the temporary password (newPassword) can be made invalid by passing a null parameter. 

Current version does not allow to clear the temporary password, but I wish to have thar for E:OpenID .

Current code in User.php is:

	/**
	 * Set the password and reset the random token unconditionally.
	 *
	 * @param string|null $str New password to set or null to set an invalid
	 *  password hash meaning that the user will not be able to log in
	 *  through the web interface.
	 */
	public function setInternalPassword( $str ) {
		$this->load();
		$this->setToken();

		if ( $str === null ) {
			// Save an invalid hash...
			$this->mPassword = '';
		} else {
			$this->mPassword = self::crypt( $str );
		}
		$this->mNewpassword = '';
		$this->mNewpassTime = null;
	}

	/**
	 * Set the password for a password reminder or new account email
	 *
	 * @param string $str New password to set
	 * @param bool $throttle If true, reset the throttle timestamp to the present
	 */
	public function setNewpassword( $str, $throttle = true ) {
		$this->load();
		$this->mNewpassword = self::crypt( $str );
		if ( $throttle ) {
			$this->mNewpassTime = wfTimestampNow();
		}
	}
Comment 1 Gerrit Notification Bot 2013-11-18 15:05:42 UTC
Change 96029 had a related patch set uploaded by IAlex:
Allow null to be passed to User::setNewPassword()

https://gerrit.wikimedia.org/r/96029
Comment 2 Gerrit Notification Bot 2013-11-18 16:56:19 UTC
Change 96029 merged by jenkins-bot:
Allow null to be passed to User::setNewPassword()

https://gerrit.wikimedia.org/r/96029

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links