r89855 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89854‎ | r89855 | r89856 >
Date:22:33, 10 June 2011
Author:tstarling
Status:ok
Tags:
Comment:
Fix for r89821, r89839: we can skip certain tests if the web user is the same as the install user.
Modified paths:
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -276,13 +276,17 @@
277277
278278 $same = $this->getVar( 'wgDBuser' ) === $this->getVar( '_InstallUser' );
279279
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;
 280+ if ( $same ) {
 281+ $exists = true;
 282+ } else {
 283+ // Check if the web user exists
 284+ // Connect to the database with the install user
 285+ $status = $this->getPgConnection( 'create-db' );
 286+ if ( !$status->isOK() ) {
 287+ return $status;
 288+ }
 289+ $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
285290 }
286 - $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
287291
288292 // Validate the create checkbox
289293 if ( $this->canCreateAccounts() && !$same && !$exists ) {
@@ -317,7 +321,7 @@
318322 // The web user is conventionally the table owner in PostgreSQL
319323 // installations. Make sure the install user is able to create
320324 // objects on behalf of the web user.
321 - if ( $this->canCreateObjectsForWebUser() ) {
 325+ if ( $same || $this->canCreateObjectsForWebUser() ) {
322326 return Status::newGood();
323327 } else {
324328 return Status::newFatal( 'config-pg-not-in-role' );

Follow-up revisions

RevisionCommit summaryAuthorDate
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
r89839Make Pg installer work in the “common” case: follow up r89821 so that $ex...mah18:48, 10 June 2011

Status & tagging log