Merge branch 'development'
#Conflicts: # cronjob.php
This commit is contained in:
38
cronjob.php
38
cronjob.php
@@ -5,6 +5,12 @@ include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
include_once './settings/config.php';
|
||||
|
||||
if (debug && debug_id == $_SESSION['id']){
|
||||
ini_set('display_errors', '1');
|
||||
ini_set('display_startup_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// check for security_code if not exit +++++++++++++++++++
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@@ -56,12 +62,17 @@ foreach ($communications as $communication){
|
||||
$token ='';
|
||||
|
||||
$data = json_encode(array("username" => interface_user, "password" => interface_pw), JSON_UNESCAPED_UNICODE);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> development
|
||||
//Secure data
|
||||
$payload = generate_payload($data);
|
||||
//API call
|
||||
$responses = ioServer('/v1/authorization', $payload);
|
||||
//Decode Payload
|
||||
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = '400';}
|
||||
<<<<<<< HEAD
|
||||
|
||||
if ($responses === 'NOK' || $responses === '400'){
|
||||
//Not allowed
|
||||
@@ -87,6 +98,33 @@ storeMeasurementProduct($total_results, $token);
|
||||
storeMeasurementEquipment('');
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=======
|
||||
|
||||
if ($responses === 'NOK' || $responses === '400'){
|
||||
//Not allowed
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
// Store data in session
|
||||
$token = $responses->userkey;
|
||||
}
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// close Contracts ++++++++++++++
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
closeContract();
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// Machine learning ++++++++++++++
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
$total_measurement = traintotalMeasurement();
|
||||
$total_results = statisticalAnalyses($total_measurement);
|
||||
storeMeasurementProduct($total_results, $token);
|
||||
storeMeasurementEquipment('');
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
>>>>>>> development
|
||||
// GeoUpdate ++++++++++++++
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
geolocationUpdate($token);
|
||||
|
||||
@@ -16,5 +16,5 @@ define('distribution','');
|
||||
/*Firmware*/
|
||||
define('firmware','firmwaretool,application');
|
||||
/*Interface*/
|
||||
define('interface','application');
|
||||
define('interface','equipments,products_versions,application');
|
||||
?>
|
||||
Reference in New Issue
Block a user