From 8c482588d52aa2fe5e6f1e0db061a5d8434f855f Mon Sep 17 00:00:00 2001
From: clonemeagain <clonemeagain@gmail.com>
Date: Mon, 23 Dec 2013 12:07:32 +1100
Subject: [PATCH] Adds missing argument for Ticket::lookup for ajax.

Couldn't find the rebase to this.. actually, I didn't look, I'm still struggling with git and eclipse, would probably have been easier with vim! Anyway, rewrote changes for 1.7.
---
 include/ajax.tickets.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index 34c46325e..b0089b1dc 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -191,7 +191,7 @@ class TicketsAjaxAPI extends AjaxController {
     function acquireLock($tid) {
         global $cfg,$thisstaff;
 
-        if(!$tid or !is_numeric($tid) or !$thisstaff or !$cfg or !$cfg->getLockTime())
+        if(!$tid || !is_numeric($tid) || !$thisstaff || !$cfg || !$cfg->getLockTime())
             return 0;
 
         if(!($ticket = Ticket::lookup($tid)) || !$ticket->checkStaffAccess($thisstaff))
@@ -218,10 +218,10 @@ class TicketsAjaxAPI extends AjaxController {
     function renewLock($tid, $id) {
         global $thisstaff;
 
-        if(!$id or !is_numeric($id) or !$thisstaff)
+        if(!$tid || !is_numeric($tid) || !is_numeric($id) || !$thisstaff)
             return $this->json_encode(array('id'=>0, 'retry'=>true));
 
-        $lock= TicketLock::lookup($id);
+        $lock= TicketLock::lookup($id, $tid);
         if(!$lock || !$lock->getStaffId() || $lock->isExpired()) //Said lock doesn't exist or is is expired
             return self::acquireLock($tid); //acquire the lock
 
-- 
GitLab