-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.php
47 lines (37 loc) · 1.21 KB
/
action.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once("db.inc.php");
require_once('authenticate_tools.inc.php');
session_start();
db_connect($servername,marmottedbname,$serverlogin,$serverpassword);
if(isset($_SESSION['REMOTE_USER']) && ($_SESSION['REMOTE_USER'] != ''))
addCredentials($_SESSION['REMOTE_USER'], "",true);
if(!authenticate())
{
removeCredentials();
$data = array('type' => 'error', 'message' => 'Mauvaise authentification');
header('HTTP/1.1 400 Bad Request');
header('Content-Type: application/json; charset=UTF-8');
echo json_encode($data);
die(0);
}
require_once('manage_rapports.inc.php');
require_once('manage_people.inc.php');
$action = isset($_POST['action']) ? $_POST['action'] : '?';
switch($action)
{
case 'set_property':
$property = $_POST['property'];
$id_origine = $_POST['id_origine'];
$value = $_POST['value'];
set_property($property,$id_origine, $value, strpos($property,"rapp") != FALSE);
echo "set property '".$property."' with value '".$value."' for report '".$id_origine."'";
break;
case 'set_people_property':
$property = $_REQUEST["property"];
$numsirhus = $_REQUEST["numsirhus"];
$value = $_REQUEST["value"];
set_people_property($property,$numsirhus, $value);
break;
}
db_disconnect();
?>