-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebprovphonesettings.module
124 lines (94 loc) · 2.49 KB
/
webprovphonesettings.module
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/**
* Endpoint Manager ARI File
*
* @author Andrew Nagy
* @license MPL / GPLv2 / LGPL
* @package Endpoint Manager
*/
/**
* @file
* Functions for the interface to the call monitor recordings
*/
/**
* Class for settings
*/
class webprovphonesettings {
public $module_name = 'webprovphonesettings';
public $extension;
public $root_path;
public $webprov;
public $secret;
public $subdir;
function __construct() {
global $amp_conf;
global $db;
$this->extension = isset($_SESSION['ari_user']['extension']) ? $_SESSION['ari_user']['extension'] : '';
$this->subdir = '/webprov/';
$this->root_path = $amp_conf['AMPWEBROOT'].$this->subdir;
$sql = "SELECT data FROM sip WHERE id = '".$this->extension."' AND keyword = 'secret'";
$this->secret = md5($db->getOne($sql));
if(file_exists($this->root_path.'includes/webprov.php')) {
require_once($this->root_path.'includes/webprov.php');
$this->webprov = NEW webprov();
}
}
/*
* rank (for prioritizing modules)
*/
function rank() {
$rank = 21;
return $rank;
}
/*
* init
*/
function init() {
}
/*
* Adds menu item to nav menu
*
* @param $args
* Common arguments
*/
function navMenu($args) {
$ret .= "<p><small><small><a href='" . $_SESSION['ARI_ROOT'] . "?m=" . $this->module_name . "&f=display'>" . _("Phone Settings") . "</a></small></small></p><br>";
return $ret;
}
/*
* Acts on the user settings
*
* @param $args
* Common arguments
* @param $a
* action
*/
function action($args) {
$ret .= "
<head>
<script>
<!--
window.location = \"" . $_SESSION['ARI_ROOT'] . "?m=" . $this->module_name . "\"
// -->
</script>
</head>";
return $ret;
}
function reloadSettings($exten) {
}
/*
* Displays stats page
*
* @param $args
* Common arguments
*/
function display($args) {
if (!isset($_SESSION['dbh_asterisk'])) {
die('No Database?');
}
$ret = "<iframe src='http://".$_SERVER["HTTP_HOST"].$this->subdir."user.php?ext=".$this->extension."&md5=".$this->secret."' width='900' height='1000' frameborder='0'>
<p>Your browser does not support iframes.</p>
</iframe>";
return($ret);
}
}