diff --git a/include/ajax.users.php b/include/ajax.users.php index f58680fc17216d465fda0aafc7e97dd7fc5ae7f4..07fc02f7917db0501cd0b949face1bd3042ddfc2 100644 --- a/include/ajax.users.php +++ b/include/ajax.users.php @@ -77,6 +77,7 @@ class UsersAjaxAPI extends AjaxController { 'emails__address__contains' => $q, 'name__contains' => $q, 'org__name__contains' => $q, + 'cdata__phone__contains' => $q, ))); } diff --git a/include/class.cron.php b/include/class.cron.php index e545c5afb7acddf48a97f6e9c0b05b252c5ac116..232d6bf2bee90bad3824e238ee77812ee411a187 100644 --- a/include/class.cron.php +++ b/include/class.cron.php @@ -51,6 +51,11 @@ class Cron { AttachmentFile::deleteOrphans(); } + function CleanExpiredSessions() { + require_once(INCLUDE_DIR.'class.ostsession.php'); + DbSessionBackend::cleanup(); + } + function MaybeOptimizeTables() { // Once a week on a 5-minute cron $chance = rand(1,2000); @@ -100,6 +105,7 @@ class Cron { self::MailFetcher(); self::TicketMonitor(); self::PurgeLogs(); + self::CleanExpiredSessions(); // Run file purging about every 10 cron runs if (mt_rand(1, 9) == 4) self::CleanOrphanedFiles(); diff --git a/include/class.ostsession.php b/include/class.ostsession.php index dbb5cf6312551abc4e24e4eb905eca53e0a74188..51f8bd2fc5e934dd2b67e95518999959fdbedb30 100644 --- a/include/class.ostsession.php +++ b/include/class.ostsession.php @@ -158,6 +158,10 @@ abstract class SessionBackend { return $this->update($id, $i['touched'] ? session_encode() : $data); } + function cleanup() { + $this->gc(0); + } + abstract function read($id); abstract function update($id, $data); abstract function destroy($id); @@ -220,6 +224,10 @@ extends SessionBackend { return SessionData::objects()->filter(['session_id' => $id])->delete(); } + function cleanup() { + self::gc(0); + } + function gc($maxlife){ SessionData::objects()->filter([ 'session_expire__lte' => SqlFunction::NOW() diff --git a/include/class.task.php b/include/class.task.php index 4b98ff1d4a861ff9d3cab3ed906fc3ae12db34d6..5279dc8c7d0ec891e41aa36e9cffebe4fc30549a 100644 --- a/include/class.task.php +++ b/include/class.task.php @@ -1246,6 +1246,8 @@ class Task extends TaskModel implements RestrictedAccess, Threadable { $thisstaff); } + $this->updated = SqlFunction::NOW(); + if ($changes) $this->logEvent('edited', array('fields' => $changes)); diff --git a/include/staff/templates/task-view.tmpl.php b/include/staff/templates/task-view.tmpl.php index b2dff125312309c5493da4ec93d4edac0edd78ce..0fe384b58e78a58fedf0c631e6334fd213046b29 100644 --- a/include/staff/templates/task-view.tmpl.php +++ b/include/staff/templates/task-view.tmpl.php @@ -268,7 +268,7 @@ if ($task->isOverdue()) <?php foreach ($actions as $action) {?> <span class="action-button <?php echo $action['class'] ?: ''; ?>"> - <a class="task-action" + <a class="<?php echo ($action['class'] == 'no-pjax') ? '' : 'task-action'; ?>" <?php if ($action['dialog']) echo sprintf("data-dialog-config='%s'", $action['dialog']); diff --git a/include/staff/users.inc.php b/include/staff/users.inc.php index afb54e57b51daeb501d6340d22e5052a3ff193f7..5d35e3f277a50c1d6dfabaabe2005cbeb1631cb6 100644 --- a/include/staff/users.inc.php +++ b/include/staff/users.inc.php @@ -14,6 +14,7 @@ if ($_REQUEST['query']) { 'emails__address__contains' => $search, 'name__contains' => $search, 'org__name__contains' => $search, + 'cdata__phone__contains' => $search, // TODO: Add search for cdata ))); $qs += array('query' => $_REQUEST['query']);