diff --git a/ext/log_db/main.php b/ext/log_db/main.php
index 3b1bab40..aef29763 100644
--- a/ext/log_db/main.php
+++ b/ext/log_db/main.php
@@ -49,9 +49,13 @@ class LogDatabase extends Extension {
$args = array();
$page_num = int_escape($event->get_arg(0));
if($page_num <= 0) $page_num = 1;
- if(!empty($_GET["time"])) {
- $wheres[] = "date_sent LIKE :time";
- $args["time"] = $_GET["time"]."%";
+ if(!empty($_GET["time-start"])) {
+ $wheres[] = "date_sent > :time_start";
+ $args["time_start"] = $_GET["time-start"];
+ }
+ if(!empty($_GET["time-end"])) {
+ $wheres[] = "date_sent < :time_end";
+ $args["time_end"] = $_GET["time-end"];
}
if(!empty($_GET["module"])) {
$wheres[] = "section = :module";
@@ -83,6 +87,10 @@ class LogDatabase extends Extension {
$wheres[] = "priority >= :priority";
$args["priority"] = 20;
}
+ if(!empty($_GET["message"])) {
+ $wheres[] = $database->scoreql_to_sql("SCORE_STRNORM(message) LIKE SCORE_STRNORM(:message)");
+ $args["message"] = "%" . $_GET["message"] . "%";
+ }
$where = "";
if(count($wheres) > 0) {
$where = "WHERE ";
diff --git a/ext/log_db/theme.php b/ext/log_db/theme.php
index 0f7ce961..44c98dbf 100644
--- a/ext/log_db/theme.php
+++ b/ext/log_db/theme.php
@@ -20,12 +20,14 @@ class LogDatabaseTheme extends Themelet {
- Time | Module | User | Message |
+ Time | Module | User | Message |
";
@@ -65,21 +67,28 @@ class LogDatabaseTheme extends Themelet {
$page->set_heading("Event Log");
$page->add_block(new NavBlock());
$page->add_block(new Block("Events", $table));
+ $this->display_paginator($page, "log/view", $this->get_args(), $page_num, $page_total);
+ }
+ protected function get_args() {
$args = "";
// Check if each arg is actually empty and skip it if so
- if(strlen($this->ueie("time")))
- $args .= $this->ueie("time")."&";
- if(strlen($this->ueie("module")))
- $args .= $this->ueie("module")."&";
- if(strlen($this->ueie("user")))
- $args .= $this->ueie("user")."&";
- if(strlen($this->ueie("priority")))
- $args .= $this->ueie("priority");
+ if(strlen($this->ueie("time-start")))
+ $args .= $this->ueie("time-start")."&";
+ if(strlen($this->ueie("time-end")))
+ $args .= $this->ueie("time-end")."&";
+ if(strlen($this->ueie("module")))
+ $args .= $this->ueie("module")."&";
+ if(strlen($this->ueie("user")))
+ $args .= $this->ueie("user")."&";
+ if(strlen($this->ueie("message")))
+ $args .= $this->ueie("message")."&";
+ if(strlen($this->ueie("priority")))
+ $args .= $this->ueie("priority");
// If there are no args at all, set $args to null to prevent an unnecessary ? at the end of the paginator url
if(strlen($args) == 0)
$args = null;
- $this->display_paginator($page, "log/view", $args, $page_num, $page_total);
+ return $args;
}
protected function pri_to_col($pri) {