mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Added function to get errors from CastTimeServer
This commit is contained in:
@@ -1097,4 +1097,42 @@ function PersonLog($person_id, $logtype_kurzbz, $logdata, $taetigkeit_kurzbz, $a
|
|||||||
$personlog = new personlog();
|
$personlog = new personlog();
|
||||||
$personlog->log($person_id, $logtype_kurzbz, $logdata, $taetigkeit_kurzbz, $app, $oe_kurzbz, $user);
|
$personlog->log($person_id, $logtype_kurzbz, $logdata, $taetigkeit_kurzbz, $app, $oe_kurzbz, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sendet einen Request an den CaseTime Server um die Daten dort zu speichern
|
||||||
|
*/
|
||||||
|
function getCaseTimeErrors($uid)
|
||||||
|
{
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
$url = CASETIME_SERVER.'/sync/get_zeitfehler';
|
||||||
|
|
||||||
|
$params = 'sachb='.$uid;
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url.'?'.$params ); //Url together with parameters
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Return data instead printing directly in Browser
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 7); //Timeout after 7 seconds
|
||||||
|
curl_setopt($ch, CURLOPT_USERAGENT , "FH-Complete CaseTime Addon");
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
|
|
||||||
|
$result = curl_exec($ch);
|
||||||
|
|
||||||
|
if(curl_errno($ch))
|
||||||
|
{
|
||||||
|
return 'Curl error: ' . curl_error($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curl_close($ch);
|
||||||
|
$data = json_decode($result);
|
||||||
|
|
||||||
|
if(isset($data->STATUS) && $data->STATUS=='OK')
|
||||||
|
{
|
||||||
|
return $data->RESULT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user