-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsettings.php
40 lines (32 loc) · 1.4 KB
/
settings.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
<?php
//
// Copyright (C) 2014-2065 FreePBX-Swiss Urs Rueedi
//
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Origin: *');
//Access-Control-Allow-Headers: Content-Type, Depth, User-Agent, X-Http-Method-Override, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-control, X-Auth-Token, If-Match');
//header('Access-Control-Expose-Headers: Content-Type, X-Auth-Token, X-Request-ID, Location, Etag, ETag');
// handle som restrictions about kazoo
$headers = getallheaders();
if($headers['Access-Control-Request-Headers']) {
header('Content-Type: text/html; charset=UTF-8');
header('Access-Control-Allow-Headers:accept, content-type, x-auth-token, x-kazoo-cluster-id');
// header('access-control-allow-headers: content-type,x-auth-token');
header('Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD');
header('Allow: GET');
} else {
header('Content-Type: application/json');
header('Access-Control-Allow-Headers: content-type,x-auth-token');
header('Vary: Accept');
}
$path = explode("?",$_SERVER['REQUEST_URI']);
$paths = explode("/",$path[0]);
// disable debug if user_agent %=% snom
if(preg_match("/snom/i",$_SERVER["HTTP_USER_AGENT"])) @define('DEBUG_FUNCTION' , '');
require_once('config.php');
$host = get_dbhost($hosts);
$sag = new Sag($host, $dbport);
$myip4 = get_ip(4);
//show_debug();
get_groundsettings($paths);
?>