Index: trunk/extensions/ConfirmAccount/ConfirmAccount.php |
— | — | @@ -154,18 +154,12 @@ |
155 | 155 | $wgAutoloadClasses['ConfirmAccountUIHooks'] = "$dir/ConfirmAccountUI.hooks.php"; |
156 | 156 | |
157 | 157 | $dir = dirname( __FILE__ ) . '/presentation/specialpages'; |
158 | | -# Request an account |
159 | | -$wgSpecialPages['RequestAccount'] = 'RequestAccountPage'; |
| 158 | +# UI to request an account |
160 | 159 | $wgAutoloadClasses['RequestAccountPage'] = "$dir/actions/RequestAccount_body.php"; |
161 | | -$wgSpecialPageGroups['RequestAccount'] = 'login'; |
162 | | -# Confirm accounts |
163 | | -$wgSpecialPages['ConfirmAccounts'] = 'ConfirmAccountsPage'; |
| 160 | +# UI to confirm accounts |
164 | 161 | $wgAutoloadClasses['ConfirmAccountsPage'] = "$dir/actions/ConfirmAccount_body.php"; |
165 | | -$wgSpecialPageGroups['ConfirmAccounts'] = 'users'; |
166 | | -# Account credentials |
167 | | -$wgSpecialPages['UserCredentials'] = 'UserCredentialsPage'; |
| 162 | +# UI to see account credentials |
168 | 163 | $wgAutoloadClasses['UserCredentialsPage'] = "$dir/actions/UserCredentials_body.php"; |
169 | | -$wgSpecialPageGroups['UserCredentials'] = 'users'; |
170 | 164 | |
171 | 165 | $dir = dirname( __FILE__ ) . '/dataclasses'; |
172 | 166 | # Utility functions |
— | — | @@ -190,4 +184,7 @@ |
191 | 185 | # Register admin pages for AdminLinks extension. |
192 | 186 | $wgHooks['AdminLinks'][] = 'ConfirmAccountUIHooks::confirmAccountAdminLinks'; |
193 | 187 | |
| 188 | +# Actually register some special pages |
| 189 | +$wgHooks['SpecialPage_initList'][] = 'ConfirmAccountUIHooks::defineSpecialPages'; |
| 190 | + |
194 | 191 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'ConfirmAccountUpdaterHooks::addSchemaUpdates'; |
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php |
— | — | @@ -3,6 +3,27 @@ |
4 | 4 | * Class containing hooked functions for a ConfirmAccount environment |
5 | 5 | */ |
6 | 6 | class ConfirmAccountUIHooks { |
| 7 | + /* |
| 8 | + * Register ConfirmAccount special pages as needed. |
| 9 | + * Also sets $wgSpecialPages just to be consistent. |
| 10 | + */ |
| 11 | + public static function defineSpecialPages( array &$list ) { |
| 12 | + global $wgSpecialPages, $wgSpecialPageGroups, $wgConfirmAccountSaveInfo; |
| 13 | + |
| 14 | + $list['RequestAccount'] = $wgSpecialPages['RequestAccount'] = 'RequestAccountPage'; |
| 15 | + $wgSpecialPageGroups['RequestAccount'] = 'login'; |
| 16 | + |
| 17 | + $list['ConfirmAccounts'] = $wgSpecialPages['ConfirmAccounts'] = 'ConfirmAccountsPage'; |
| 18 | + $wgSpecialPageGroups['ConfirmAccounts'] = 'users'; |
| 19 | + |
| 20 | + if ( $wgConfirmAccountSaveInfo ) { |
| 21 | + $list['UserCredentials'] = $wgSpecialPages['UserCredentials'] = 'UserCredentialsPage'; |
| 22 | + $wgSpecialPageGroups['UserCredentials'] = 'users'; |
| 23 | + } |
| 24 | + |
| 25 | + return true; |
| 26 | + } |
| 27 | + |
7 | 28 | public static function addRequestLoginText( &$template ) { |
8 | 29 | global $wgUser, $wgOut; |
9 | 30 | # Add a link to RequestAccount from UserLogin |