http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95701
Revision: 95701
Author: krinkle
Date: 2011-08-29 21:23:41 +0000 (Mon, 29 Aug 2011)
Log Message:
-----------
SignupAPI: Using the configuration directly instead of a hook
* Kept the hook for other uses though.
* Removed onSignupAPIUseAjax() and instead put the check in
SpecialUserSignup->execute()
* This also solves half of bug 30622.
* Fix E_NOTICE error, Methods in SignupAPI.hooks.php should be static.
Modified Paths:
--------------
trunk/extensions/SignupAPI/SignupAPI.php
trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php
trunk/extensions/SignupAPI/includes/SpecialUserSignup.php
Modified: trunk/extensions/SignupAPI/SignupAPI.php
===================================================================
--- trunk/extensions/SignupAPI/SignupAPI.php 2011-08-29 21:23:20 UTC (rev
95700)
+++ trunk/extensions/SignupAPI/SignupAPI.php 2011-08-29 21:23:41 UTC (rev
95701)
@@ -67,10 +67,6 @@
# Hooks
-if ( $wgSignupAPIUseAjax ) {
- $wgHooks['SignupForm'][] = 'SignupAPIHooks::onSignupAPIUseAjax';
-}
-
if ( $wgSignupAPISourceTracking ) {
// Schema updates for update.php
Modified: trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php
===================================================================
--- trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php 2011-08-29
21:23:20 UTC (rev 95700)
+++ trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php 2011-08-29
21:23:41 UTC (rev 95701)
@@ -8,13 +8,7 @@
class SignupAPIHooks {
- function onSignupAPIUseAjax() {
- global $wgOut;
- $wgOut->addModules( 'ext.SignupAPI' );
- return true;
- }
-
- function onSourceTracking() {
+ static function onSourceTracking() {
global $wgExtNewTables;
$wgExtNewTables[] = array(
@@ -24,7 +18,7 @@
return true;
}
- function addSourceTracking( &$personal_urls, &$title ) {
+ static function addSourceTracking( &$personal_urls, &$title ) {
global $wgRequest, $wgUser, $wgServer, $wgSecureLogin;
// Generate source tracking parameters
Modified: trunk/extensions/SignupAPI/includes/SpecialUserSignup.php
===================================================================
--- trunk/extensions/SignupAPI/includes/SpecialUserSignup.php 2011-08-29
21:23:20 UTC (rev 95700)
+++ trunk/extensions/SignupAPI/includes/SpecialUserSignup.php 2011-08-29
21:23:41 UTC (rev 95701)
@@ -128,6 +128,7 @@
}
public function execute( $par ) {
+ global $wgOut;
if ( session_id() == '' ) {
wfSetupSession();
@@ -137,6 +138,12 @@
$this->mType = 'signup';
}
+ // Ajax-ify ?
+ if ( $wgSignupAPIUseAjax ) {
+ $wgOut->addModules( 'ext.SignupAPI' );
+ }
+
+
if ( !is_null( $this->mCookieCheck ) ) {
$this->onCookieRedirectCheck( $this->mCookieCheck );
return;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs