Created
October 29, 2013 20:23
-
-
Save ktsosno/7221904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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