'type' => 'text',
'label-message' => 'passwordreset-username',
);
- if( $this->getUser()->isLoggedIn() ) {
+ if ( $this->getUser()->isLoggedIn() ) {
$a['Username']['default'] = $this->getUser()->getName();
}
}
);
}
- if( $this->getUser()->isAllowed( 'passwordreset' ) ) {
+ if ( $this->getUser()->isAllowed( 'passwordreset' ) ) {
$a['Capture'] = array(
'type' => 'check',
'label-message' => 'passwordreset-capture',
}
}
- if( isset( $data['Capture'] ) && !$this->getUser()->isAllowed( 'passwordreset' ) ) {
+ if ( isset( $data['Capture'] ) && !$this->getUser()->isAllowed( 'passwordreset' ) ) {
// The user knows they don't have the passwordreset permission, but they tried to spoof the form. That's naughty
throw new PermissionsError( 'passwordreset' );
}
);
if ( $res ) {
$users = array();
- foreach( $res as $row ) {
+ foreach ( $res as $row ) {
$users[] = User::newFromRow( $row );
}
} else {
return array( $error );
}
- if( count( $users ) == 0 ) {
- if( $method == 'email' ) {
+ if ( count( $users ) == 0 ) {
+ if ( $method == 'email' ) {
// Don't reveal whether or not an email address is in use
return true;
} else {
$this->result = $firstUser->sendMail( $title->escaped(), $this->email->text() );
- if( isset( $data['Capture'] ) && $data['Capture'] ) {
+ if ( isset( $data['Capture'] ) && $data['Capture'] ) {
// Save the user, will be used if an error occurs when sending the email
$this->firstUser = $firstUser;
} else {
if ( $this->result->isGood() ) {
return true;
- } elseif( isset( $data['Capture'] ) && $data['Capture'] ) {
+ } elseif ( isset( $data['Capture'] ) && $data['Capture'] ) {
// The email didn't send, but maybe they knew that and that's why they captured it
return true;
} else {
}
public function onSuccess() {
- if( $this->getUser()->isAllowed( 'passwordreset' ) && $this->email != null ) {
+ if ( $this->getUser()->isAllowed( 'passwordreset' ) && $this->email != null ) {
// @todo: Logging
- if( $this->result->isGood() ) {
+ if ( $this->result->isGood() ) {
$this->getOutput()->addWikiMsg( 'passwordreset-emailsent-capture' );
} else {
$this->getOutput()->addWikiMsg( 'passwordreset-emailerror-capture',