-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod.requestfinish.php
More file actions
64 lines (58 loc) · 1.79 KB
/
Copy pathmethod.requestfinish.php
File metadata and controls
64 lines (58 loc) · 1.79 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
#----------------------------------------------------------------------
# Module: Booker - a resource booking module
# Method: requestfinish
# Request or record booking and send messages
#----------------------------------------------------------------------
# See file Booker.module.php for full details of copyright, licence, etc.
#----------------------------------------------------------------------
/*
if (!function_exists('http_response_code')) { //PHP<5.4
//see http://php.net/manual/en/function.http-response-code.php
function http_response_code($code)
{
switch ($code) {
case 200: $text = 'OK'; break;
case 401: $text = 'Unauthorized'; break;
case 403: $text = 'Forbidden'; break;
case 404: $text = 'Not Found'; break;
case 405: $text = 'Method Not Allowed'; break;
case 406: $text = 'Not Acceptable'; break;
default: $code = NULL; break;
}
if ($code !== NULL) {
$protocol = ((!empty($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
header($protocol.' '.$code.' '.$text);
$GLOBALS['http_response_code'] = $code;
}
}
}
*/
$utils = new Booker\Utils();
$newparms = $params;
if (!empty($params['paramskey'])) {
$olds = json_decode($params['paramskey']);
unset($params['paramskey']);
if ($olds) {
$arr = (array)$olds;
$utils->UnFilterParameters($arr);
$newparms = array_merge($newparms,$arr);
}
}
$funcs = new Booker\Requestops();
list($res,$msg) = $funcs->FinishReq($mod,$utils,$newparms,!empty($newparms['result']));
if ($msg) {
if (!empty($params['message'])) {
$params['message'] .= '<br />'.$msg;
} else {
$params['message'] = $msg;
}
}
unset($params['result']); //CHECKME relevance for return?
if (isset($olds)) {
$params = array_merge($params,(array)$olds);
}
/*
http_response_code(200); //always signal success to webhook-source
exit;
*/