Index: trunk/extensions/AbsenteeLandlord/AbsenteeLandlord.php |
— | — | @@ -3,12 +3,12 @@ |
4 | 4 | * \brief Contains code for the AbsenteeLandlord extension by Ryan Schmidt and Tim Laqua. |
5 | 5 | */ |
6 | 6 | |
7 | | -if(!defined('MEDIAWIKI')) { |
8 | | - echo("This file is an extension to the mediawiki software and cannot be used standalone\n"); |
| 7 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 8 | + echo( "This file is an extension to the MediaWiki software and cannot be used standalone\n" ); |
9 | 9 | die( 1 ); |
10 | 10 | } |
11 | 11 | |
12 | | -$wgAbsenteeLandlordMaxDays = 90; //how many days do the sysops have to be inactive for? |
| 12 | +$wgAbsenteeLandlordMaxDays = 90; // how many days do the sysops have to be inactive for? |
13 | 13 | |
14 | 14 | $wgExtensionCredits['other'][] = array( |
15 | 15 | 'path' => __FILE__, |
— | — | @@ -23,23 +23,23 @@ |
24 | 24 | $wgExtensionFunctions[] = 'efAbsenteeLandlord_Setup'; |
25 | 25 | $wgHooks['BeforePageDisplay'][] = 'efAbsenteeLandlord_MaybeDoTouch'; |
26 | 26 | |
27 | | -$wgExtensionMessagesFiles['AbsenteeLandlord'] = dirname(__FILE__) . '/AbsenteeLandlord.i18n.php'; |
| 27 | +$wgExtensionMessagesFiles['AbsenteeLandlord'] = dirname( __FILE__ ) . '/AbsenteeLandlord.i18n.php'; |
28 | 28 | |
29 | 29 | function efAbsenteeLandlord_Setup() { |
30 | 30 | global $wgAbsenteeLandlordMaxDays; |
31 | 31 | |
32 | 32 | $timeout = $wgAbsenteeLandlordMaxDays * 24 * 60 * 60; // # days * 24 hours * 60 minutes * 60 seconds |
33 | | - $lasttouched = filemtime(dirname(__FILE__) . '/lasttouched.txt'); |
| 33 | + $lasttouched = filemtime( dirname( __FILE__ ) . '/lasttouched.txt' ); |
34 | 34 | $check = time() - $lasttouched; |
35 | 35 | |
36 | | - if( $check >= $timeout ) { |
| 36 | + if ( $check >= $timeout ) { |
37 | 37 | global $wgUser; |
38 | 38 | $groups = $wgUser->getGroups(); |
39 | 39 | |
40 | | - if( !in_array( 'sysop', $groups ) ) { |
| 40 | + if ( !in_array( 'sysop', $groups ) ) { |
41 | 41 | global $wgReadOnly; |
42 | 42 | |
43 | | - #Add Messages (don't need them unless we get here) |
| 43 | + # Add Messages (don't need them unless we get here) |
44 | 44 | wfLoadExtensionMessages( 'AbsenteeLandlord' ); |
45 | 45 | $wgReadOnly = wfMsg( 'absenteelandlord-reason' ); |
46 | 46 | } |
— | — | @@ -48,11 +48,11 @@ |
49 | 49 | return true; |
50 | 50 | } |
51 | 51 | |
52 | | -function efAbsenteeLandlord_MaybeDoTouch(&$out, $sk = null) { |
| 52 | +function efAbsenteeLandlord_MaybeDoTouch( &$out, $sk = null ) { |
53 | 53 | global $wgUser; |
54 | 54 | $groups = $wgUser->getGroups(); |
55 | | - if( in_array( 'sysop', $groups ) ) { |
56 | | - touch(dirname(__FILE__) . '/lasttouched.txt'); |
| 55 | + if ( in_array( 'sysop', $groups ) ) { |
| 56 | + touch( dirname( __FILE__ ) . '/lasttouched.txt' ); |
57 | 57 | } |
58 | 58 | return true; |
59 | 59 | } |