Index: trunk/extensions/Makebot/Makebot.php |
— | — | @@ -15,7 +15,6 @@ |
16 | 16 | define( 'MW_MAKEBOT_GRANT', 1 ); |
17 | 17 | define( 'MW_MAKEBOT_REVOKE', 2 ); |
18 | 18 | |
19 | | - $wgExtensionFunctions[] = 'efMakeBot'; |
20 | 19 | $wgAvailableRights[] = 'makebot'; |
21 | 20 | $wgExtensionCredits['specialpage'][] = array( |
22 | 21 | 'name' => 'MakeBot', |
— | — | @@ -23,8 +22,8 @@ |
24 | 23 | 'url' => 'http://www.mediawiki.org/wiki/Extension:MakeBot', |
25 | 24 | 'description' => 'Special page allows local bureaucrats to grant and revoke bot permissions', |
26 | 25 | 'descriptionmsg' => 'makebot-desc', |
27 | | - 'svn-date' => '$LastChangedDate$', |
28 | | - 'svn-revision' => '$LastChangedRevision$', |
| 26 | + 'svn-date' => '$LastChangedDate$', |
| 27 | + 'svn-revision' => '$LastChangedRevision$', |
29 | 28 | ); |
30 | 29 | |
31 | 30 | /** |
— | — | @@ -32,6 +31,7 @@ |
33 | 32 | */ |
34 | 33 | $dir = dirname(__FILE__) . '/'; |
35 | 34 | $wgExtensionMessagesFiles['Makebot'] = $dir . 'Makebot.i18n.php'; |
| 35 | + |
36 | 36 | /** |
37 | 37 | * Determines who can use the extension; as a default, bureaucrats are permitted |
38 | 38 | */ |
— | — | @@ -50,16 +50,13 @@ |
51 | 51 | $wgSpecialPageGroups['Makebot'] = 'users'; |
52 | 52 | |
53 | 53 | /** |
54 | | - * Populate the message cache and set up the auditing |
| 54 | + * Set up the auditing |
55 | 55 | */ |
56 | | - function efMakeBot() { |
57 | | - global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions; |
58 | | - $wgLogTypes[] = 'makebot'; |
59 | | - $wgLogNames['makebot'] = 'makebot-logpage'; |
60 | | - $wgLogHeaders['makebot'] = 'makebot-logpagetext'; |
61 | | - $wgLogActions['makebot/grant'] = 'makebot-logentrygrant'; |
62 | | - $wgLogActions['makebot/revoke'] = 'makebot-logentryrevoke'; |
63 | | - } |
| 56 | + $wgLogTypes[] = 'makebot'; |
| 57 | + $wgLogNames['makebot'] = 'makebot-logpage'; |
| 58 | + $wgLogHeaders['makebot'] = 'makebot-logpagetext'; |
| 59 | + $wgLogActions['makebot/grant'] = 'makebot-logentrygrant'; |
| 60 | + $wgLogActions['makebot/revoke'] = 'makebot-logentryrevoke'; |
64 | 61 | |
65 | 62 | } else { |
66 | 63 | echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
Index: trunk/extensions/Makebot/Makebot.class.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | $wgOut->addHtml( $this->makeSearchForm() ); |
40 | 40 | |
41 | 41 | if( $this->target != '' ) { |
42 | | - $wgOut->addHtml( wfElement( 'p', NULL, NULL ) ); |
| 42 | + //$wgOut->addHtml( wfElement( 'p', NULL, NULL ) ); |
43 | 43 | $user = User::newFromName( $this->target ); |
44 | 44 | if( is_object( $user ) && !is_null( $user ) ) { |
45 | 45 | global $wgVersion; |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | $canBecomeBot = $this->canBecomeBot( $user ); |
55 | 55 | if( $wgRequest->getCheck( 'dosearch' ) || !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ), 'makebot' ) ) { |
56 | 56 | # Exists, check botness |
57 | | - if( in_array( 'bot', $user->mGroups ) ) { |
| 57 | + if( in_array( 'bot', $user->getGroups() ) ) { |
58 | 58 | # Has a bot flag |
59 | 59 | $wgOut->addWikiText( wfMsg( 'makebot-isbot', $user->getName() ) ); |
60 | 60 | $wgOut->addHtml( $this->makeGrantForm( MW_MAKEBOT_REVOKE ) ); |
— | — | @@ -135,8 +135,10 @@ |
136 | 136 | } |
137 | 137 | $form .= wfCloseElement( 'td' ) . wfCloseElement( 'tr' ); |
138 | 138 | # Comment field |
| 139 | + $form .= wfOpenElement( 'tr' ); |
139 | 140 | $form .= wfOpenElement( 'td', array( 'align' => 'right' ) ); |
140 | 141 | $form .= wfElement( 'label', array( 'for' => 'comment' ), wfMsg( 'makebot-comment' ) ); |
| 142 | + $form .= wfCloseElement( 'td' ); |
141 | 143 | $form .= wfOpenElement( 'td' ); |
142 | 144 | $form .= wfElement( 'input', array( 'type' => 'text', 'name' => 'comment', 'id' => 'comment', 'size' => 45, 'maxlength' => 255 ) ); |
143 | 145 | $form .= wfCloseElement( 'td' ) . wfCloseElement( 'tr' ); |
— | — | @@ -182,9 +184,8 @@ |
183 | 185 | */ |
184 | 186 | function canBecomeBot( &$user ) { |
185 | 187 | global $wgMakeBotPrivileged; |
186 | | - $user->loadFromDatabase(); |
187 | 188 | return $wgMakeBotPrivileged || |
188 | | - ( !in_array( 'sysop', $user->mGroups ) && |
189 | | - !in_array( 'bureaucrat', $user->mGroups ) ); |
| 189 | + ( !in_array( 'sysop', $user->getGroups() ) && |
| 190 | + !in_array( 'bureaucrat', $user->getGroups() ) ); |
190 | 191 | } |
191 | 192 | } |