From: Alexandre Emsenhuber Date: Sat, 16 Aug 2008 11:25:42 +0000 (+0000) Subject: tweak for r39376: do not show the check box "remember my password" if $wgEnablePersis... X-Git-Tag: 1.31.0-rc.0~45874 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=3186395e09875e20fd2523ffe159e9655db66947;p=lhc%2Fweb%2Fwiklou.git tweak for r39376: do not show the check box "remember my password" if $wgEnablePersistentCookies is set to false --- diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index de0c0d6b1a..e30a4ec46e 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -511,13 +511,13 @@ class PreferencesForm { * @access private */ function mainPrefsForm( $status , $message = '' ) { - global $wgUser, $wgOut, $wgLang, $wgContLang; + global $wgUser, $wgOut, $wgLang, $wgContLang, $wgAuth; global $wgAllowRealName, $wgImageLimits, $wgThumbLimits; global $wgDisableLangConversion, $wgDisableTitleConversion; global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits; global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress; global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication; - global $wgContLanguageCode, $wgDefaultSkin, $wgAuth; + global $wgContLanguageCode, $wgDefaultSkin, $wgEnablePersistentCookies; global $wgEmailConfirmToEdit, $wgAjaxSearch, $wgEnableMWSuggest; $wgOut->setPageTitle( wfMsg( 'preferences' ) ); @@ -762,13 +762,19 @@ class PreferencesForm { $this->tableRow( Xml::label( wfMsg( 'retypenew' ), 'wpRetypePass' ), Xml::password( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) ) - ) . - Xml::tags( 'tr', null, - Xml::tags( 'td', array( 'colspan' => '2' ), - $this->getToggle( "rememberpassword" ) - ) ) ); + if( $wgEnablePersistentCookies ){ + $wgOut->addHTML( + Xml::tags( 'tr', null, + Xml::tags( 'td', array( 'colspan' => '2' ), + $this->getToggle( "rememberpassword" ) + ) + ) + ); + } else { + $this->mUsedToggles['rememberpassword'] = true; + } } # diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index cc9c927b77..dfc0b39a11 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -738,7 +738,7 @@ class LoginForm { function mainLoginForm( $msg, $msgtype = 'error' ) { global $wgUser, $wgOut, $wgAllowRealName, $wgEnableEmail; global $wgCookiePrefix, $wgAuth, $wgLoginLanguageSelector; - global $wgAuth, $wgEmailConfirmToEdit; + global $wgAuth, $wgEmailConfirmToEdit, $wgEnablePersistentCookies; $titleObj = SpecialPage::getTitleFor( 'Userlogin' ); @@ -816,6 +816,7 @@ class LoginForm { $template->set( 'useemail', $wgEnableEmail ); $template->set( 'emailrequired', $wgEmailConfirmToEdit ); $template->set( 'canreset', $wgAuth->allowPasswordChange() ); + $template->set( 'canremember', (bool)$wgEnablePersistentCookies ); $template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember ); # Prepare language selection links as needed diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index deeeb2741e..02397ea897 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -63,7 +63,8 @@ class UserloginTemplate extends QuickTemplate { - + data['canremember'] ) { ?> @@ -74,6 +75,7 @@ class UserloginTemplate extends QuickTemplate { /> + @@ -196,6 +198,7 @@ class UsercreateTemplate extends QuickTemplate { + data['canremember'] ) { ?> @@ -206,7 +209,8 @@ class UsercreateTemplate extends QuickTemplate { /> -data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) { foreach ( $this->data['extraInput'] as $inputItem ) { ?>