Index: trunk/extensions/Configure/Configure.api.php |
— | — | @@ -254,7 +254,8 @@ |
255 | 255 | break; |
256 | 256 | case 'promotion-conds': |
257 | 257 | $opToName = array_flip( array( 'or' => '|', 'and' => '&', 'xor' => '^', 'not' => '!' ) ); |
258 | | - $condsName = array( 1 => 'editcount', 2 => 'age', 3 => 'emailconfirmed', 4 => 'in-groups' ); |
| 258 | + $condsName = array( 1 => 'editcount', 2 => 'age', 3 => 'emailconfirmed', |
| 259 | + 4 => 'in-groups', 5 => 'is-ip', 6 => 'ip-in-range' ); |
259 | 260 | $validOps = array_keys( $opToName ); |
260 | 261 | |
261 | 262 | $settingRet['values'] = array(); |
Index: trunk/extensions/Configure/Configure.page.php |
— | — | @@ -614,7 +614,8 @@ |
615 | 615 | break; |
616 | 616 | case 'promotion-conds': |
617 | 617 | $options = array( 'or' => '|', 'and' => '&', 'xor' => '^', 'not' => '!' ); |
618 | | - $conds = array( APCOND_EDITCOUNT => 'int', APCOND_AGE => 'int', APCOND_EMAILCONFIRMED => 'bool', APCOND_INGROUPS => 'array' ); |
| 618 | + $conds = array( APCOND_EDITCOUNT => 'int', APCOND_AGE => 'int', APCOND_EMAILCONFIRMED => 'bool', |
| 619 | + APCOND_INGROUPS => 'array', APCOND_ISIP => 'text', APCOND_IPINRANGE => 'text' ); |
619 | 620 | |
620 | 621 | if ( isset( $_REQUEST['wp' . $name . '-vals'] ) ) { |
621 | 622 | $groups = explode( "\n", trim( $wgRequest->getText( 'wp' . $name . '-vals' ) ) ); |
— | — | @@ -651,6 +652,11 @@ |
652 | 653 | if( $val ) |
653 | 654 | $condsVal[] = array( $condName, $val ); |
654 | 655 | break; |
| 656 | + case 'text': |
| 657 | + $val = $wgRequest->getVal( 'wp' . $name . '-' . $group . '-cond-' . $condName ); |
| 658 | + if( $val ) |
| 659 | + $condsVal[] = array( $condName, $val ); |
| 660 | + break; |
655 | 661 | case 'array': |
656 | 662 | $val = trim( $wgRequest->getText( 'wp' . $name . '-' . $group . '-cond-' . $condName ) ); |
657 | 663 | if( !$val ) |
— | — | @@ -1328,7 +1334,8 @@ |
1329 | 1335 | */ |
1330 | 1336 | public static function buildPromotionCondsSettingRow( $conf, $allowed, $group, $groupConds ){ |
1331 | 1337 | static $options = array( 'or' => '|', 'and' => '&', 'xor' => '^', 'not' => '!' ); |
1332 | | - static $conds = array( APCOND_EDITCOUNT => 'int', APCOND_AGE => 'int', APCOND_EMAILCONFIRMED => 'bool', APCOND_INGROUPS => 'array' ); |
| 1338 | + static $conds = array( APCOND_EDITCOUNT => 'int', APCOND_AGE => 'int', APCOND_EMAILCONFIRMED => 'bool', |
| 1339 | + APCOND_INGROUPS => 'array', APCOND_ISIP => 'text', APCOND_IPINRANGE => 'text' ); |
1333 | 1340 | |
1334 | 1341 | $row = '<div class="configure-biglist promotion-conds-element">'; |
1335 | 1342 | $row .= wfMsgHtml( 'configure-condition-operator' ) . ' '; |
— | — | @@ -1376,8 +1383,10 @@ |
1377 | 1384 | $row .= Xml::check( $encId.'-cond-'.$condName, isset( $condsVal[$condName] ) && $condsVal[$condName], |
1378 | 1385 | array( 'id' => $encId.'-cond-'.$condName ) + $extra ) . "<br />\n"; |
1379 | 1386 | break; |
| 1387 | + case 'text': |
1380 | 1388 | case 'int': |
1381 | | - $row .= Xml::input( $encId.'-cond-'.$condName, 20, isset( $condsVal[$condName] ) ? $condsVal[$condName] : 0, $extra ) . "<br />\n"; |
| 1389 | + $row .= Xml::input( $encId.'-cond-'.$condName, ( $condType == 'int' ? 20 : 40 ), |
| 1390 | + isset( $condsVal[$condName] ) ? $condsVal[$condName] : ( $condType == 'int' ? 0 : '' ), $extra ) . "<br />\n"; |
1382 | 1391 | break; |
1383 | 1392 | case 'array': |
1384 | 1393 | $id = "{$encId}-cond-{$condName}"; |
Index: trunk/extensions/Configure/CHANGELOG |
— | — | @@ -1,6 +1,10 @@ |
2 | 2 | This file lists changes on this extension. |
3 | 3 | Localisation updates are done on betawiki and aren't listed here. |
4 | 4 | |
| 5 | +0.11.2 - 18 December 2008 |
| 6 | + Added support for APCOND_ISIP and APCOND_IPINRANGE conditions of |
| 7 | + $wgAutopromote. |
| 8 | + |
5 | 9 | 0.11.1 - 13 December 2008 |
6 | 10 | Added $wgEnableSerializedMessages. |
7 | 11 | |
Index: trunk/extensions/Configure/Configure.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure', |
19 | 19 | 'description' => 'Allow authorised users to configure the wiki via a web-based interface', |
20 | 20 | 'descriptionmsg' => 'configure-desc', |
21 | | - 'version' => '0.11.1', |
| 21 | + 'version' => '0.11.2', |
22 | 22 | ); |
23 | 23 | |
24 | 24 | # Configuration part |
Index: trunk/extensions/Configure/Configure.i18n.php |
— | — | @@ -187,12 +187,16 @@ |
188 | 188 | 'configure-condition-name-2' => 'Minimal age', |
189 | 189 | 'configure-condition-name-3' => 'E-mail confirmed', |
190 | 190 | 'configure-condition-name-4' => 'In groups', |
| 191 | + 'configure-condition-name-5' => 'User\'s IP', |
| 192 | + 'configure-condition-name-6' => 'IP in CDIR range', |
191 | 193 | 'configure-autopromote-noconds' => 'No prerequisites', |
192 | 194 | |
193 | 195 | 'configure-condition-description-1' => 'Minimum edit count of $1', |
194 | 196 | 'configure-condition-description-2' => 'Minimum account age of $1 {{PLURAL:$1|second|seconds}}', |
195 | 197 | 'configure-condition-description-3' => 'E-mail confirmed', |
196 | 198 | 'configure-condition-description-4' => 'In all of the groups $1', |
| 199 | + 'configure-condition-description-5' => 'User\'s IP is $1', |
| 200 | + 'configure-condition-description-6' => 'User\'s IP in $1 range', |
197 | 201 | |
198 | 202 | 'configure-boolop-description-and' => 'All conditions must be true', |
199 | 203 | 'configure-boolop-description-or' => 'At least one condition must be true', |