IGB Header support implemented

This commit is contained in:
exodus4d
2015-04-25 17:43:42 +02:00
parent fc033ed7c4
commit 2c688e2aa8
38 changed files with 1046 additions and 981 deletions

View File

@@ -170,4 +170,5 @@ class AccessController extends Controller {
return $user;
}
}

View File

@@ -85,5 +85,44 @@ class Controller {
$this->setTemplate('templates/view/login.html');
}
/**
* check weather the page is IGB trusted or not
* @return mixed
*/
static function isIGBTrusted(){
$igbHeaderData = self::getIGBHeaderData();
return $igbHeaderData->trusted;
}
/**
* extract all eve IGB specific header data
* @return object
*/
static function getIGBHeaderData(){
$data = (object) [];
$data->trusted = false;
$data->values = [];
$headerData = apache_request_headers();
foreach($headerData as $key => $value){
if (strpos($key, 'EVE_') === 0) {
$key = str_replace('EVE_', '', $key);
$key = strtolower($key);
if (
$key === 'trusted' &&
$value === 'Yes'
) {
$data->trusted = true;
}
$data->values[$key] = $value;
}
}
return $data;
}
}

View File

@@ -8,7 +8,7 @@
namespace Controller;
class MapController extends Controller {
class MapController extends \Controller\AccessController {
function __construct() {
parent::__construct();
@@ -16,8 +16,11 @@ class MapController extends Controller {
public function showMap() {
$this->setTemplate('templates/view/map.html');
// set trust attribute to template
$this->f3->set('trusted', (int)self::isIGBTrusted());
$this->setTemplate('templates/view/map.html');
}
/**

View File

@@ -305,6 +305,9 @@ class Map extends \Controller\AccessController {
// check if data for specific system is requested
$systemData = (array)$f3->get('POST.systemData');
// update current location (IGB data)
$user->updateCharacterLog();
$userData = (object) [];
// data for the current user
$userData->userData = $user->getData();