Index: trunk/phase3/tests/phpunit/suite.xml |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | convertWarningsToExceptions="true" |
11 | 11 | stopOnFailure="false" |
12 | 12 | strict="true" |
13 | | - verbose="true"> |
| 13 | + verbose="false"> |
14 | 14 | <testsuites> |
15 | 15 | <testsuite name="includes"> |
16 | 16 | <directory>./includes</directory> |
Index: trunk/phase3/tests/phpunit/includes/BlockTest.php |
— | — | @@ -2,7 +2,6 @@ |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * @group Database |
6 | | - * @group Broken |
7 | 6 | */ |
8 | 7 | class BlockTest extends MediaWikiLangTestCase { |
9 | 8 | |
Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -147,6 +147,10 @@ |
148 | 148 | ); |
149 | 149 | |
150 | 150 | $ls = new LocalSettingsGenerator( $this ); |
| 151 | + $rightsProfile = $this->rightsProfiles[$this->getVar( '_RightsProfile' )]; |
| 152 | + foreach( $rightsProfile as $group => $rightsArr ) { |
| 153 | + $ls->setGroupRights( $group, $rightsArr ); |
| 154 | + } |
151 | 155 | echo $ls->getText(); |
152 | 156 | return $this->session; |
153 | 157 | } |
Index: trunk/phase3/includes/installer/LocalSettingsGenerator.php |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | |
18 | 18 | private $extensions = array(); |
19 | 19 | private $values = array(); |
| 20 | + private $groupPermissions = array(); |
20 | 21 | private $dbSettings = ''; |
21 | 22 | private $safeMode = false; |
22 | 23 | |
— | — | @@ -77,6 +78,16 @@ |
78 | 79 | } |
79 | 80 | |
80 | 81 | /** |
| 82 | + * For $wgGroupPermissions, set a given ['group']['permission'] value. |
| 83 | + * @param $group String Group name |
| 84 | + * @param $rightsArr Array An array of permissions, in the form of: |
| 85 | + * array( 'right' => true, 'right2' => false ) |
| 86 | + */ |
| 87 | + public function setGroupRights( $group, $rightsArr ) { |
| 88 | + $this->groupPermissions[$group] = $rightsArr; |
| 89 | + } |
| 90 | + |
| 91 | + /** |
81 | 92 | * Returns the escaped version of a string of php code. |
82 | 93 | * |
83 | 94 | * @param $string String |
— | — | @@ -176,13 +187,26 @@ |
177 | 188 | $locale = ''; |
178 | 189 | } |
179 | 190 | |
180 | | - $rights = $this->values['wgRightsUrl'] ? '' : '#'; |
| 191 | + $rightsUrl = $this->values['wgRightsUrl'] ? '' : '#'; |
181 | 192 | $hashedUploads = $this->safeMode ? '' : '#'; |
182 | 193 | $metaNamespace = ''; |
183 | 194 | if( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) { |
184 | 195 | $metaNamespace = "\$wgMetaNamespace = \"{$this->values['wgMetaNamespace']}\";\n"; |
185 | 196 | } |
186 | 197 | |
| 198 | + $groupRights = ''; |
| 199 | + if( $this->groupPermissions ) { |
| 200 | + $groupRights .= "# The following permissions were set based on your choice in the installer\n"; |
| 201 | + foreach( $this->groupPermissions as $group => $rightArr ) { |
| 202 | + $group = self::escapePhpString( $group ); |
| 203 | + foreach( $rightArr as $right => $perm ) { |
| 204 | + $right = self::escapePhpString( $right ); |
| 205 | + $groupRights .= "\$wgGroupPermissions['$group']['$right'] = " . |
| 206 | + wfBoolToStr( $perm ) . "\n"; |
| 207 | + } |
| 208 | + } |
| 209 | + } |
| 210 | + |
187 | 211 | switch( $this->values['wgMainCacheType'] ) { |
188 | 212 | case 'anything': |
189 | 213 | case 'db': |
— | — | @@ -298,7 +322,7 @@ |
299 | 323 | ## For attaching licensing metadata to pages, and displaying an |
300 | 324 | ## appropriate copyright notice / icon. GNU Free Documentation |
301 | 325 | ## License and Creative Commons licenses are supported so far. |
302 | | -{$rights}\$wgEnableCreativeCommonsRdf = true; |
| 326 | +{$rightsUrl}\$wgEnableCreativeCommonsRdf = true; |
303 | 327 | \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright |
304 | 328 | \$wgRightsUrl = \"{$this->values['wgRightsUrl']}\"; |
305 | 329 | \$wgRightsText = \"{$this->values['wgRightsText']}\"; |
— | — | @@ -313,7 +337,8 @@ |
314 | 338 | # or if you have suhosin.get.max_value_length set in php.ini (then set it to |
315 | 339 | # that value) |
316 | 340 | \$wgResourceLoaderMaxQueryLength = {$this->values['wgResourceLoaderMaxQueryLength']}; |
317 | | -"; |
| 341 | + |
| 342 | +{$groupRights}"; |
318 | 343 | } |
319 | 344 | |
320 | 345 | } |