Skip to content

Commit

Permalink
Merge pull request #878 from greezybacon/issue/ticket-lock-lookup
Browse files Browse the repository at this point in the history
Fix parameter count to TicketLock::lookup

Reviewed-By: Peter Rotich <peter@osticket.com>
  • Loading branch information
protich committed Jan 18, 2014
2 parents 5e8e233 + d8c001e commit 6c5921c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/ajax.tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function search() {
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))
Expand All @@ -218,10 +218,10 @@ function acquireLock($tid) {
function renewLock($tid, $id) {
global $thisstaff;

if(!$id or !is_numeric($id) or !$thisstaff)
if(!$tid || !is_numeric($tid) || !$id || !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

Expand Down

0 comments on commit 6c5921c

Please sign in to comment.