From ecb9178f24f5dd1ddbba06776d0f583a42ba2998 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Fri, 20 Jul 2012 12:29:48 -0400
Subject: [PATCH] Remove unnecesarry functions/calls

---
 include/ajax.tickets.php | 6 ------
 include/class.ajax.php   | 4 ----
 2 files changed, 10 deletions(-)

diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index 46df9eb23..b402d6efc 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -181,8 +181,6 @@ class TicketsAjaxAPI extends AjaxController {
     function acquireLock($tid) {
         global $cfg,$thisstaff;
 
-        $this->csrf_protect();
-        
         if(!$tid or !is_numeric($tid) or !$thisstaff or !$cfg) 
             return 0;
        
@@ -216,8 +214,6 @@ class TicketsAjaxAPI extends AjaxController {
     function renewLock($tid, $id) {
         global $thisstaff;
 
-        $this->csrf_protect();
-
         if(!$id or !is_numeric($id) or !$thisstaff)
             return $this->json_encode(array('id'=>0, 'retry'=>true));
        
@@ -237,8 +233,6 @@ class TicketsAjaxAPI extends AjaxController {
     function releaseLock($tid, $id=0) {
         global $thisstaff;
 
-        $this->csrf_protect();
-
         if($id && is_numeric($id)){ //Lock Id provided!
         
             $lock = TicketLock::lookup($id, $tid);
diff --git a/include/class.ajax.php b/include/class.ajax.php
index 5870f8039..0240d91f8 100644
--- a/include/class.ajax.php
+++ b/include/class.ajax.php
@@ -51,10 +51,6 @@ class AjaxController extends ApiController {
         return $this->json_encode($what);
     }
 
-    function csrf_protect() {
-        csrf_ensure_cookie();
-    }
-
     function get($var, $default=null) {
         return (isset($_GET[$var])) ? $_GET[$var] : $default;
     }
-- 
GitLab