nagiosql/debian/patches/40_settings_php.patch
2017-10-20 15:35:35 +02:00

104 lines
4.8 KiB
Diff

diff -uNr nagiosql.orig/admin/settings.php nagiosql/admin/settings.php
--- nagiosql.orig/admin/settings.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/admin/settings.php 2017-10-20 15:26:23.004000000 +0200
@@ -92,8 +92,8 @@
}
}
// Write db settings to file
- if (is_writable($strBasePath."config/settings.php")) {
- $filSettings = fopen($strBasePath."config/settings.php","w");
+ if (is_writable("/etc/nagiosql/settings.php")) {
+ $filSettings = fopen("/etc/nagiosql/settings.php","w");
if ($filSettings) {
fwrite($filSettings,"<?php\n");
fwrite($filSettings,"exit;\n");
@@ -138,7 +138,7 @@
$myVisClass->processMessage(translate("An error occured while writing settings.php, please check permissions!"),$strErrorMessage);
}
} else {
- $myVisClass->processMessage($strBasePath."config/settings.php ".translate("is not writeable, please check permissions!"),$strErrorMessage);
+ $myVisClass->processMessage("/etc/nagiosql/settings.php ".translate("is not writeable, please check permissions!"),$strErrorMessage);
}
}
//
diff -uNr nagiosql.orig/admin/support.php nagiosql/admin/support.php
--- nagiosql.orig/admin/support.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/admin/support.php 2017-10-20 15:25:10.844000000 +0200
@@ -211,7 +211,7 @@
}
// File access checks
$conttp->setVariable("RW_CONFIG",translate("Read/Write access:")." settings.php");
-$strConfigFile = "../config/settings.php";
+$strConfigFile = "/etc/nagiosql/settings.php";
if (file_exists($strConfigFile) && is_readable($strConfigFile) && is_writable($strConfigFile)) {
$conttp->setVariable("RW_CONFIG_CLASS","checkgreen");
$conttp->setVariable("RW_CONFIG_RESULT",translate("ok"));
diff -uNr nagiosql.orig/functions/prepend_adm.php nagiosql/functions/prepend_adm.php
--- nagiosql.orig/functions/prepend_adm.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/functions/prepend_adm.php 2017-10-20 15:27:19.124000000 +0200
@@ -79,14 +79,14 @@
//
// Start installer
// ===============
-$preIniFile = $preBasePath.'config/settings.php';
+$preIniFile = '/etc/nagiosql/settings.php';
if (!file_exists($preIniFile) OR ! is_readable($preIniFile)) {
header("Location: ".$preBaseURL."install/index.php");
}
//
// Read file settings
// ==================
-$SETS = parse_ini_file($preBasePath.'config/settings.php',true);
+$SETS = parse_ini_file('/etc/nagiosql/settings.php',true);
if (!isset($_SESSION['SETS']['db'])) $_SESSION['SETS']['db'] = $SETS['db'];
//
// Include external function/class files - part 1
diff -uNr nagiosql.orig/functions/prepend_scripting.php nagiosql/functions/prepend_scripting.php
--- nagiosql.orig/functions/prepend_scripting.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/functions/prepend_scripting.php 2017-10-20 15:26:47.384000000 +0200
@@ -43,7 +43,7 @@
// Read settings file
// ==================
$preBasePath = str_replace("functions","",dirname(__FILE__));
-$preIniFile = $preBasePath.'config/settings.php';
+$preIniFile = '/etc/nagiosql/settings.php';
//
// Read file settings
// ==================
diff -uNr nagiosql.orig/install/functions/install_class.php nagiosql/install/functions/install_class.php
--- nagiosql.orig/install/functions/install_class.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/install/functions/install_class.php 2017-10-20 15:28:51.144000000 +0200
@@ -764,7 +764,7 @@
$strBasePath = substr(realpath('.'),0,-7);
$strE_ID = error_reporting();
error_reporting(0);
- $filSettings = fopen($strBasePath."config/settings.php","w");
+ $filSettings = fopen("/etc/nagiosql/settings.php","w");
error_reporting($strE_ID);
if ($filSettings) {
// Write Database Configuration into settings.php
diff -uNr nagiosql.orig/install/index.php nagiosql/install/index.php
--- nagiosql.orig/install/index.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/install/index.php 2017-10-20 15:27:52.532000000 +0200
@@ -22,7 +22,7 @@
$preContent = "templates/index.tpl.htm";
$preEncode = 'utf-8';
$preLocale = "../config/locale";
-$filConfig = "../config/settings.php";
+$filConfig = "/etc/nagiosql/settings.php";
$preDBType = "mysql";
$strLangOpt = "";
$strVersion = "3.3.0";
diff -uNr nagiosql.orig/install/step1.php nagiosql/install/step1.php
--- nagiosql.orig/install/step1.php 2017-10-20 15:00:09.000000000 +0200
+++ nagiosql/install/step1.php 2017-10-20 15:28:25.108000000 +0200
@@ -199,7 +199,7 @@
}
$arrTemplate['CHECK_5_CONTENT_1'] = $strHTML;
// File access checks
-$strConfigFile = "../config/settings.php";
+$strConfigFile = "/etc/nagiosql/settings.php";
if (file_exists($strConfigFile) && is_readable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart1.$myInstClass->translate("Read test on settings file (config/settings.php)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else if (file_exists($strConfigFile)&& !is_readable($strConfigFile)) {