r30070 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30069‎ | r30070 | r30071 >
Date:15:16, 23 January 2008
Author:raymond
Status:old
Tags:
Comment:
(bug 11897) Add alias [[Special:CreateAccount]] & [[Special:Userlogin/signup]] for Special:Userlogin?type=signup
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -7,13 +7,13 @@
88 /**
99 * constructor
1010 */
11 -function wfSpecialUserlogin() {
 11+function wfSpecialUserlogin( $par = '' ) {
1212 global $wgRequest;
1313 if( session_id() == '' ) {
1414 wfSetupSession();
1515 }
1616
17 - $form = new LoginForm( $wgRequest );
 17+ $form = new LoginForm( $wgRequest, $par );
1818 $form->execute();
1919 }
2020
@@ -41,11 +41,11 @@
4242 * Constructor
4343 * @param WebRequest $request A WebRequest object passed by reference
4444 */
45 - function LoginForm( &$request ) {
 45+ function LoginForm( &$request, $par = '' ) {
4646 global $wgLang, $wgAllowRealName, $wgEnableEmail;
4747 global $wgAuth;
4848
49 - $this->mType = $request->getText( 'type' );
 49+ $this->mType = ( $par == 'signup' ) ? $par : $request->getText( 'type' ); # Check for [[Special:Userlogin/signup]]
5050 $this->mName = $request->getText( 'wpName' );
5151 $this->mPassword = $request->getText( 'wpPassword' );
5252 $this->mRetype = $request->getText( 'wpRetype' );
Index: trunk/phase3/includes/SpecialPage.php
@@ -80,6 +80,7 @@
8181
8282 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
8383 'Userlogout' => array( 'UnlistedSpecialPage', 'Userlogout' ),
 84+ 'CreateAccount' => array( 'SpecialCreateAccount' ),
8485 'Preferences' => array( 'SpecialPage', 'Preferences' ),
8586 'Watchlist' => array( 'SpecialPage', 'Watchlist' ),
8687
@@ -846,3 +847,17 @@
847848 return SpecialPage::getTitleFor( 'Contributions', $wgUser->getName() );
848849 }
849850 }
 851+/**
 852+ * Shortcut to construct a special page pointing to create account form.
 853+ * @addtogroup SpecialPage
 854+ */
 855+class SpecialCreateAccount extends SpecialPage {
 856+ function __construct() {
 857+ parent::__construct( 'CreateAccount' );
 858+ $this->mAllowedRedirectParams = array( 'uselang' );
 859+ }
 860+
 861+ function getRedirect() {
 862+ return SpecialPage::getTitleFor( 'Userlogin', 'signup' );
 863+ }
 864+}
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -353,6 +353,7 @@
354354 'Disambiguations' => array( 'Disambiguations' ),
355355 'Userlogin' => array( 'Userlogin' ),
356356 'Userlogout' => array( 'Userlogout' ),
 357+ 'CreateAccount' => array( 'CreateAccount' ),
357358 'Preferences' => array( 'Preferences' ),
358359 'Watchlist' => array( 'Watchlist' ),
359360 'Recentchanges' => array( 'Recentchanges' ),
Index: trunk/phase3/RELEASE-NOTES
@@ -140,6 +140,8 @@
141141 address in Reply-To instead of From for user-to-user emails.
142142 This protects against SPF problems and privacy-leaking bounce messages
143143 when using mailers that set the envelope sender to the From header value.
 144+* (bug 11897) Add alias [[Special:CreateAccount]] & [[Special:Userlogin/signup]]
 145+ for Special:Userlogin?type=signup
144146
145147 === Bug fixes in 1.12 ===
146148

Status & tagging log