|
@@ 57-69 (lines=13) @@
|
| 54 |
|
$reqs = AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data ); |
| 55 |
|
|
| 56 |
|
$res = AuthManager::singleton()->beginAuthentication( $reqs, 'null:' ); |
| 57 |
|
switch ( $res->status ) { |
| 58 |
|
case AuthenticationResponse::PASS: |
| 59 |
|
return true; |
| 60 |
|
case AuthenticationResponse::FAIL: |
| 61 |
|
// Hope it's not a PreAuthenticationProvider that failed... |
| 62 |
|
$msg = $res->message instanceof \Message ? $res->message : new \Message( $res->message ); |
| 63 |
|
$this->logger->info( __METHOD__ . ': Authentication failed: ' . $msg->plain() ); |
| 64 |
|
return false; |
| 65 |
|
default: |
| 66 |
|
throw new \BadMethodCallException( |
| 67 |
|
'AuthManager does not support such simplified authentication' |
| 68 |
|
); |
| 69 |
|
} |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
public function modifyUITemplate( &$template, &$type ) { |
|
@@ 180-192 (lines=13) @@
|
| 177 |
|
$reqs = AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data ); |
| 178 |
|
|
| 179 |
|
$res = AuthManager::singleton()->beginAccountCreation( $wgUser, $reqs, 'null:' ); |
| 180 |
|
switch ( $res->status ) { |
| 181 |
|
case AuthenticationResponse::PASS: |
| 182 |
|
return true; |
| 183 |
|
case AuthenticationResponse::FAIL: |
| 184 |
|
// Hope it's not a PreAuthenticationProvider that failed... |
| 185 |
|
$msg = $res->message instanceof \Message ? $res->message : new \Message( $res->message ); |
| 186 |
|
$this->logger->info( __METHOD__ . ': Authentication failed: ' . $msg->plain() ); |
| 187 |
|
return false; |
| 188 |
|
default: |
| 189 |
|
throw new \BadMethodCallException( |
| 190 |
|
'AuthManager does not support such simplified account creation' |
| 191 |
|
); |
| 192 |
|
} |
| 193 |
|
} |
| 194 |
|
|
| 195 |
|
public function strict() { |