- #84, #138 improved "character selection" on login page (expired cookies are deleted, character panel layout improvements)

- added new "Server info panel" to the login page
- added new cronjob to delete expired cookie authentication data
This commit is contained in:
Exodus4D
2016-05-02 17:30:26 +02:00
parent ef8f5666aa
commit 8900276cf5
16 changed files with 440 additions and 93 deletions

View File

@@ -429,7 +429,7 @@ class Sso extends Api\User{
* @param array $additionalOptions
* @return mixed|null
*/
protected function getEndpoints($accessToken, $additionalOptions = []){
protected function getEndpoints($accessToken = '', $additionalOptions = []){
$crestUrl = self::getCrestEndpoint();
$additionalOptions['contentType'] = 'application/vnd.ccp.eve.Api-v3+json';
$endpoint = $this->getEndpoint($accessToken, $crestUrl, $additionalOptions);
@@ -645,6 +645,44 @@ class Sso extends Api\User{
return $characterModel;
}
/**
* get CREST server status (online/offline)
* @return \stdClass object
*/
public function getCrestServerStatus(){
$endpoints = $this->getEndpoints();
// set default status e.g. Endpoints don´t work
$data = (object) [];
$data->crestOffline = true;
$data->serverName = 'EVE ONLINE';
$data->serviceStatus = [
'eve' => 'offline',
'server' => 'offline',
];
$data->userCounts = [
'eve' => 0
];
$endpoint = $this->walkEndpoint('', $endpoints, ['serverName']);
if( !empty($endpoint) ){
$data->crestOffline = false;
$data->serverName = (string) $endpoint;
}
$endpoint = $this->walkEndpoint('', $endpoints, ['serviceStatus']);
if( !empty($endpoint) ){
$data->crestOffline = false;
$data->serviceStatus = (new Mapper\CrestServiceStatus($endpoint))->getData();
}
$endpoint = $this->walkEndpoint('', $endpoints, ['userCounts']);
if( !empty($endpoint) ){
$data->crestOffline = false;
$data->userCounts = (new Mapper\CrestUserCounts($endpoint))->getData();
}
return $data;
}
/**
* check response "Header" data for errors
* @param $headers