Skip to content
Snippets Groups Projects
Commit 78b16752 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge remote branch 'upstream/develop' into develop

parents 9ae093da c4669d77
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,7 @@ class UsersAjaxAPI extends AjaxController { ...@@ -77,6 +77,7 @@ class UsersAjaxAPI extends AjaxController {
'emails__address__contains' => $q, 'emails__address__contains' => $q,
'name__contains' => $q, 'name__contains' => $q,
'org__name__contains' => $q, 'org__name__contains' => $q,
'cdata__phone__contains' => $q,
))); )));
} }
......
...@@ -51,6 +51,11 @@ class Cron { ...@@ -51,6 +51,11 @@ class Cron {
AttachmentFile::deleteOrphans(); AttachmentFile::deleteOrphans();
} }
function CleanExpiredSessions() {
require_once(INCLUDE_DIR.'class.ostsession.php');
DbSessionBackend::cleanup();
}
function MaybeOptimizeTables() { function MaybeOptimizeTables() {
// Once a week on a 5-minute cron // Once a week on a 5-minute cron
$chance = rand(1,2000); $chance = rand(1,2000);
...@@ -100,6 +105,7 @@ class Cron { ...@@ -100,6 +105,7 @@ class Cron {
self::MailFetcher(); self::MailFetcher();
self::TicketMonitor(); self::TicketMonitor();
self::PurgeLogs(); self::PurgeLogs();
self::CleanExpiredSessions();
// Run file purging about every 10 cron runs // Run file purging about every 10 cron runs
if (mt_rand(1, 9) == 4) if (mt_rand(1, 9) == 4)
self::CleanOrphanedFiles(); self::CleanOrphanedFiles();
......
...@@ -158,6 +158,10 @@ abstract class SessionBackend { ...@@ -158,6 +158,10 @@ abstract class SessionBackend {
return $this->update($id, $i['touched'] ? session_encode() : $data); return $this->update($id, $i['touched'] ? session_encode() : $data);
} }
function cleanup() {
$this->gc(0);
}
abstract function read($id); abstract function read($id);
abstract function update($id, $data); abstract function update($id, $data);
abstract function destroy($id); abstract function destroy($id);
...@@ -220,6 +224,10 @@ extends SessionBackend { ...@@ -220,6 +224,10 @@ extends SessionBackend {
return SessionData::objects()->filter(['session_id' => $id])->delete(); return SessionData::objects()->filter(['session_id' => $id])->delete();
} }
function cleanup() {
self::gc(0);
}
function gc($maxlife){ function gc($maxlife){
SessionData::objects()->filter([ SessionData::objects()->filter([
'session_expire__lte' => SqlFunction::NOW() 'session_expire__lte' => SqlFunction::NOW()
......
...@@ -1246,6 +1246,8 @@ class Task extends TaskModel implements RestrictedAccess, Threadable { ...@@ -1246,6 +1246,8 @@ class Task extends TaskModel implements RestrictedAccess, Threadable {
$thisstaff); $thisstaff);
} }
$this->updated = SqlFunction::NOW();
if ($changes) if ($changes)
$this->logEvent('edited', array('fields' => $changes)); $this->logEvent('edited', array('fields' => $changes));
......
...@@ -268,7 +268,7 @@ if ($task->isOverdue()) ...@@ -268,7 +268,7 @@ if ($task->isOverdue())
<?php <?php
foreach ($actions as $action) {?> foreach ($actions as $action) {?>
<span class="action-button <?php echo $action['class'] ?: ''; ?>"> <span class="action-button <?php echo $action['class'] ?: ''; ?>">
<a class="task-action" <a class="<?php echo ($action['class'] == 'no-pjax') ? '' : 'task-action'; ?>"
<?php <?php
if ($action['dialog']) if ($action['dialog'])
echo sprintf("data-dialog-config='%s'", $action['dialog']); echo sprintf("data-dialog-config='%s'", $action['dialog']);
......
...@@ -14,6 +14,7 @@ if ($_REQUEST['query']) { ...@@ -14,6 +14,7 @@ if ($_REQUEST['query']) {
'emails__address__contains' => $search, 'emails__address__contains' => $search,
'name__contains' => $search, 'name__contains' => $search,
'org__name__contains' => $search, 'org__name__contains' => $search,
'cdata__phone__contains' => $search,
// TODO: Add search for cdata // TODO: Add search for cdata
))); )));
$qs += array('query' => $_REQUEST['query']); $qs += array('query' => $_REQUEST['query']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment