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

adding CoCo daily update scripts

parent c6548654
No related branches found
No related tags found
3 merge requests!3Align master branch with twoln-dev,!2Synchronising towards version 2.5,!1Twoln dev
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
<?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);
}
?>
#!/bin/bash
cd /var/www/html/technical/scripts; /usr/bin/php CoCointerface.php 1> /dev/null 2>>/var/log/coco_error.log
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment