Skip to content

Commit

Permalink
Make external cron calls RESTful compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
protich committed Feb 14, 2013
1 parent a407945 commit 45eae75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$dispatcher = patterns('',
url_post("^/tickets\.(?P<format>xml|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'))
))
);

Expand Down
2 changes: 2 additions & 0 deletions setup/scripts/rcron.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
Expand Down

0 comments on commit 45eae75

Please sign in to comment.