r89839 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89838‎ | r89839 | r89840 >
Date:18:48, 10 June 2011
Author:mah
Status:resolved (Comments)
Tags:
Comment:
Make Pg installer work in the “common” case: follow up r89821 so that $exists can be set true if same user is the same for install and web.
Modified paths:
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -276,15 +276,13 @@
277277
278278 $same = $this->getVar( 'wgDBuser' ) === $this->getVar( '_InstallUser' );
279279
280 - if ( !$same ) {
281 - // Check if the web user exists
282 - // Connect to the database with the install user
283 - $status = $this->getPgConnection( 'create-db' );
284 - if ( !$status->isOK() ) {
285 - return $status;
286 - }
287 - $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
 280+ // Check if the web user exists
 281+ // Connect to the database with the install user
 282+ $status = $this->getPgConnection( 'create-db' );
 283+ if ( !$status->isOK() ) {
 284+ return $status;
288285 }
 286+ $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
289287
290288 // Validate the create checkbox
291289 if ( $this->canCreateAccounts() && !$same && !$exists ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r89855Fix for r89821, r89839: we can skip certain tests if the web user is the same...tstarling22:33, 10 June 2011
r90104MFT r89855 and base r89839 plus release notes, fixing bug 29399: PostgreSQL i...tstarling03:48, 15 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89821PostgreSQL install fixes:...tstarling11:32, 10 June 2011

Comments

#Comment by Tim Starling (talk | contribs)   22:17, 10 June 2011

What's the point of testing the connection again or calling $this->canCreateObjectsForWebUser() when it's the same user?

#Comment by MarkAHershberger (talk | contribs)   01:09, 11 June 2011

I didn't think to check that user is already tested at this point. Your fix in r89855 is better.

Status & tagging log