From 45eae75271b380cf8b736843f012aa0d8b13ba73 Mon Sep 17 00:00:00 2001 From: Peter Rotich Date: Wed, 13 Feb 2013 23:16:57 -0500 Subject: [PATCH] Make external cron calls RESTful compliant --- api/http.php | 2 +- setup/scripts/rcron.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/http.php b/api/http.php index fce841e7..14eeecd4 100644 --- a/api/http.php +++ b/api/http.php @@ -21,7 +21,7 @@ $dispatcher = patterns('', url_post("^/tickets\.(?Pxml|json|email)$", array('api.tickets.php:TicketApiController','create')), url('^/task/', patterns('', - url_get("^cron$", array('api.cron.php:CronApiController', 'execute')) + url_post("^cron$", array('api.cron.php:CronApiController', 'execute')) )) ); diff --git a/setup/scripts/rcron.php b/setup/scripts/rcron.php index fb1d4b1c..53c2da00 100755 --- a/setup/scripts/rcron.php +++ b/setup/scripts/rcron.php @@ -34,6 +34,8 @@ function_exists('curl_version') or die('CURL support required'); #curl post $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $config['url']); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_POSTFIELDS, ''); curl_setopt($ch, CURLOPT_USERAGENT, 'osTicket API Client v1.7'); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Expect:', 'X-API-Key: '.$config['key']));