r92351 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92350‎ | r92351 | r92352 >
Date:10:47, 16 July 2011
Author:hashar
Status:deferred (Comments)
Tags:
Comment:
MFT to REL1_18
r89311 : should fix user right selection in installer
Modified paths:
  • /branches/REL1_18/phase3/includes/installer/LocalSettingsGenerator.php (modified) (history)
  • /branches/REL1_18/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/installer/WebInstaller.php
@@ -147,6 +147,10 @@
148148 );
149149
150150 $ls = new LocalSettingsGenerator( $this );
 151+ $rightsProfile = $this->rightsProfiles[$this->getVar( '_RightsProfile' )];
 152+ foreach( $rightsProfile as $group => $rightsArr ) {
 153+ $ls->setGroupRights( $group, $rightsArr );
 154+ }
151155 echo $ls->getText();
152156 return $this->session;
153157 }
Index: branches/REL1_18/phase3/includes/installer/LocalSettingsGenerator.php
@@ -16,6 +16,7 @@
1717
1818 private $extensions = array();
1919 private $values = array();
 20+ private $groupPermissions = array();
2021 private $dbSettings = '';
2122 private $safeMode = false;
2223
@@ -77,6 +78,16 @@
7879 }
7980
8081 /**
 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+ /**
8192 * Returns the escaped version of a string of php code.
8293 *
8394 * @param $string String
@@ -176,7 +187,7 @@
177188 $locale = '';
178189 }
179190
180 - $rights = $this->values['wgRightsUrl'] ? '' : '#';
 191+ $rightsUrl = $this->values['wgRightsUrl'] ? '' : '#';
181192 $hashedUploads = $this->safeMode ? '' : '#';
182193 $metaNamespace = '';
183194 if( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) {
@@ -191,7 +202,7 @@
192203 foreach( $rightArr as $right => $perm ) {
193204 $right = self::escapePhpString( $right );
194205 $groupRights .= "\$wgGroupPermissions['$group']['$right'] = " .
195 - wfBoolToStr( $perm ) . ";\n";
 206+ wfBoolToStr( $perm ) . "\n";
196207 }
197208 }
198209 }
@@ -311,7 +322,7 @@
312323 ## For attaching licensing metadata to pages, and displaying an
313324 ## appropriate copyright notice / icon. GNU Free Documentation
314325 ## License and Creative Commons licenses are supported so far.
315 -{$rights}\$wgEnableCreativeCommonsRdf = true;
 326+{$rightsUrl}\$wgEnableCreativeCommonsRdf = true;
316327 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
317328 \$wgRightsUrl = \"{$this->values['wgRightsUrl']}\";
318329 \$wgRightsText = \"{$this->values['wgRightsText']}\";
@@ -326,7 +337,8 @@
327338 # or if you have suhosin.get.max_value_length set in php.ini (then set it to
328339 # that value)
329340 \$wgResourceLoaderMaxQueryLength = {$this->values['wgResourceLoaderMaxQueryLength']};
330 -";
 341+
 342+{$groupRights}";
331343 }
332344
333345 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r92386Followup r92351, restore r89598reedy00:30, 17 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89311Make user right selection in installer actually work, thanks Krinkle for spot...demon01:26, 2 June 2011

Comments

#Comment by 😂 (talk | contribs)   13:24, 16 July 2011

Also need to grab r89598.

#Comment by Hashar (talk | contribs)   21:38, 16 July 2011

reedy probably did it with r92339 (commit message mentions r89598). I have added a comment there, he probably missed something.

#Comment by Reedy (talk | contribs)   00:29, 17 July 2011

Yeah, it seems I did, and then this removed it...

-						wfBoolToStr( $perm ) . ";\n";
+						wfBoolToStr( $perm ) . "\n";

Status & tagging log