forked from tm1000/freepbx-simple-endpointmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
31 lines (23 loc) · 1.03 KB
/
user.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
<?php
require_once 'includes/provisioner/samples/json.php';
$bootstrap_settings['freepbx_auth'] = false;
if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
include_once('/etc/asterisk/freepbx.conf');
}
include('includes/webprov.php');
?>
<link rel="stylesheet" href="/recordings/theme/main.css" type="text/css" />
<?php
$prov = new webprov();
$ext = isset($_REQUEST['ext']) ? $_REQUEST['ext'] : '';
$md5web = isset($_REQUEST['md5']) ? $_REQUEST['md5'] : '';
$sql = "SELECT data FROM sip WHERE id = '".$ext."' AND keyword = 'secret'";
$md5secret = md5($prov->db->getOne($sql));
if ($md5secret == $md5web) {
$sql = "SELECT simple_endpointman_mac_list.mac FROM simple_endpointman_mac_list, simple_endpointman_line_list WHERE simple_endpointman_mac_list.id = simple_endpointman_line_list.mac_id AND simple_endpointman_line_list.ext = ".$ext;
$mac = $prov->db->getOne($sql);
$_REQUEST['mac'] = $mac;
require_once 'includes/edit_phone.php';
} else {
die('Unauthorized');
}