Index: branches/REL1_18/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: branches/REL1_18/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,7 +187,7 @@ |
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'] ) { |
— | — | @@ -191,7 +202,7 @@ |
192 | 203 | foreach( $rightArr as $right => $perm ) { |
193 | 204 | $right = self::escapePhpString( $right ); |
194 | 205 | $groupRights .= "\$wgGroupPermissions['$group']['$right'] = " . |
195 | | - wfBoolToStr( $perm ) . ";\n"; |
| 206 | + wfBoolToStr( $perm ) . "\n"; |
196 | 207 | } |
197 | 208 | } |
198 | 209 | } |
— | — | @@ -311,7 +322,7 @@ |
312 | 323 | ## For attaching licensing metadata to pages, and displaying an |
313 | 324 | ## appropriate copyright notice / icon. GNU Free Documentation |
314 | 325 | ## License and Creative Commons licenses are supported so far. |
315 | | -{$rights}\$wgEnableCreativeCommonsRdf = true; |
| 326 | +{$rightsUrl}\$wgEnableCreativeCommonsRdf = true; |
316 | 327 | \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright |
317 | 328 | \$wgRightsUrl = \"{$this->values['wgRightsUrl']}\"; |
318 | 329 | \$wgRightsText = \"{$this->values['wgRightsText']}\"; |
— | — | @@ -326,7 +337,8 @@ |
327 | 338 | # or if you have suhosin.get.max_value_length set in php.ini (then set it to |
328 | 339 | # that value) |
329 | 340 | \$wgResourceLoaderMaxQueryLength = {$this->values['wgResourceLoaderMaxQueryLength']}; |
330 | | -"; |
| 341 | + |
| 342 | +{$groupRights}"; |
331 | 343 | } |
332 | 344 | |
333 | 345 | } |