Skip to content
Snippets Groups Projects
Commit 526bdd17 authored by Rasmus Fuhse's avatar Rasmus Fuhse Committed by Elmar Ludwig
Browse files

re #793

parent 119d9682
No related branches found
No related tags found
No related merge requests found
...@@ -89,14 +89,14 @@ class Oer_EndpointsController extends StudipController ...@@ -89,14 +89,14 @@ class Oer_EndpointsController extends StudipController
protected function refreshHost($url) protected function refreshHost($url)
{ {
$host = OERHost::findOneByUrl($url);
if (!$host) {
return;
}
$host_data = file_get_contents($url."fetch_public_host_key"); $host_data = file_get_contents($url."fetch_public_host_key");
if ($host_data) { if ($host_data) {
$host_data = json_decode($host_data, true); $host_data = json_decode($host_data, true);
if ($host_data) { if ($host_data) {
$host = OERHost::findOneByUrl($url);
if (!$host) {
$host = new OERHost();
}
$host['name'] = $host_data['name']; $host['name'] = $host_data['name'];
$host['url'] = Request::get("from"); $host['url'] = Request::get("from");
$host['public_key'] = $host_data['public_key']; $host['public_key'] = $host_data['public_key'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment