r34223 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34222‎ | r34223 | r34224 >
Date:18:30, 4 May 2008
Author:siebrand
Status:old
Tags:
Comment:
Some whitespace and indentation fixes
Modified paths:
  • /trunk/extensions/AbsenteeLandlord/AbsenteeLandlord.i18n.php (modified) (history)
  • /trunk/extensions/AbsenteeLandlord/AbsenteeLandlord.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbsenteeLandlord/AbsenteeLandlord.i18n.php
@@ -10,5 +10,5 @@
1111
1212 $messages['en'] = array(
1313 'absenteelandlord-reason' => 'The database has been automatically locked due to inactivity from the sysops.',
14 - 'absenteelandlord-desc' => 'Auto-locks the wiki database if the sysops are all inactive for some time',
15 -);
\ No newline at end of file
 14+ 'absenteelandlord-desc' => 'Auto-locks the wiki database if the sysops are all inactive for some time',
 15+);
Index: trunk/extensions/AbsenteeLandlord/AbsenteeLandlord.php
@@ -3,57 +3,57 @@
44 * \brief Contains code for the AbsenteeLandlord extension by Ryan Schmidt and Tim Laqua.
55 */
66
7 -if(!defined('MEDIAWIKI')) {
8 - echo("This file is an extension to the mediawiki software and cannot be used standalone\n");
9 - die( 1 );
10 -}
11 -
12 -$wgAbsenteeLandlordMaxDays = 90; //how many days do the sysops have to be inactive for?
 7+if(!defined('MEDIAWIKI')) {
 8+ echo("This file is an extension to the mediawiki software and cannot be used standalone\n");
 9+ die( 1 );
 10+}
1311
14 -$wgExtensionCredits['other'][] = array(
15 - 'name' => 'Absentee Landlord',
16 - 'author' => array( 'Ryan Schmidt', 'Tim Laqua' ),
 12+$wgAbsenteeLandlordMaxDays = 90; //how many days do the sysops have to be inactive for?
 13+
 14+$wgExtensionCredits['other'][] = array(
 15+ 'name' => 'Absentee Landlord',
 16+ 'author' => array( 'Ryan Schmidt', 'Tim Laqua' ),
1717 'version' => '1.0',
18 - 'description' => 'Auto-locks the wiki database if the sysops are all inactive for some time',
 18+ 'description' => 'Auto-locks the wiki database if the sysops are all inactive for some time',
1919 'descriptionmsg' => 'absenteelandlord-desc',
2020 'url' => 'http://www.mediawiki.org/wiki/Extension:AbsenteeLandlord',
21 -);
22 -
 21+);
 22+
2323 $wgExtensionFunctions[] = 'efAbsenteeLandlord_Setup';
24 -$wgHooks['BeforePageDisplay'][] = 'efAbsenteeLandlord_MaybeDoTouch';
 24+$wgHooks['BeforePageDisplay'][] = 'efAbsenteeLandlord_MaybeDoTouch';
2525
2626 function efAbsenteeLandlord_Setup() {
2727 global $wgAbsenteeLandlordMaxDays;
2828
29 - $timeout = $wgAbsenteeLandlordMaxDays * 24 * 60 * 60; // # days * 24 hours * 60 minutes * 60 seconds
30 - $lasttouched = filemtime( dirname(__FILE__) . '/lasttouched.txt' );
31 - $check = time() - $lasttouched;
32 -
 29+ $timeout = $wgAbsenteeLandlordMaxDays * 24 * 60 * 60; // # days * 24 hours * 60 minutes * 60 seconds
 30+ $lasttouched = filemtime( dirname(__FILE__) . '/lasttouched.txt' );
 31+ $check = time() - $lasttouched;
 32+
3333 if( $check >= $timeout ) {
3434 global $wgUser;
3535 $groups = $wgUser->getGroups();
36 -
37 - if( !in_array( 'sysop', $groups ) ) {
 36+
 37+ if( !in_array( 'sysop', $groups ) ) {
3838 global $wgReadOnly, $wgMessageCache;
39 -
 39+
4040 #Add Messages (don't need them unless we get here)
4141 require( dirname( __FILE__ ) . '/AbsenteeLandlord.i18n.php' );
4242 foreach( $messages as $key => $value ) {
4343 $wgMessageCache->addMessages( $messages[$key], $key );
4444 }
45 -
46 - $wgReadOnly = ( wfMsg( 'absenteelandlord-reason' ) );
 45+
 46+ $wgReadOnly = ( wfMsg( 'absenteelandlord-reason' ) );
4747 }
48 - }
 48+ }
4949
5050 return true;
5151 }
5252
53 -function efAbsenteeLandlord_MaybeDoTouch(&$out, &$sk = null) {
54 - global $wgUser;
55 - $groups = $wgUser->getGroups();
56 - if( in_array( 'sysop', $groups ) ) {
57 - touch( dirname(__FILE__) . '/lasttouched.txt' );
58 - }
59 - return true;
60 -}
\ No newline at end of file
 53+function efAbsenteeLandlord_MaybeDoTouch(&$out, &$sk = null) {
 54+ global $wgUser;
 55+ $groups = $wgUser->getGroups();
 56+ if( in_array( 'sysop', $groups ) ) {
 57+ touch( dirname(__FILE__) . '/lasttouched.txt' );
 58+ }
 59+ return true;
 60+}

Status & tagging log