Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -263,6 +263,17 @@ |
264 | 264 | 'styles' => 'ext.centralauth.css', |
265 | 265 | ) + $commonModuleInfo; |
266 | 266 | |
| 267 | +// If AntiSpoof is installed, we can do some AntiSpoof stuff for CA |
| 268 | +if ( class_exists( 'AntiSpoof' ) ) { |
| 269 | + $wgAutoloadClasses['CentralAuthSpoofUser'] = "$caBase/AntiSpoof/CentralAuthSpoofUser.php"; |
| 270 | + $wgAutoloadClasses['CentralAuthAntiSpoofHooks'] = "$caBase/AntiSpoof/CentralAuthAntiSpoofHooks.php"; |
| 271 | + |
| 272 | + $wgHooks['AbortNewAccount'][] = 'CentralAuthAntiSpoofHooks::asAbortNewAccountHook'; |
| 273 | + $wgHooks['UserCreateForm'][] = 'CentralAuthAntiSpoofHooks::asUserCreateFormHook'; |
| 274 | + $wgHooks['AddNewAccount'][] = 'CentralAuthAntiSpoofHooks::asAddNewAccountHook'; |
| 275 | + $wgHooks['RenameUserComplete'][] = 'CentralAuthAntiSpoofHooks::asAddRenameUserHook'; |
| 276 | +} |
| 277 | + |
267 | 278 | /** |
268 | 279 | * @param $type |
269 | 280 | * @param $action |
Index: trunk/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php |
— | — | @@ -0,0 +1,17 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class CentralAuthSpoofUser extends SpoofUser { |
| 5 | + /** |
| 6 | + * @return DatabaseBase |
| 7 | + */ |
| 8 | + protected static function getDBSlave() { |
| 9 | + return CentralAuthUser::getCentralSlaveDB(); |
| 10 | + } |
| 11 | + |
| 12 | + /** |
| 13 | + * @return DatabaseBase |
| 14 | + */ |
| 15 | + protected static function getDBMaster() { |
| 16 | + return CentralAuthUser::getCentralDB(); |
| 17 | + } |
| 18 | +} |
Property changes on: trunk/extensions/CentralAuth/AntiSpoof/CentralAuthSpoofUser.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 19 | + native |
Index: trunk/extensions/CentralAuth/AntiSpoof/CentralAuthAntiSpoofHooks.php |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class CentralAuthAntiSpoofHooks extends AntiSpoofHooks { |
| 5 | + /** |
| 6 | + * @param $name string Username |
| 7 | + * @return CentralAuthAntiSpoofHooks |
| 8 | + */ |
| 9 | + protected static function makeSpoofUser( $name ) { |
| 10 | + return new CentralAuthSpoofUser( $name ); |
| 11 | + } |
| 12 | +} |
Property changes on: trunk/extensions/CentralAuth/AntiSpoof/CentralAuthAntiSpoofHooks.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 13 | + native |