diff --git a/app/devices/app_config.php b/app/devices/app_config.php index 446c313cf5..7eb68bed97 100644 --- a/app/devices/app_config.php +++ b/app/devices/app_config.php @@ -99,6 +99,22 @@ $apps[$x]['permissions'][$y]['name'] = "device_setting_delete"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = 'device_key_view'; + $apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; + $apps[$x]['permissions'][$y]['groups'][] = 'admin'; + $y++; + $apps[$x]['permissions'][$y]['name'] = 'device_key_add'; + $apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; + $apps[$x]['permissions'][$y]['groups'][] = 'admin'; + $y++; + $apps[$x]['permissions'][$y]['name'] = 'device_key_edit'; + $apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; + $apps[$x]['permissions'][$y]['groups'][] = 'admin'; + $y++; + $apps[$x]['permissions'][$y]['name'] = 'device_key_delete'; + $apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; + $apps[$x]['permissions'][$y]['groups'][] = 'admin'; + $y++; //schema details $y = 0; //table array index @@ -191,47 +207,6 @@ $y = 1; //table array index $z = 0; //field array index - $apps[$x]['db'][$y]['table'] = "v_device_extensions"; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_extension_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_devices"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "device_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "extension_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; - $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; - $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_extensions"; - $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "extension_uuid"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_line"; - $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - - $y = 2; //table array index - $z = 0; //field array index $apps[$x]['db'][$y]['table'] = "v_device_lines"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -283,8 +258,20 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the password."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "sip_port"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "sip_transport"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "register_expires"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; - $y = 3; //table array index + $y = 2; //table array index $z = 0; //field array index $apps[$x]['db'][$y]['table'] = "v_device_settings"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_setting_uuid"; @@ -336,4 +323,47 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + + $y = 3; //table array index + $z = 0; //field array index + $apps[$x]['db'][$y]['table'] = 'v_device_keys'; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_devices'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'device_uuid'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_id'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the key ID.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_type'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the type.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_value'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the value.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_key_label'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the label.'; + $z++; + ?> diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index 309bf764c4..5f5c04f2ef 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -121,6 +121,30 @@ $text['description-outbound_proxy']['pt-pt'] = "Introduza o outbound proxy."; $text['description-outbound_proxy']['fr-fr'] = ""; + $text['label-sip_port']['en-us'] = "Port"; + $text['label-sip_port']['pt-pt'] = ""; + $text['label-sip_port']['fr-fr'] = ""; + + $text['description-sip_port']['en-us'] = "Enter the SIP port."; + $text['description-sip_port']['pt-pt'] = ""; + $text['description-sip_port']['fr-fr'] = ""; + + $text['label-sip_transport']['en-us'] = "Transport"; + $text['label-sip_transport']['pt-pt'] = ""; + $text['label-sip_transport']['fr-fr'] = ""; + + $text['description-sip_transport']['en-us'] = "Enter the SIP transport protocol."; + $text['description-sip_transport']['pt-pt'] = "Introduza o ."; + $text['description-sip_transport']['fr-fr'] = ""; + + $text['label-register_expires']['en-us'] = "Register Expires"; + $text['label-register_expires']['pt-pt'] = ""; + $text['label-register_expires']['fr-fr'] = ""; + + $text['description-register_expires']['en-us'] = "Enter the expire time for the SIP registration."; + $text['description-register_expires']['pt-pt'] = "."; + $text['description-register_expires']['fr-fr'] = ""; + $text['label-display_name']['en-us'] = "Display Name"; $text['label-display_name']['pt-pt'] = "Nome no visor"; $text['label-display_name']['fr-fr'] = "Nom affiché"; @@ -185,6 +209,53 @@ $text['description-device_description']['pt-pt'] = "Introduza a descrição."; $text['description-device_description']['fr-fr'] = ""; + //keys + $text['label-keys']['en-us'] = "Keys"; + $text['label-keys']['pt-pt'] = ""; + $text['label-keys']['fr-fr'] = ""; + + $text['title-device_keys']['en-us'] = 'Device Keys'; + $text['title-device_keys']['pt-pt'] = ''; + + $text['title-device_key']['en-us'] = 'Device Key'; + $text['title-device_key']['pt-pt'] = ''; + + $text['description-device_key']['en-us'] = ''; + $text['description-device_key']['pt-pt'] = ''; + + $text['label-device_key_id']['en-us'] = 'Key'; + $text['label-device_key_id']['pt-pt'] = ''; + + $text['description-device_key']['en-us'] = 'Select the key.'; + $text['description-device_key']['pt-pt'] = ''; + + $text['label-device_key_type']['en-us'] = 'Type'; + $text['label-device_key_type']['pt-pt'] = ''; + + $text['description-device_key_type']['en-us'] = 'Select the type of key.'; + $text['description-device_key_type']['pt-pt'] = ''; + + $text['label-device_key_value']['en-us'] = 'Value'; + $text['label-device_key_value']['pt-pt'] = ''; + + $text['description-device_key_value']['en-us'] = 'Enter the value.'; + $text['description-device_key_value']['pt-pt'] = ''; + + $text['label-device_key_label']['en-us'] = 'Label'; + $text['label-device_key_label']['pt-pt'] = ''; + + $text['description-device_key_label']['en-us'] = 'Enter the label.'; + $text['description-device_key_label']['pt-pt'] = ''; + + $text['label-line']['en-us'] = 'line'; + $text['label-line']['pt-pt'] = ''; + + $text['label-blf']['en-us'] = 'blf'; + $text['label-blf']['pt-pt'] = ''; + + $text['label-park']['en-us'] = 'park'; + $text['label-park']['pt-pt'] = ''; + //general translations $text['label-true']['en-us'] = "true"; $text['label-true']['pt-pt'] = "sim"; diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index f82cb2b498..801479016f 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -74,6 +74,11 @@ require_once "resources/require.php"; $user_id = check_str($_POST["user_id"]); $auth_id = check_str($_POST["auth_id"]); $password = check_str($_POST["password"]); + //keys + $device_key_id = check_str($_POST["device_key_id"]); + $device_key_type = check_str($_POST["device_key_type"]); + $device_key_value = check_str($_POST["device_key_value"]); + $device_key_label = check_str($_POST["device_key_label"]); //settings //$device_setting_category = check_str($_POST["device_setting_category"]); $device_setting_subcategory = check_str($_POST["device_setting_subcategory"]); @@ -245,7 +250,33 @@ require_once "resources/require.php"; unset($sql); } - //add the device settings + //add a device key + if (strlen($device_key_id) > 0 && permission_exists('device_key_add')) { + $sql = "insert into v_device_keys "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "device_uuid, "; + $sql .= "device_key_uuid, "; + $sql .= "device_key_id, "; + $sql .= "device_key_type, "; + $sql .= "device_key_value, "; + $sql .= "device_key_label "; + $sql .= ")"; + $sql .= " values "; + $sql .= "("; + $sql .= "'$domain_uuid', "; + $sql .= "'$device_uuid', "; + $sql .= "'".uuid()."', "; + $sql .= "'$device_key_id', "; + $sql .= "'$device_key_type', "; + $sql .= "'$device_key_value', "; + $sql .= "'$device_key_label' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + } + + //add a device setting if (strlen($device_setting_subcategory) > 0 && permission_exists('device_setting_add')) { $device_setting_category = "provision"; $device_setting_name = "text"; @@ -451,7 +482,7 @@ require_once "resources/require.php"; echo " ".$row['auth_id']." \n"; echo " \n"; echo " \n"; - echo " ".$row['password']." \n"; + echo " ********  \n"; //$row['password'] echo " \n"; echo " \n"; if (permission_exists('device_edit')) { @@ -517,6 +548,91 @@ require_once "resources/require.php"; echo " "; echo " "; + echo " "; + echo " ".$text['label-keys'].":"; + echo " "; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + $sql = "SELECT * FROM v_device_keys "; + $sql .= "WHERE domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "AND device_uuid = '".$device_uuid."' "; + $sql .= "ORDER by device_key_id asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + foreach($result as $row) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } + + echo "\n"; + echo " \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo " \n"; + echo " \n"; + echo "
".$text['label-device_key_id']."".$text['label-device_key_type']."".$text['label-device_key_value']."".$text['label-device_key_label']." 
\n"; + echo " ".$row['device_key_id']." \n"; + echo " \n"; + echo " ".$row['device_key_type']." \n"; + echo " \n"; + echo " ".$row['device_key_value']." \n"; + echo " \n"; + echo " ".$row['device_key_label']." \n"; + echo " \n"; + if (permission_exists('device_key_edit')) { + echo " $v_link_label_edit\n"; + } + if (permission_exists('device_key_delete')) { + echo " $v_link_label_delete\n"; + } + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo "
\n"; + if (strlen($text['description-settings']) > 0) { + echo "
".$text['description-settings']."\n"; + } + echo " "; + echo " "; + echo " "; echo " ".$text['label-settings'].":"; echo " "; diff --git a/app/devices/device_key_delete.php b/app/devices/device_key_delete.php new file mode 100644 index 0000000000..d3e7cdea18 --- /dev/null +++ b/app/devices/device_key_delete.php @@ -0,0 +1,44 @@ + $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + +//get the id + if (count($_GET)>0) { + $id = check_str($_GET["id"]); + $device_uuid = check_str($_GET["device_uuid"]); + } + +if (strlen($id)>0) { + //delete device_key + $sql = "delete from v_device_keys "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and device_key_uuid = '$id' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + unset($sql); +} + +//redirect the user + require_once "resources/header.php"; + echo "\n"; + echo "
\n"; + echo $text['message-delete']."\n"; + echo "
\n"; + require_once "resources/footer.php"; + return; + +?> \ No newline at end of file diff --git a/app/devices/device_key_edit.php b/app/devices/device_key_edit.php new file mode 100644 index 0000000000..91b701566c --- /dev/null +++ b/app/devices/device_key_edit.php @@ -0,0 +1,352 @@ + $value) { + $text[$key] = $value[$_SESSION['domain']['language']['code']]; + } + +//action add or update + if (isset($_REQUEST["id"])) { + $action = "update"; + $device_key_uuid = check_str($_REQUEST["id"]); + $device_uuid = check_str($_REQUEST["device_uuid"]); + } + else { + $action = "add"; + } + +//set the parent uuid + if (strlen($_GET["device_key_uuid"]) > 0) { + $device_key_uuid = check_str($_GET["device_key_uuid"]); + } + +//get http post variables and set them to php variables + if (count($_POST)>0) { + $device_key_id = check_str($_POST["device_key_id"]); + $device_key_type = check_str($_POST["device_key_type"]); + $device_key_value = check_str($_POST["device_key_value"]); + $device_key_label = check_str($_POST["device_key_label"]); + } + +if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { + + $msg = ''; + if ($action == "update") { + $device_key_uuid = check_str($_POST["device_key_uuid"]); + } + + //check for all required data + //if (strlen($device_key_id) == 0) { $msg .= $text['message-required']." ".$text['label-device_key_id']."
\n"; } + //if (strlen($device_key_type) == 0) { $msg .= $text['message-required']." ".$text['label-device_key_type']."
\n"; } + //if (strlen($device_key_value) == 0) { $msg .= $text['message-required']." ".$text['label-device_key_value']."
\n"; } + //if (strlen($device_key_label) == 0) { $msg .= $text['message-required']." ".$text['label-device_key_label']."
\n"; } + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persistformvar.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } + + //add or update the database + if ($_POST["persistformvar"] != "true") { + if ($action == "add" && permission_exists('device_key_add')) { + $sql = "insert into v_device_keys "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "device_key_uuid, "; + $sql .= "device_uuid, "; + $sql .= "device_key_id, "; + $sql .= "device_key_type, "; + $sql .= "device_key_value, "; + $sql .= "device_key_label "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'$domain_uuid', "; + $sql .= "'".uuid()."', "; + $sql .= "'$device_uuid', "; + $sql .= "'$device_key_id', "; + $sql .= "'$device_key_type', "; + $sql .= "'$device_key_value', "; + $sql .= "'$device_key_label' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + + require_once "resources/header.php"; + echo "\n"; + echo "
\n"; + echo " ".$text['message-add']."\n"; + echo "
\n"; + require_once "resources/footer.php"; + return; + } //if ($action == "add") + + if ($action == "update" && permission_exists('device_key_edit')) { + $sql = "update v_device_keys set "; + $sql .= "device_key_id = '$device_key_id', "; + $sql .= "device_key_type = '$device_key_type', "; + $sql .= "device_key_value = '$device_key_value', "; + $sql .= "device_key_label = '$device_key_label' "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and device_key_uuid = '$device_key_uuid'"; + $db->exec(check_sql($sql)); + unset($sql); + + require_once "resources/header.php"; + echo "\n"; + echo "
\n"; + echo " ".$text['message-update']."\n"; + echo "
\n"; + require_once "resources/footer.php"; + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") +} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + +//pre-populate the form + if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { + $device_key_uuid = check_str($_GET["id"]); + $sql = "select * from v_device_keys "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and device_key_uuid = '$device_key_uuid' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + foreach ($result as &$row) { + $device_key_id = $row["device_key_id"]; + $device_key_type = $row["device_key_type"]; + $device_key_value = $row["device_key_value"]; + $device_key_label = $row["device_key_label"]; + } + unset ($prep_statement); + } + +//show the header + require_once "resources/header.php"; + +//show the content + echo "
"; + echo "\n"; + echo "\n"; + echo " "; + echo " "; + echo "
\n"; + echo "
"; + + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo " "; + echo "
".$text['title-device_key']."
\n"; + echo " ".$text['label-device_key_id'].": $device_key_id\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_key_id']."\n"; + echo "
\n"; + echo " ".$text['label-device_key_type'].":\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_key_type']."\n"; + echo "
\n"; + echo " ".$text['label-device_key_value'].":\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_key_value']."\n"; + echo "
\n"; + echo " ".$text['label-device_key_label'].":\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_key_label']."\n"; + echo "
\n"; + echo " \n"; + if ($action == "update") { + echo " \n"; + } + echo " \n"; + echo "
"; + echo ""; + + echo "
"; + echo "
"; + +//include the footer + require_once "resources/footer.php"; +?> \ No newline at end of file diff --git a/app/devices/device_line_edit.php b/app/devices/device_line_edit.php index 3c32508d48..0a55b12f5e 100644 --- a/app/devices/device_line_edit.php +++ b/app/devices/device_line_edit.php @@ -58,6 +58,9 @@ else { $line_number = check_str($_POST["line_number"]); $server_address = check_str($_POST["server_address"]); $outbound_proxy = check_str($_POST["outbound_proxy"]); + $sip_port = check_str($_POST["sip_port"]); + $sip_transport = check_str($_POST["sip_transport"]); + $register_expires = check_str($_POST["register_expires"]); $display_name = check_str($_POST["display_name"]); $user_id = check_str($_POST["user_id"]); $auth_id = check_str($_POST["auth_id"]); @@ -104,6 +107,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "line_number, "; $sql .= "server_address, "; $sql .= "outbound_proxy, "; + $sql .= "sip_port, "; + $sql .= "sip_transport, "; + $sql .= "register_expires, "; $sql .= "display_name, "; $sql .= "user_id, "; $sql .= "auth_id, "; @@ -117,6 +123,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$line_number', "; $sql .= "'$server_address', "; $sql .= "'$outbound_proxy', "; + $sql .= "'$sip_port', "; + $sql .= "'$sip_transport', "; + $sql .= "'$register_expires', "; $sql .= "'$display_name', "; $sql .= "'$user_id', "; $sql .= "'$auth_id', "; @@ -133,6 +142,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "line_number = '$line_number', "; $sql .= "server_address = '$server_address', "; $sql .= "outbound_proxy = '$outbound_proxy', "; + $sql .= "sip_port = '$sip_port', "; + $sql .= "sip_transport = '$sip_transport', "; + $sql .= "register_expires = '$register_expires', "; $sql .= "display_name = '$display_name', "; $sql .= "user_id = '$user_id', "; $sql .= "auth_id = '$auth_id', "; @@ -172,6 +184,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $line_number = $row["line_number"]; $server_address = $row["server_address"]; $outbound_proxy = $row["outbound_proxy"]; + $sip_port = $row["sip_port"]; + $sip_transport = $row["sip_transport"]; + $register_expires = $row["register_expires"]; $display_name = $row["display_name"]; $user_id = $row["user_id"]; $auth_id = $row["auth_id"]; @@ -289,6 +304,40 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo $text['description-password']."\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-sip_port'].":\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-sip_port']."\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-sip_transport'].":\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-sip_transport']."\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-register_expires'].":\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-register_expires']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; echo " \n"; echo " \n";