Skip to content

Instantly share code, notes, and snippets.

@ktsosno
Created October 29, 2013 20:23
Show Gist options
  • Save ktsosno/7221904 to your computer and use it in GitHub Desktop.
Save ktsosno/7221904 to your computer and use it in GitHub Desktop.
<?php
require_once(APPPATH.'controllers/bright.php');
require_once(APPPATH.'controllers/rest_controller.php');
class API_Quinstreet extends REST_Controller
{
const API_KEY = '32b5f47678285210d925c4a78e0af10531566a71';
public function __construct()
{
$this->_encryption_required = false;
parent::__construct();
if(!$this->is_https()) {
if(config('env_type') == 'prod') {
$this->response('HTTPS only.', 301);
}
}
}
/**
* Tracking end point for the iFrame setup
*
*/
public function track_event_get()
{
die('go');
$key = (string)$_POST['api_key'];
if($key != API_KEY) {
$this->response('Invalid key.', 301);
}
$fields = array();
foreach($_POST as $k => $v) {
$fields['quinstreet.' . $k] = Validate::filter($v, F_AUTO);
}
print_r($fields);
die();
//Log::info("QuinStreet: Tracking Event", $fields);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment