mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
update logo
This commit is contained in:
parent
7e23b36cbc
commit
e6fe7556df
@ -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)
|
public function getRunningUserTasks($email)
|
||||||
{
|
{
|
||||||
if($email == "") {
|
if($email == "") {
|
||||||
@ -121,6 +126,39 @@ class JsonRequestClientComponent extends Component
|
|||||||
return ['state' => 'success', 'data' => $json];
|
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()
|
static public function getLoginServerUrl()
|
||||||
{
|
{
|
||||||
$loginServer = Configure::read('LoginServer');
|
$loginServer = Configure::read('LoginServer');
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user