Skip to content
Snippets Groups Projects
Commit d5c460ba authored by Tomasz Wolniewicz's avatar Tomasz Wolniewicz
Browse files

some formatting corrections

parent 7bfcf0dc
Branches
No related tags found
1 merge request!36Merge TW
...@@ -3,14 +3,15 @@ require_once(dirname(__FILE__)."/../lib/config.php"); ...@@ -3,14 +3,15 @@ require_once(dirname(__FILE__)."/../lib/config.php");
require(eduGAIN_config."coco_update.php"); require(eduGAIN_config."coco_update.php");
require_once(TECHNICAL_HOME.'/lib/autoload.php'); require_once(TECHNICAL_HOME.'/lib/autoload.php');
class CoCointerface extends eduGAIN_core{ class CoCointerface extends eduGAIN_core{
public function load_coco() { public function load_coco() {
$j = file_get_contents(COCO_URL.'/json.php?all_sps=true&attributes=id_status;entityID;status'); $j = file_get_contents(COCO_URL.'/json.php?all_sps=true&attributes=id_status;entityID;status');
$e = json_decode($j); $e = json_decode($j);
foreach ($e as $r) foreach ($e as $r) {
if($r->id_status != NULL) if($r->id_status != NULL) {
$this->CoCo[$r->entityID] = array('id'=>$r->id,'code'=>$r->id_status,'msg'=>$r->status); $this->CoCo[$r->entityID] = array('id'=>$r->id,'code'=>$r->id_status,'msg'=>$r->status);
}
}
} }
public $CoCo; public $CoCo;
} }
...@@ -22,8 +23,8 @@ $q = "DELETE FROM coco_stat"; ...@@ -22,8 +23,8 @@ $q = "DELETE FROM coco_stat";
$e->databaseQuery($q); $e->databaseQuery($q);
foreach ($e->CoCo as $e_id => $s) { foreach ($e->CoCo as $e_id => $s) {
$q = "INSERT into coco_stat (entityid,status,msg,coco_id) VALUES ('$e_id'," . $s['code'] . ", \"" . $s['msg'] . "\", " . $s['id'] . ")"; $q = "INSERT into coco_stat (entityid,status,msg,coco_id) VALUES ('$e_id'," . $s['code'] . ", \"" . $s['msg'] . "\", " . $s['id'] . ")";
$e->databaseQuery($q); $e->databaseQuery($q);
} }
?> ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment