(no commit message)
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 3 Feb 2011 20:40:20 +0000 (20:40 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 3 Feb 2011 20:40:20 +0000 (20:40 +0000)
includes/installer/Installer.i18n.php
includes/installer/PostgresInstaller.php

index da6015c..5fdf24b 100644 (file)
@@ -449,6 +449,7 @@ Make sure that the user "$1" can write to the schema "$2".',
        'config-install-pg-commit'        => 'Committing changes',
        'config-install-pg-plpgsql'       => 'Checking for language PL/pgSQL',
        'config-pg-no-plpgsql'            => 'You need to install the language PL/pgSQL in the database $1',
+       'config-pg-no-create-privs'       => 'The account you specified for installation does not have enough privileges to create an account.',
        'config-install-user'             => 'Creating database user',
        'config-install-user-failed'      => 'Granting permission to user "$1" failed: $2',
        'config-install-tables'           => 'Creating tables',
index 985c420..621b81d 100644 (file)
@@ -24,7 +24,7 @@ class PostgresInstaller extends DatabaseInstaller {
        );
 
        var $minimumVersion = '8.3';
-       var $useAdmin = FALSE;
+       private $useAdmin = false;
 
        function getName() {
                return 'postgres';
@@ -70,7 +70,7 @@ class PostgresInstaller extends DatabaseInstaller {
                        return $status;
                }
 
-               $this->useAdmin = TRUE;
+               $this->useAdmin = true;
                // Try to connect
                $status->merge( $this->getConnection() );
                if ( !$status->isOK() ) {
@@ -78,7 +78,9 @@ class PostgresInstaller extends DatabaseInstaller {
                }
 
                //Make sure install user can create
-               $status->merge( $this->canCreateAccounts() );
+               if( !$this->canCreateAccounts() ) {
+                       $status->fatal( 'config-pg-no-create-privs' );
+               }
                if ( !$status->isOK() ) {
                        return $status;
                }
@@ -118,7 +120,7 @@ class PostgresInstaller extends DatabaseInstaller {
        }
 
        protected function canCreateAccounts() {
-               $this->useAdmin = TRUE;
+               $this->useAdmin = true;
                $status = $this->getConnection();
                if ( !$status->isOK() ) {
                        return false;
@@ -324,10 +326,9 @@ class PostgresInstaller extends DatabaseInstaller {
        }
 
     public function createTables() {
-               $this->db = NULL;
-               $this->useAdmin = FALSE;
+               $this->db = null;
+               $this->useAdmin = false;
         $status = $this->getConnection();
-               var_export($status);
         if ( !$status->isOK() ) {
             return $status;
         }