ravenlp 2007-09-09 16:37:01 +00:00
parent 711c338de0
commit a00b2a7d28
1 changed files with 17 additions and 1 deletions

View File

@ -25,6 +25,7 @@ if (!file_exists($configFile)) {
$showForm = true; $showForm = true;
} }
include("classes/functions.php"); include("classes/functions.php");
$errors_d=array(); $errors_d=array();
@ -42,7 +43,7 @@ if (isset($_POST['action'])){
$action=$_POST['action']; $action=$_POST['action'];
} }
if ($action=="config") { if ($action=="config" && !is_db_installed()) {
$sep_err=""; $sep_err="";
@ -84,6 +85,9 @@ if ($action=="config") {
} }
} }
$showForm = (!is_db_installed());
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
@ -347,6 +351,7 @@ function install_db($login, $password, $email, $title, $description, $url_instal
$db->ejecutarConsulta($sqlStr); $db->ejecutarConsulta($sqlStr);
$db->cierraConexion();
return true; return true;
} }
@ -365,4 +370,15 @@ function mostrarerror($errors,$errors_d,$n) {
return ""; 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);
}
?> ?>