- #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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user