http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89855

Revision: 89855
Author:   tstarling
Date:     2011-06-10 22:33:16 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
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: trunk/phase3/includes/installer/PostgresInstaller.php
===================================================================
--- trunk/phase3/includes/installer/PostgresInstaller.php       2011-06-10 
22:18:53 UTC (rev 89854)
+++ trunk/phase3/includes/installer/PostgresInstaller.php       2011-06-10 
22:33:16 UTC (rev 89855)
@@ -276,13 +276,17 @@
 
                $same = $this->getVar( 'wgDBuser' ) === $this->getVar( 
'_InstallUser' );
 
-               // Check if the web user exists
-               // Connect to the database with the install user
-               $status = $this->getPgConnection( 'create-db' );
-               if ( !$status->isOK() ) {
-                       return $status;
+               if ( $same ) {
+                       $exists = true;
+               } else {
+                       // Check if the web user exists
+                       // Connect to the database with the install user
+                       $status = $this->getPgConnection( 'create-db' );
+                       if ( !$status->isOK() ) {
+                               return $status;
+                       }
+                       $exists = $status->value->roleExists( $this->getVar( 
'wgDBuser' ) );
                }
-               $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' 
) );
 
                // Validate the create checkbox
                if ( $this->canCreateAccounts() && !$same && !$exists ) {
@@ -317,7 +321,7 @@
                // The web user is conventionally the table owner in PostgreSQL 
                // installations. Make sure the install user is able to create 
                // objects on behalf of the web user.
-               if ( $this->canCreateObjectsForWebUser() ) {
+               if ( $same || $this->canCreateObjectsForWebUser() ) {
                        return Status::newGood();
                } else {
                        return Status::newFatal( 'config-pg-not-in-role' );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to