diff --git a/src/Controller/Component/JsonRequestClientComponent.php b/src/Controller/Component/JsonRequestClientComponent.php index 8a071b70b..4132894eb 100644 --- a/src/Controller/Component/JsonRequestClientComponent.php +++ b/src/Controller/Component/JsonRequestClientComponent.php @@ -41,6 +41,11 @@ class JsonRequestClientComponent extends Component } + public function findePublicKeyForEmailHash($emailHash) { + //'ask' = ['account_publickey' => ''] + $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'); diff --git a/webroot/img/logo_schrift_half.png b/webroot/img/logo_schrift_half.png deleted file mode 100644 index 5dfb1b3ac..000000000 Binary files a/webroot/img/logo_schrift_half.png and /dev/null differ diff --git a/webroot/img/logo_schrift_half.webp b/webroot/img/logo_schrift_half.webp deleted file mode 100644 index fa7d49642..000000000 Binary files a/webroot/img/logo_schrift_half.webp and /dev/null differ