* Show validity period of the login cookie in Special:UserLogin and Special:Preferences
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 14 Jun 2010 18:28:39 +0000 (18:28 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 14 Jun 2010 18:28:39 +0000 (18:28 +0000)
* Ask for permanent login in Special:Preferences only if $wgCookieExpiration > 0

RELEASE-NOTES
includes/Preferences.php
includes/specials/SpecialResetpass.php
includes/templates/Userlogin.php
languages/messages/MessagesEn.php

index 69642c4..3552083 100644 (file)
@@ -80,6 +80,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 21312) RevisionMove allows moving individual revisions of a page to 
   another page. Introducing 'revisionmove' user right; disabled by default;
   experimental feature.
+* Show validity period of the login cookie in Special:UserLogin and
+  Special:Preferences
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
@@ -193,6 +195,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 23747) Make sure that on History pages, the RevDel button is not
   accidently activated when hitting enter.
 * (bug 23845) Special:ListFiles now uses correct file names without underscores
+* Ask for permanent login in Special:Preferences only if $wgCookieExpiration > 0
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index 802db5a..d889184 100644 (file)
@@ -217,12 +217,18 @@ class Preferences {
                                'section' => 'personal/info',
                        );
                }
-
-               $defaultPreferences['rememberpassword'] = array(
-                       'type' => 'toggle',
-                       'label-message' => 'tog-rememberpassword',
-                       'section' => 'personal/info',
-               );
+               global $wgCookieExpiration;
+               if ( $wgCookieExpiration > 0 ) {
+                       $defaultPreferences['rememberpassword'] = array(
+                               'type' => 'toggle',
+                               'label' => wfMsgExt(
+                                       'tog-rememberpassword',
+                                       array( 'parsemag' ),
+                                       $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) )
+                                       ),
+                               'section' => 'personal/info',
+                       );
+               }
 
                // Language
                global $wgContLanguageCode;
index e4bc54f..346e0f0 100644 (file)
@@ -96,10 +96,12 @@ class SpecialResetpass extends SpecialPage {
                }
                $rememberMe = '';
                if ( !$wgUser->isLoggedIn() ) {
+                       global $wgCookieExpiration, $wgLang;
                        $rememberMe = '<tr>' .
                                '<td></td>' .
                                '<td class="mw-input">' .
-                                       Xml::checkLabel( wfMsg( 'remembermypassword' ),
+                                       Xml::checkLabel( 
+                                               wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
                                                'wpRemember', 'wpRemember',
                                                $wgRequest->getCheck( 'wpRemember' ) ) .
                                '</td>' .
index 8989bc1..c6a8ced 100644 (file)
@@ -82,12 +82,15 @@ class UserloginTemplate extends QuickTemplate {
                        <td></td>
                        <td class="mw-input">
                                <?php
-               echo Html::input( 'wpRemember', '1', 'checkbox', array(
-                       'tabindex' => '4',
-                       'id' => 'wpRemember'
-               ) + ( $this->data['remember'] ? array( 'checked' ) : array() ) ); ?>
-
-                               <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
+                               global $wgCookieExpiration, $wgLang;
+                               echo Xml::checkLabel(
+                                       wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
+                                       'wpRemember',
+                                       'wpRemember',
+                                       $this->data['remember'],
+                                       array( 'tabindex' => '4' )
+                               )
+                               ?>
                        </td>
                </tr>
 <?php } ?>
@@ -245,11 +248,16 @@ class UsercreateTemplate extends QuickTemplate {
                <tr>
                        <td></td>
                        <td class="mw-input">
-                               <input type='checkbox' name="wpRemember"
-                                       tabindex="7"
-                                       value="1" id="wpRemember"
-                                       <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
-                                       /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
+                               <?php
+                               global $wgCookieExpiration, $wgLang;
+                               echo Xml::checkLabel(
+                                       wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
+                                       'wpRemember',
+                                       'wpRemember',
+                                       $this->data['remember'],
+                                       array( 'tabindex' => '7' )
+                               )
+                               ?>
                        </td>
                </tr>
 <?php   }
index 152cd6c..53bdef5 100644 (file)
@@ -629,7 +629,7 @@ XHTML id names.
 'tog-editsection'             => 'Enable section editing via [edit] links',
 'tog-editsectiononrightclick' => 'Enable section editing by right clicking on section titles (requires JavaScript)',
 'tog-showtoc'                 => 'Show table of contents (for pages with more than 3 headings)',
-'tog-rememberpassword'        => 'Remember my login on this computer',
+'tog-rememberpassword'        => 'Remember my login on this computer (for a maximum of $1 {{PLURAL:$1|day|days}})',
 'tog-watchcreations'          => 'Add pages I create to my watchlist',
 'tog-watchdefault'            => 'Add pages I edit to my watchlist',
 'tog-watchmoves'              => 'Add pages I move to my watchlist',
@@ -1043,7 +1043,7 @@ Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].',
 'yourname'                   => 'Username:',
 'yourpassword'               => 'Password:',
 'yourpasswordagain'          => 'Retype password:',
-'remembermypassword'         => 'Remember my login on this computer',
+'remembermypassword'         => 'Remember my login on this computer (for a maximum of $1 {{PLURAL:$1|day|days}})',
 'yourdomainname'             => 'Your domain:',
 'externaldberror'            => 'There was either an authentication database error or you are not allowed to update your external account.',
 'login'                      => 'Log in',