Index: trunk/phase3/includes/AuthPlugin.php |
— | — | @@ -262,6 +262,15 @@ |
263 | 263 | public function getUserInstance( User &$user ) { |
264 | 264 | return new AuthPluginUser( $user ); |
265 | 265 | } |
| 266 | + |
| 267 | + /** |
| 268 | + * Get a list of domains (in HTMLForm options format) used. |
| 269 | + * |
| 270 | + * @return array |
| 271 | + */ |
| 272 | + public function domainList() { |
| 273 | + return array(); |
| 274 | + } |
266 | 275 | } |
267 | 276 | |
268 | 277 | class AuthPluginUser { |
Index: trunk/phase3/includes/specials/SpecialPasswordReset.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | } |
46 | 46 | |
47 | 47 | protected function getFormFields() { |
48 | | - global $wgPasswordResetRoutes; |
| 48 | + global $wgPasswordResetRoutes, $wgAuth; |
49 | 49 | $a = array(); |
50 | 50 | if ( isset( $wgPasswordResetRoutes['username'] ) && $wgPasswordResetRoutes['username'] ) { |
51 | 51 | $a['Username'] = array( |
— | — | @@ -60,6 +60,15 @@ |
61 | 61 | ); |
62 | 62 | } |
63 | 63 | |
| 64 | + if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) { |
| 65 | + $domains = $wgAuth->domainList(); |
| 66 | + $a['Domain'] = array( |
| 67 | + 'type' => 'select', |
| 68 | + 'options' => $domains, |
| 69 | + 'label-message' => 'passwordreset-domain', |
| 70 | + ); |
| 71 | + } |
| 72 | + |
64 | 73 | return $a; |
65 | 74 | } |
66 | 75 | |
— | — | @@ -76,6 +85,9 @@ |
77 | 86 | if ( isset( $wgPasswordResetRoutes['email'] ) && $wgPasswordResetRoutes['email'] ) { |
78 | 87 | $i++; |
79 | 88 | } |
| 89 | + if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) { |
| 90 | + $i++; |
| 91 | + } |
80 | 92 | return wfMessage( 'passwordreset-pretext', $i )->parseAsBlock(); |
81 | 93 | } |
82 | 94 | |
— | — | @@ -87,7 +99,16 @@ |
88 | 100 | * @return Bool|Array |
89 | 101 | */ |
90 | 102 | public function onSubmit( array $data ) { |
| 103 | + global $wgAuth; |
91 | 104 | |
| 105 | + if ( isset( $data['Domain'] ) ) { |
| 106 | + if ( $wgAuth->validDomain( $data['Domain'] ) ) { |
| 107 | + $wgAuth->setDomain( $data['Domain'] ); |
| 108 | + } else { |
| 109 | + $wgAuth->setDomain( 'invaliddomain' ); |
| 110 | + } |
| 111 | + } |
| 112 | + |
92 | 113 | if ( isset( $data['Username'] ) && $data['Username'] !== '' ) { |
93 | 114 | $method = 'username'; |
94 | 115 | $users = array( User::newFromName( $data['Username'] ) ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1180,6 +1180,7 @@ |
1181 | 1181 | 'passwordreset-disabled' => 'Password resets have been disabled on this wiki.', |
1182 | 1182 | 'passwordreset-pretext' => '{{PLURAL:$1||Enter one of the pieces of data below}}', |
1183 | 1183 | 'passwordreset-username' => 'Username:', |
| 1184 | +'passwordreset-domain' => 'Domain:', |
1184 | 1185 | 'passwordreset-email' => 'E-mail address:', |
1185 | 1186 | 'passwordreset-emailtitle' => 'Account details on {{SITENAME}}', |
1186 | 1187 | 'passwordreset-emailtext-ip' => 'Someone (probably you, from IP address $1) requested a reminder of your |