Index: branches/REL1_17/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_17/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': |
— | — | @@ -302,7 +326,7 @@ |
303 | 327 | ## For attaching licensing metadata to pages, and displaying an |
304 | 328 | ## appropriate copyright notice / icon. GNU Free Documentation |
305 | 329 | ## License and Creative Commons licenses are supported so far. |
306 | | -{$rights}\$wgEnableCreativeCommonsRdf = true; |
| 330 | +{$rightsUrl}\$wgEnableCreativeCommonsRdf = true; |
307 | 331 | \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright |
308 | 332 | \$wgRightsUrl = \"{$this->values['wgRightsUrl']}\"; |
309 | 333 | \$wgRightsText = \"{$this->values['wgRightsText']}\"; |
— | — | @@ -311,7 +335,8 @@ |
312 | 336 | |
313 | 337 | # Path to the GNU diff3 utility. Used for conflict resolution. |
314 | 338 | \$wgDiff3 = \"{$this->values['wgDiff3']}\"; |
315 | | -"; |
| 339 | + |
| 340 | +{$groupRights}"; |
316 | 341 | } |
317 | 342 | |
318 | 343 | } |
Property changes on: branches/REL1_17/phase3/includes/installer |
___________________________________________________________________ |
Modified: svn:mergeinfo |
319 | 344 | Merged /trunk/phase3/includes/installer:r89311 |