2012-10-25 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb_data.sql: fixed the lost fields in the table "tgrupo" when install. * install.php: fixed the installation on DBs with names as for example "name1.name2". Fixes: #3573766 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7092 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c5335c525d
commit
43d3671a77
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
|
@ -61,16 +61,41 @@
|
|||
</script>
|
||||
<body>
|
||||
<div style='height: 10px'>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$version = '5.0dev';
|
||||
$build = '120621';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
// ---------------
|
||||
// Main page code
|
||||
// ---------------
|
||||
|
||||
if (! isset($_GET["step"])) {
|
||||
install_step1();
|
||||
}
|
||||
else {
|
||||
$step = $_GET["step"];
|
||||
switch ($step) {
|
||||
case 11: install_step1_licence();
|
||||
break;
|
||||
case 2: install_step2();
|
||||
break;
|
||||
case 3: install_step3();
|
||||
break;
|
||||
case 4: install_step4();
|
||||
break;
|
||||
case 5: install_step5();
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
function check_extension ( $ext, $label ) {
|
||||
echo "<tr><td>";
|
||||
echo "<span class='arr'> $label </span>";
|
||||
|
@ -361,7 +386,6 @@ function print_logo_status ($step, $step_total) {
|
|||
</div>";
|
||||
}
|
||||
|
||||
|
||||
function install_step1() {
|
||||
global $banner;
|
||||
|
||||
|
@ -693,12 +717,12 @@ function install_step4() {
|
|||
|
||||
// Drop database if needed and don't want to install over an existing DB
|
||||
if ($dbdrop == 1) {
|
||||
mysql_query ("DROP DATABASE IF EXISTS $dbname");
|
||||
mysql_query ("DROP DATABASE IF EXISTS `$dbname`");
|
||||
}
|
||||
|
||||
// Create schema
|
||||
if ($dbaction == 'db_new' || $dbdrop == 1) {
|
||||
$step1 = mysql_query ("CREATE DATABASE $dbname");
|
||||
$step1 = mysql_query ("CREATE DATABASE `$dbname`");
|
||||
check_generic ($step1, "Creating database '$dbname'");
|
||||
}
|
||||
else {
|
||||
|
@ -718,7 +742,7 @@ function install_step4() {
|
|||
$host = 'localhost';
|
||||
if ($dbhost != 'localhost')
|
||||
$host = $_SERVER['SERVER_ADDR'];
|
||||
$step5 = mysql_query ("GRANT ALL PRIVILEGES ON $dbname.* to pandora@$host
|
||||
$step5 = mysql_query ("GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host
|
||||
IDENTIFIED BY '".$random_password."'");
|
||||
mysql_query ("FLUSH PRIVILEGES");
|
||||
check_generic ($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");
|
||||
|
@ -1120,31 +1144,4 @@ function install_step5() {
|
|||
</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
|
||||
// ---------------
|
||||
// Main page code
|
||||
// ---------------
|
||||
|
||||
if (! isset($_GET["step"])) {
|
||||
install_step1();
|
||||
}
|
||||
else {
|
||||
$step = $_GET["step"];
|
||||
switch ($step) {
|
||||
case 11: install_step1_licence();
|
||||
break;
|
||||
case 2: install_step2();
|
||||
break;
|
||||
case 3: install_step3();
|
||||
break;
|
||||
case 4: install_step4();
|
||||
break;
|
||||
case 5: install_step5();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
|
@ -132,7 +132,7 @@ UNLOCK TABLES;
|
|||
--
|
||||
|
||||
LOCK TABLES `tgrupo` WRITE;
|
||||
INSERT INTO `tgrupo` VALUES
|
||||
INSERT INTO `tgrupo` (`id_grupo`, `nombre`, `icon`, `parent`, `propagate`, `disabled`, `custom_id`, `id_skin`, `other`) VALUES
|
||||
(2,'Servers','server_database',0,0,0,'',1,''),
|
||||
(4,'Firewalls','firewall',0,0,0,'',1,''),
|
||||
(8,'Databases','database_gear',0,0,0,'',1,''),
|
||||
|
|
Loading…
Reference in New Issue