-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimedAction.php
More file actions
43 lines (41 loc) · 1.21 KB
/
timedAction.php
File metadata and controls
43 lines (41 loc) · 1.21 KB
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
<?php
require_once("db.php");
require_once("timedActionClass.php");
require_once("sessionAuthentication.php");
define("PARAM_OPERATION", "operation");
define("PARAM_SESSIONID", "sessionid");
define("PARAM_TIME", "time");
//authentikáció sessionid-re
if(isset($_REQUEST[PARAM_SESSIONID])) {
$userid = authenticate($db,$_REQUEST[PARAM_SESSIONID]);
if($userid == null) {
return;
}
}
else return;
if(isset($_REQUEST[PARAM_OPERATION])) {
/*
* Lekérdezi az időigényes interakció adatait
*/
if($_REQUEST[PARAM_OPERATION] == 0) { //get data
$timedAction = new TimedAction($db,$userid);
$res = $timedAction->getData();
echo json_encode($res);
}
/*
* Az időigényes interakció végén kell meghívni
*/
else if($_REQUEST[PARAM_OPERATION] == 1) { //karbantartás - az idő végén kell meghívni
$timedAction = new TimedAction($db,$userid);
$res = $timedAction->refreshData();
echo json_encode($res);
}
/*
* Leállítja az interakciót
*/
else if($_REQUEST[PARAM_OPERATION] == 2) { //timed action törlése
$timedAction = new TimedAction($db,$userid);
$timedAction->stopAction();
}
}
?>