r39468 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39467‎ | r39468 | r39469 >
Date:11:25, 16 August 2008
Author:ialex
Status:old
Tags:
Comment:
tweak for r39376: do not show the check box "remember my password" if $wgEnablePersistentCookies is set to false
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/templates/Userlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -511,13 +511,13 @@
512512 * @access private
513513 */
514514 function mainPrefsForm( $status , $message = '' ) {
515 - global $wgUser, $wgOut, $wgLang, $wgContLang;
 515+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgAuth;
516516 global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
517517 global $wgDisableLangConversion, $wgDisableTitleConversion;
518518 global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits;
519519 global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress;
520520 global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
521 - global $wgContLanguageCode, $wgDefaultSkin, $wgAuth;
 521+ global $wgContLanguageCode, $wgDefaultSkin, $wgEnablePersistentCookies;
522522 global $wgEmailConfirmToEdit, $wgAjaxSearch, $wgEnableMWSuggest;
523523
524524 $wgOut->setPageTitle( wfMsg( 'preferences' ) );
@@ -762,13 +762,19 @@
763763 $this->tableRow(
764764 Xml::label( wfMsg( 'retypenew' ), 'wpRetypePass' ),
765765 Xml::password( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) )
766 - ) .
767 - Xml::tags( 'tr', null,
768 - Xml::tags( 'td', array( 'colspan' => '2' ),
769 - $this->getToggle( "rememberpassword" )
770 - )
771766 )
772767 );
 768+ if( $wgEnablePersistentCookies ){
 769+ $wgOut->addHTML(
 770+ Xml::tags( 'tr', null,
 771+ Xml::tags( 'td', array( 'colspan' => '2' ),
 772+ $this->getToggle( "rememberpassword" )
 773+ )
 774+ )
 775+ );
 776+ } else {
 777+ $this->mUsedToggles['rememberpassword'] = true;
 778+ }
773779 }
774780
775781 # <FIXME>
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -738,7 +738,7 @@
739739 function mainLoginForm( $msg, $msgtype = 'error' ) {
740740 global $wgUser, $wgOut, $wgAllowRealName, $wgEnableEmail;
741741 global $wgCookiePrefix, $wgAuth, $wgLoginLanguageSelector;
742 - global $wgAuth, $wgEmailConfirmToEdit;
 742+ global $wgAuth, $wgEmailConfirmToEdit, $wgEnablePersistentCookies;
743743
744744 $titleObj = SpecialPage::getTitleFor( 'Userlogin' );
745745
@@ -816,6 +816,7 @@
817817 $template->set( 'useemail', $wgEnableEmail );
818818 $template->set( 'emailrequired', $wgEmailConfirmToEdit );
819819 $template->set( 'canreset', $wgAuth->allowPasswordChange() );
 820+ $template->set( 'canremember', (bool)$wgEnablePersistentCookies );
820821 $template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember );
821822
822823 # Prepare language selection links as needed
Index: trunk/phase3/includes/templates/Userlogin.php
@@ -63,7 +63,8 @@
6464 </select>
6565 </td>
6666 </tr>
67 - <?php } ?>
 67+ <?php }
 68+ if( $this->data['canremember'] ) { ?>
6869 <tr>
6970 <td></td>
7071 <td class="mw-input">
@@ -74,6 +75,7 @@
7576 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
7677 </td>
7778 </tr>
 79+ <?php } ?>
7880 <tr>
7981 <td></td>
8082 <td class="mw-submit">
@@ -196,6 +198,7 @@
197199 </td>
198200 <?php } ?>
199201 </tr>
 202+ <?php if( $this->data['canremember'] ) { ?>
200203 <tr>
201204 <td></td>
202205 <td class="mw-input">
@@ -206,7 +209,8 @@
207210 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
208211 </td>
209212 </tr>
210 -<?php
 213+<?php }
 214+
211215 $tabIndex = 8;
212216 if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
213217 foreach ( $this->data['extraInput'] as $inputItem ) { ?>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r39376* Bug 12976: Use $WebResponse->setCookie() rather than raw setcookie() calls....demon01:54, 15 August 2008

Status & tagging log