ravenlp 17 years ago
parent
commit
a00b2a7d28
1 changed files with 17 additions and 1 deletions
  1. 17 1
      install.php

+ 17 - 1
install.php View File

25
 	$showForm = true;
25
 	$showForm = true;
26
 }
26
 }
27
 
27
 
28
+
28
 include("classes/functions.php");
29
 include("classes/functions.php");
29
  
30
  
30
 $errors_d=array();
31
 $errors_d=array();
42
 	$action=$_POST['action'];
43
 	$action=$_POST['action'];
43
 }
44
 }
44
 
45
 
45
-if ($action=="config") {
46
+if ($action=="config" && !is_db_installed()) {
46
 	
47
 	
47
 	$sep_err="";
48
 	$sep_err="";
48
 	
49
 	
83
 		$showForm=true;
84
 		$showForm=true;
84
 	}
85
 	}
85
 }
86
 }
87
+	
88
+	
89
+	$showForm = (!is_db_installed());
86
 
90
 
87
 ?>
91
 ?>
88
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
92
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
347
 		
351
 		
348
 		$db->ejecutarConsulta($sqlStr);
352
 		$db->ejecutarConsulta($sqlStr);
349
 
353
 
354
+		$db->cierraConexion();
350
 		return true;
355
 		return true;
351
 }
356
 }
352
 
357
 
365
 		return "";
370
 		return "";
366
 	}
371
 	}
367
 }
372
 }
373
+
374
+function is_db_installed(){
375
+
376
+		$db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);		
377
+		
378
+		$sqlStr = "SELECT * FROM `".Table_prefix."config`";	
379
+		
380
+		$db->ejecutarConsulta($sqlStr);
381
+
382
+		return ($db->contarRegistros() > 0);
383
+}
368
 ?>
384
 ?>