mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
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
34eb90e1dc
commit
9667426b1a
@ -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
|
||||
@ -60,17 +60,42 @@
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<div style='height: 10px'>
|
||||
<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
|
||||
|
||||
$version = '5.0dev';
|
||||
$build = '120621';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
function check_extension ( $ext, $label ) {
|
||||
echo "<tr><td>";
|
||||
echo "<span class='arr'> $label </span>";
|
||||
@ -184,7 +209,7 @@ function parse_mysql_dump($url) {
|
||||
$file_content = file($url);
|
||||
$query = "";
|
||||
foreach($file_content as $sql_line) {
|
||||
if(trim($sql_line) != "" && strpos($sql_line, "--") === false) {
|
||||
if (trim($sql_line) != "" && strpos($sql_line, "--") === false) {
|
||||
$query .= $sql_line;
|
||||
if(preg_match("/;[\040]*\$/", $sql_line)) {
|
||||
if (!$result = mysql_query($query)) {
|
||||
@ -208,7 +233,7 @@ function parse_postgresql_dump($connection, $url, $debug = false) {
|
||||
|
||||
$query = "";
|
||||
|
||||
foreach($file_content as $sql_line) {
|
||||
foreach ($file_content as $sql_line) {
|
||||
$clean_line = trim($sql_line);
|
||||
$comment = preg_match("/^(\s|\t)*--.*$/", $clean_line);
|
||||
if ($comment) {
|
||||
@ -258,7 +283,7 @@ function parse_oracle_dump($connection, $url, $debug = false) {
|
||||
$query = "";
|
||||
$plsql_block = false;
|
||||
|
||||
foreach($file_content as $sql_line) {
|
||||
foreach ($file_content as $sql_line) {
|
||||
$clean_line = trim($sql_line);
|
||||
$comment = preg_match("/^(\s|\t)*--.*$/", $clean_line);
|
||||
if ($comment) {
|
||||
@ -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…
x
Reference in New Issue
Block a user