* @param bool $throttle If true, reset the throttle timestamp to the present
*/
public function setNewpassword( $str, $throttle = true ) {
+ $id = $this->getId();
+ if ( $id == 0 ) {
+ throw new LogicException( 'Cannot set new password for a user that is not in the database.' );
+ }
+
$dbw = wfGetDB( DB_MASTER );
$passwordFactory = new PasswordFactory();
# Note that the pattern requirement will always be satisfied if the
# input is empty, so we need required in all cases.
- #
+
# @todo FIXME: Bug 23769: This needs to not claim the password is required
# if e-mail confirmation is being used. Since HTML5 input validation
# is b0rked anyway in some browsers, just return nothing. When it's