diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index fdfb0f98b5..ca70d44fca 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-03-01 Miguel de Dios + + * install.php: modified the source code for install postgreSQL DB to make + the pandora user db as owner of tables. + 2011-03-01 Miguel de Dios * include/db/postgresql.php, include/db/mysql.php, include/functions_db.php: diff --git a/pandora_console/install.php b/pandora_console/install.php index ce7f883fea..ce1dcf3636 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -670,7 +670,7 @@ function install_step4() { if (pg_result_status($result) != PGSQL_FATAL_ERROR) { //Set the privileges for DB - pg_send_query($connection, "GRANT ALL PRIVILEGES ON DATABASE pandora to pandora;"); + pg_send_query($connection, "GRANT ALL PRIVILEGES ON DATABASE pandora TO pandora;"); $result = pg_get_result($connection); $setDBPrivileges = 0; @@ -690,7 +690,16 @@ function install_step4() { $correct = 1; foreach ($tables as $table) { - pg_send_query($connection, "GRANT ALL PRIVILEGES ON TABLE " . $table . " to pandora;"); + pg_send_query($connection, "GRANT ALL PRIVILEGES ON TABLE " . $table . " TO pandora;"); + $result = pg_get_result($connection); + + if (pg_result_status($result) == PGSQL_FATAL_ERROR) { + $correct = 0; + break; + } + + //For each table make owner pandora + pg_send_query($connection, "ALTER TABLE " . $table . " OWNER TO pandora;"); $result = pg_get_result($connection); if (pg_result_status($result) == PGSQL_FATAL_ERROR) {