update logo

This commit is contained in:
Dario Rekowski on RockPI 2020-09-30 11:08:02 +00:00 committed by Ulf Gebhardt
parent 7e23b36cbc
commit e6fe7556df
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
3 changed files with 38 additions and 0 deletions

View File

@ -41,6 +41,11 @@ class JsonRequestClientComponent extends Component
}
public function findePublicKeyForEmailHash($emailHash) {
//'ask' = ['account_publickey' => '<email_blake2b_base64>']
$results = $this->sendRequestLoginServerNeighbors(json_encode(['ask' => ['account_publickey' => $emailHash]]), 'search');
}
public function getRunningUserTasks($email)
{
if($email == "") {
@ -121,6 +126,39 @@ class JsonRequestClientComponent extends Component
return ['state' => 'success', 'data' => $json];
}
public function sendRequestLoginServerNeighbors($transactionBody, $url) {
$http = new Client();
if(!Configure::check('NeighborLoginServers')) {
return ['state' => 'warning', 'msg' => 'no neighbor server configured'];
}
$nServers = Configure::read('NeighborLoginServers');
$results = ['errors' => [], 'data' => []];
foreach($nServers as $nServer) {
$full_url = $nServer['host'] . ':' . $nServer['port'] . '/' . $url;
$response = $http->post($full_url, $transactionBody, ['type' => 'json']);
$responseStatus = $response->getStatusCode();
if($responseStatus != 200) {
$results['errors'][] = [
'state' => 'error',
'type' => 'request error',
'msg' => 'server response status code isn\'t 200',
'details' => $responseStatus,
'fullUrl' => $full_url
];
continue;
}
$json = $response->getJson();
if($json == null) {
//$responseType = $response->getType();
$results['errors'][] = ['state' => 'error', 'type' => 'request error', 'msg' => 'server response isn\'t valid json'];
continue;
}
$results['data'][] = $json;
}
return $results;
}
static public function getLoginServerUrl()
{
$loginServer = Configure::read('LoginServer');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB