Skip to content
Snippets Groups Projects

5534 add docker

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
@@ -45,7 +45,7 @@ class Actionlog {
*/
public function __construct($sProject = false) {
global $aConfig;
if (!is_array($aConfig) || !array_key_exists("appRootDir", $aConfig)) {
if (!isset($aConfig["appRootDir"])) {
die(__CLASS__ . "::".__FUNCTION__." ERROR: configuration with \$aConfig was not loaded.");
}
$this->_dbfile = $aConfig['dataDir'] . '/database/logs.db';
@@ -82,7 +82,7 @@ class Actionlog {
*/
private function _makeQuery($sSql) {
// $this->_log(__FUNCTION__."($sSql)");
// echo "<pre>$sSql</pre>";
// echo "<pre>".htmlentities($sSql)."</pre>";
$db = new PDO("sqlite:" . $this->_dbfile);
$result = $db->query($sSql);
/*
@@ -113,7 +113,7 @@ class Actionlog {
'" . $this->_sUser . "',
'" . $this->_sProject . "',
'" . $sAction . "',
'" . $sMessage . "'
'" . str_replace("'", '"', $sMessage) . "'
);
";
/*
@@ -164,24 +164,24 @@ class Actionlog {
$sWhere = false;
$aWhere=array();
if (array_key_exists("project", $aFilter) && $aFilter["project"]) {
if (isset($aFilter["project"]) && $aFilter["project"]) {
$aWhere[]='`project`="' . $this->_filterAllowedChars($aFilter["project"], '[a-z0-9\-\_]') . '"';
}
if (array_key_exists("from", $aFilter) && $aFilter["from"]) {
if (isset($aFilter["from"]) && $aFilter["from"]) {
$aWhere[]='`time`>="' . $this->_filterAllowedChars($aFilter["from"], '[0-9\-\ \:]') . '"';
}
if (array_key_exists("to", $aFilter) && $aFilter["to"]) {
if (isset($aFilter["to"]) && $aFilter["to"]) {
$aWhere[]='`time`<="' . $this->_filterAllowedChars($aFilter["to"], '[0-9\-\ \:]') . '"';
}
$sSql.=(count($aWhere) ? 'WHERE '. implode(' AND ', $aWhere) : '');
if (array_key_exists("order", $aFilter) && $aFilter["order"]) {
if (isset($aFilter["order"]) && $aFilter["order"]) {
$sSql.=' ORDER BY ' . $this->_filterAllowedChars($aFilter["order"], '[a-z\`0-9\,\ ]');
} else {
$sSql.=' ORDER BY id DESC ';
}
if (array_key_exists("limit", $aFilter) && $aFilter["limit"]) {
if (isset($aFilter["limit"]) && $aFilter["limit"]) {
$sSql.=' LIMIT ' . $this->_filterAllowedChars($aFilter["limit"], '[0-9\,\ ]');
}
@@ -293,13 +293,13 @@ class Actionlog {
} else {
// write filters as hidden fields
if (array_key_exists("project", $aFilter)){
if (isset($aFilter["project"])){
$aForms["filter"]["form"]['selectproject'] = array(
'type' => 'hidden',
'value' => $aFilter["project"]
);
}
if (array_key_exists("limit", $aFilter)){
if (isset($aFilter["limit"])){
$aForms["filter"]["form"]['selectlimit'] = array(
'type' => 'hidden',
'value' => $aFilter["limit"]
Loading