Skip to content
Snippets Groups Projects
Commit 8d62bb3a authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #3684 from owncloud/pg_install_db_master

Try connection with specified db when postgres does not work
parents 27f7ef49 7093b082
No related branches found
No related tags found
No related merge requests found
...@@ -320,7 +320,13 @@ class OC_Setup { ...@@ -320,7 +320,13 @@ class OC_Setup {
$connection_string = "host='$e_host' dbname=postgres user='$e_user' password='$e_password'"; $connection_string = "host='$e_host' dbname=postgres user='$e_user' password='$e_password'";
$connection = @pg_connect($connection_string); $connection = @pg_connect($connection_string);
if(!$connection) { if(!$connection) {
throw new DatabaseSetupException($l->t('PostgreSQL username and/or password not valid')); // Try if we can connect to the DB with the specified name
$e_dbname = addslashes($dbname);
$connection_string = "host='$e_host' dbname='$e_dbname' user='$e_user' password='$e_password'";
$connection = @pg_connect($connection_string);
if(!$connection)
throw new DatabaseSetupException($l->t('PostgreSQL username and/or password not valid'));
} }
$e_user = pg_escape_string($dbuser); $e_user = pg_escape_string($dbuser);
//check for roles creation rights in postgresql //check for roles creation rights in postgresql
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment