r95198 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95197‎ | r95198 | r95199 >
Date:13:13, 22 August 2011
Author:akshay
Status:resolved
Tags:
Comment:
Followup r95185, fixed braces, special page naming for 'UserSignup', added hook for loading 'ext.SignupAPI', made resource loading unconditional, need to fix '' for user configuration
Modified paths:
  • /trunk/extensions/SignupAPI/SignupAPI.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SignupAPI/SignupAPI.php
@@ -25,6 +25,8 @@
2626 'descriptionmsg' => 'signupapi-desc',
2727 );
2828
 29+global $wgSignupAPISourceTracking,$wgSignupAPIUseAjax;
 30+echo "before, AJAX = $wgSignupAPIUseAjax, Source= $wgSignupAPISourceTracking";
2931 $wgSignupAPIUseAjax = true;
3032 $wgSignupAPISourceTracking = true;
3133
@@ -40,23 +42,33 @@
4143 = $wgMyExtensionIncludes . '/APISignup.php';
4244 $wgSpecialPages['UserSignup'] = 'SignupForm';
4345
44 -if ( $wgSignupAPIUseAjax ) {
45 - $wgAutoloadClasses['validateSignup']
46 - = $wgMyExtensionIncludes . '/validateSignup.php';
 46+$wgAutoloadClasses['ValidateSignup']
 47+ = $wgMyExtensionIncludes . '/ValidateSignup.php';
4748
48 - $wgAPIModules['signup'] = 'ApiSignup';
49 - $wgAPIModules['validatesignup'] = 'validateSignup';
 49+$wgAPIModules['signup'] = 'ApiSignup';
5050
51 - # Requires jquery.ui.progressbar for password strength validation
52 - $wgResourceModules['ext.SignupAPI'] = array(
 51+$wgAPIModules['validatesignup'] = 'ValidateSignup';
5352
54 - 'scripts' => array( 'includes/verification.js' ),
55 - 'messages' => array( 'ok', 'signupapi-enterpassword', 'passwordtooshort', 'signupapi-weak', 'signupapi-medium', 'signupapi-strong', 'badretype', 'signupapi-passwordsmatch' ),
56 - 'dependencies' => array( 'jquery.ui.progressbar' ),
57 - 'localBasePath' => dirname( __FILE__ ),
58 - 'remoteExtPath' => 'SignupAPI'
59 - );
 53+# Requires jquery.ui.progressbar for password strength validation
 54+$wgResourceModules['ext.SignupAPI'] = array(
6055
 56+ 'scripts' => array( 'includes/verification.js' ),
 57+ 'messages' => array( 'signupapi-ok', 'signupapi-enterpassword', 'signupapi-passwordtooshort', 'signupapi-weak', 'signupapi-medium', 'signupapi-strong', 'signupapi-badretype', 'signupapi-passwordsmatch' ),
 58+ 'dependencies' => array( 'jquery.ui.progressbar' ),
 59+ 'localBasePath' => dirname( __FILE__ ),
 60+ 'remoteExtPath' => 'SignupAPI'
 61+);
 62+
 63+
 64+
 65+if ( $wgSignupAPIUseAjax ) {
 66+ $wgHooks['SignupForm'][] = 'onSignupAPIUseAjax';
 67+ function onSignupAPIUseAjax() {
 68+ echo "Entered onSignupAPIUseAJax";
 69+ global $wgOut;
 70+ $wgOut->addModules( 'ext.SignupAPI' );
 71+ return true;
 72+ }
6173 }
6274
6375 if ( $wgSignupAPISourceTracking ) {
@@ -73,8 +85,7 @@
7486 # Add source tracking to personal URL's
7587 $wgHooks['PersonalUrls'][] = 'addSourceTracking';
7688
77 - function addSourceTracking( &$personal_urls, &$title )
78 - {
 89+ function addSourceTracking( &$personal_urls, &$title ) {
7990 global $wgRequest,$wgUser;
8091
8192 #generate source tracking parameters
@@ -133,12 +144,12 @@
134145 $is_signup = $wgRequest->getText( 'type' ) == "signup";
135146 $createaccount_url = array(
136147 'text' => wfMsg( 'createaccount' ),
137 - 'href' => SkinTemplate::makeSpecialUrl( 'Usersignup', "$returnto&type=signup&wpSourceAction=$sourceAction&wpSourceNS=$sourceNS&wpSourceArticle=$sourceArticle" ),
 148+ 'href' => SkinTemplate::makeSpecialUrl( 'UserSignup', "$returnto&type=signup&wpSourceAction=$sourceAction&wpSourceNS=$sourceNS&wpSourceArticle=$sourceArticle" ),
138149 'active' => $title->isSpecial( 'Userlogin' ) && $is_signup
139150 );
140151
141152 if ( substr( $wgServer, 0, 5 ) === 'http:' && $wgSecureLogin ) {
142 - $title = SpecialPage::getTitleFor( 'Usersignup' );
 153+ $title = SpecialPage::getTitleFor( 'UserSignup' );
143154 $https_url = preg_replace( '/^http:/', 'https:', $title->getFullURL( "type=signup" ) );
144155 $createaccount_url['href'] = $https_url;
145156 $createaccount_url['class'] = 'link-https';

Follow-up revisions

RevisionCommit summaryAuthorDate
r95199Followup r95198, forgot to remove the test echoakshay13:19, 22 August 2011
r95453Rm another debugging echo from r95198demon22:22, 24 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95185Added resources for AJAX-ifying the signup form...akshay00:34, 22 August 2011

Status & tagging log