generated from jric11/baseProject
Chat's updates for security, db and workflow
Security and workflow regressions / regression (push) Has been cancelled
Security and workflow regressions / regression (push) Has been cancelled
This commit is contained in:
+10
-23
@@ -27,7 +27,7 @@ class Journal extends Base {
|
||||
$this->current_user_name = $_SESSION[self::USER_NAME] ?? "";
|
||||
$this->current_user_email = $_SESSION[self::USER_EMAIL] ?? "";
|
||||
|
||||
$this->pagination_page = $_SESSION[self::PAGINATION_PAGE] ?? 1;
|
||||
$this->pagination_page = 1;
|
||||
|
||||
}
|
||||
|
||||
@@ -37,12 +37,8 @@ class Journal extends Base {
|
||||
|
||||
public function clearJournal() {
|
||||
|
||||
$SQL = "truncate journal";
|
||||
|
||||
$this->executeSQL($SQL);
|
||||
|
||||
$this->journalEntry("Journal was Cleared.");
|
||||
|
||||
throw new AppException('Audit history cannot be cleared through the application.',403);
|
||||
|
||||
}
|
||||
|
||||
// =======================
|
||||
@@ -70,7 +66,7 @@ class Journal extends Base {
|
||||
// Find Criteria
|
||||
|
||||
$find_journal = filter_input(INPUT_POST, "find_journal") ?: "";
|
||||
$find_words = $this->sanitizeString($find_journal);
|
||||
$find_words = preg_quote(trim($find_journal));
|
||||
|
||||
// Show Per Page
|
||||
|
||||
@@ -103,19 +99,10 @@ class Journal extends Base {
|
||||
// Pagination
|
||||
|
||||
$pagination = filter_input(INPUT_POST, "pagination") ?: "";
|
||||
|
||||
switch ($pagination) {
|
||||
|
||||
case "first" : $this->pagination_page = 1; break;
|
||||
case "previous" : $this->pagination_page = max(($this->pagination_page - 1), 1); break;
|
||||
case "next" : $this->pagination_page = ($this->pagination_page + 1); break;
|
||||
case "last" : $this->pagination_page = ($count / $this->pagination_size); break;
|
||||
|
||||
}
|
||||
|
||||
$offset = (($this->pagination_page * $this->pagination_size) - $this->pagination_size);
|
||||
$start = ($offset + 1);
|
||||
$end = min($count, (($start + $this->pagination_size) - 1));
|
||||
|
||||
$paging=Pagination::session(__METHOD__,$count,(int)$this->pagination_size,$pagination);
|
||||
$this->pagination_size=$paging['size'];$this->pagination_page=$paging['page'];
|
||||
$offset=$paging['offset'];$start=$paging['start'];$end=$paging['end'];
|
||||
|
||||
// Data
|
||||
|
||||
@@ -125,6 +112,7 @@ class Journal extends Base {
|
||||
or journal_origin regexp :journal_origin
|
||||
or journal_ip regexp :journal_ip
|
||||
or journal_entry regexp :journal_entry
|
||||
order by journal_timestamp DESC,journal_serial DESC
|
||||
limit {$this->pagination_size}
|
||||
offset {$offset}";
|
||||
|
||||
@@ -145,8 +133,7 @@ class Journal extends Base {
|
||||
$journal->addAttribute("start", $start);
|
||||
$journal->addAttribute("end", $end);
|
||||
$journal->addAttribute("page", $this->pagination_page);
|
||||
|
||||
$_SESSION[self::PAGINATION_PAGE] = $this->pagination_page;
|
||||
|
||||
|
||||
return $journal;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user