diff --git a/install.php b/install.php index e2cd5f7..fded627 100644 --- a/install.php +++ b/install.php @@ -25,6 +25,7 @@ if (!file_exists($configFile)) { $showForm = true; } + include("classes/functions.php"); $errors_d=array(); @@ -42,7 +43,7 @@ if (isset($_POST['action'])){ $action=$_POST['action']; } -if ($action=="config") { +if ($action=="config" && !is_db_installed()) { $sep_err=""; @@ -83,6 +84,9 @@ if ($action=="config") { $showForm=true; } } + + + $showForm = (!is_db_installed()); ?> @@ -347,6 +351,7 @@ function install_db($login, $password, $email, $title, $description, $url_instal $db->ejecutarConsulta($sqlStr); + $db->cierraConexion(); return true; } @@ -365,4 +370,15 @@ function mostrarerror($errors,$errors_d,$n) { return ""; } } + +function is_db_installed(){ + + $db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password); + + $sqlStr = "SELECT * FROM `".Table_prefix."config`"; + + $db->ejecutarConsulta($sqlStr); + + return ($db->contarRegistros() > 0); +} ?> \ No newline at end of file