Skip to content
Snippets Groups Projects

Twoln dev

Closed Tomasz Wolniewicz requested to merge twoln-dev into master
2 files
+ 33
0
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 30
0
<?php
require_once(dirname(__FILE__)."/../lib/config.php");
require(eduGAIN_config."coco_update.php");
require_once(TECHNICAL_HOME.'/lib/autoload.php');
class CoCointerface extends eduGAIN_core{
public function load_coco() {
$j = file_get_contents(COCO_URL.'/json.php?all_sps=true&attributes=id_status;entityID;status');
$e = json_decode($j);
foreach ($e as $r)
if($r->id_status != NULL)
$this->CoCo[$r->entityID] = array('id'=>$r->id,'code'=>$r->id_status,'msg'=>$r->status);
}
public $CoCo;
}
$e = new CoCointerface();
$e->load_coco();
$q = "DELETE FROM coco_stat";
$e->databaseQuery($q);
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'] . ")";
$e->databaseQuery($q);
}
?>
Loading