示例#1
0
}
//check if provisioning has been enabled
if ($provision["enabled"] != "true") {
    echo "access denied";
    exit;
}
//send a request to a remote server to validate the MAC address and secret
if (strlen($_SERVER['auth_server']) > 0) {
    $result = send_http_request($_SERVER['auth_server'], 'mac=' . check_str($_REQUEST['mac']) . '&secret=' . check_str($_REQUEST['secret']));
    if ($result == "false") {
        echo "access denied";
        exit;
    }
}
//use the mac address to get the vendor
$device_vendor = device::get_vendor($mac);
//keep backwards compatibility
if (strlen($_SESSION['provision']["cidr"]["text"]) > 0) {
    $_SESSION['provision']["cidr"][] = $_SESSION['provision']["cidr"]["text"];
}
//check the cidr range
if (is_array($_SESSION['provision']["cidr"])) {
    $found = false;
    foreach ($_SESSION['provision']["cidr"] as $cidr) {
        if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
            $found = true;
            break;
        }
    }
    if (!$found) {
        echo "access denied";
示例#2
0
$device_keys[$x]['device_key_extension'] = '';
$device_keys[$x]['device_key_label'] = '';
//get device settings
$sql = "SELECT * FROM v_device_settings ";
$sql .= "WHERE device_uuid = '" . $device_uuid . "' ";
$sql .= "ORDER by device_setting_subcategory asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$device_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$device_settings[$x]['device_setting_name'] = '';
$device_settings[$x]['device_setting_value'] = '';
$device_settings[$x]['enabled'] = '';
$device_settings[$x]['device_setting_description'] = '';
//use the mac address to get the vendor
if (strlen($device_vendor) == 0) {
    $device_vendor = device::get_vendor($device_mac_address);
}
//show the header
require_once "resources/header.php";
//javascript to change select to input and back again
?>
<script language="javascript">
		var objs;

		function change_to_input(obj){
			tb=document.createElement('INPUT');
			tb.type='text';
			tb.name=obj.name;
			tb.className='formfld';
			//tb.setAttribute('id', 'ivr_menu_option_param');
			tb.setAttribute('style', 'width:175px;');