mirror of
https://codeberg.org/mclemens/tsmmonitor2.git
synced 2024-11-17 22:36:10 -05:00
- Escaped backslashes before insert into DB. This fixes display errors
for e.g. Windows filespaces. This is also only a ugly workaround. A DB dependend escape of SQL statments via ADODBs 'qstr()' would be much better, but needs code refactoring. - Allow to save empty config field values. Needed to enable/disable file logging. - Fallback logging to STDOUT if given logfile not accessible.
This commit is contained in:
parent
5ce2f693d6
commit
79bade6748
@ -249,7 +249,7 @@ if ($_POST["css"] != "") {
|
||||
} else {
|
||||
$val = $_POST["txt".$col['Field']];
|
||||
}
|
||||
if ($val != "") {
|
||||
// if ($val != "") {
|
||||
if ($_POST['AddSave'] == "Save") {
|
||||
$colarray["`".$col['Field']."`"] = $val;
|
||||
$sqlcols .= $col['Field'];
|
||||
@ -261,7 +261,7 @@ if ($_POST["css"] != "") {
|
||||
$set .= $col['Field']."='".$val."'";
|
||||
$set .= ", ";
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
$sqlcols = ereg_replace(", $", "", $sqlcols);
|
||||
|
@ -74,6 +74,9 @@ class PollD {
|
||||
$logfile = $this->adodb->fetchArrayDB($sql);
|
||||
if ($logfile[0][confval] != "") {
|
||||
$this->loghandle = fopen($logfile[0][confval], 'at');
|
||||
if (!$this->loghandle) {
|
||||
echo "ERROR: Cannot open logfile: '".$logfile[0][confval]."' for writing. Falling back to STDOUT.\n";
|
||||
}
|
||||
}
|
||||
$this->servers = $this->getServers();
|
||||
$this->queries = $this->getQueries();
|
||||
@ -253,6 +256,7 @@ class PollD {
|
||||
if ($blank == "") {
|
||||
$read = preg_replace('/[\n]+/', '', $read);
|
||||
$read = ereg_replace("\t","\",\"",$read);
|
||||
$read = ereg_replace("\\\\",'\\\\',$read);
|
||||
if ($overviewname == '') {
|
||||
$out[] = 'INSERT IGNORE INTO '.$restable.' values ("'.$timestamp.'", "'.$read.'")';
|
||||
} else {
|
||||
|
@ -746,7 +746,7 @@ class TSMMonitor {
|
||||
$i++;
|
||||
} else {
|
||||
$outp = $this->adodb->fetchArrayDB($sql);
|
||||
var_dump($outp);
|
||||
//var_dump($outp);
|
||||
}
|
||||
}
|
||||
return $outp;
|
||||
|
Loading…
Reference in New Issue
Block a user