From 6e35fc91a13c41f165af3511d0ce8df4b27b0ca7 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 3 Feb 2011 20:40:20 +0000 Subject: [PATCH] --- includes/installer/Installer.i18n.php | 1 + includes/installer/PostgresInstaller.php | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index da6015c6e0..5fdf24b5f2 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -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', diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 985c420169..621b81df2e 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -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; } -- 2.20.1