r61640 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61639‎ | r61640 | r61641 >
Date:16:33, 28 January 2010
Author:platonides
Status:deferred
Tags:
Comment:
E_STRICT: use the time() instead of mktime
Use userCanExecute and displayRestrictionError instead of duplicating the restriction name.
Modified paths:
  • /trunk/extensions/LastUserLogin/LastUserLogin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LastUserLogin/LastUserLogin_body.php
@@ -25,8 +25,8 @@
2626 }
2727
2828 # If the user doesn't have the required 'lastlogin' permission, display an error
29 - if ( !$wgUser->isAllowed( 'lastlogin' ) ) {
30 - $wgOut->permissionRequired( 'lastlogin' );
 29+ if ( !$this->userCanExecute( $wgUser ) ) {
 30+ $this->displayRestrictionError();
3131 return;
3232 }
3333
@@ -85,7 +85,7 @@
8686 $style = 'style="border:1px solid #000"';
8787 $out .= "<td $style>" . $wgLang->timeanddate( wfTimestamp( TS_MW, $row[$key] ), true ) .
8888 '</td><td style="border: 1px solid #000; text-align:right;">' .
89 - $wgLang->formatNum( round( ( mktime() - wfTimestamp( TS_UNIX, $row[$key] ) ) / 3600 / 24, 2 ), 2 ) . "</td>";
 89+ $wgLang->formatNum( round( ( time() - wfTimestamp( TS_UNIX, $row[$key] ) ) / 3600 / 24, 2 ), 2 ) . "</td>";
9090 } else {
9191 if ( $key == 'user_name' ) {
9292 $userPage = Title::makeTitle( NS_USER, $row[$key] );

Status & tagging log