);
}
- 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 {
$title = $this->msg( 'passwordreset-emailtitle' );
- $this->result = $firstUser->sendMail( $title->escaped(), $this->email->escaped() );
+ $this->result = $firstUser->sendMail( $title->escaped(), $this->email->text() );
// Blank the email if the user is not supposed to see it
if( !isset( $data['Capture'] ) || !$data['Capture'] ) {
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', $this->result->getMessage() );
return false;
}
+
+ protected function getGroupName() {
+ return 'users';
+ }
}