diff --git a/app/devices/app_config.php b/app/devices/app_config.php
index 6e00b9dc94..d9a29c0633 100644
--- a/app/devices/app_config.php
+++ b/app/devices/app_config.php
@@ -37,27 +37,27 @@
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//permission details
- $apps[$x]['permissions'][0]['name'] = 'device_view';
- $apps[$x]['permissions'][0]['groups'][] = 'admin';
- $apps[$x]['permissions'][0]['groups'][] = 'superadmin';
-
- $apps[$x]['permissions'][1]['name'] = 'device_add';
- $apps[$x]['permissions'][1]['groups'][] = 'admin';
- $apps[$x]['permissions'][1]['groups'][] = 'superadmin';
-
- $apps[$x]['permissions'][2]['name'] = 'device_edit';
- $apps[$x]['permissions'][2]['groups'][] = 'admin';
- $apps[$x]['permissions'][2]['groups'][] = 'superadmin';
-
- $apps[$x]['permissions'][3]['name'] = 'device_delete';
- $apps[$x]['permissions'][3]['groups'][] = 'admin';
- $apps[$x]['permissions'][3]['groups'][] = 'superadmin';
+ $y = 0;
+ $apps[$x]['permissions'][$y]['name'] = 'device_view';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_add';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_edit';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_delete';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//schema details
$y = 0; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_devices';
- //$apps[$x]['db'][$y]['table']['deprecated'] = 'v_hardware_phones';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'hardware_device_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
@@ -184,4 +184,53 @@
$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';
+ $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'] = 'foreign';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'device_line_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'] = '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'] = 'foreign';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'line_number';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the line number.';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'server_address';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the sip server address.';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'outbound_proxy';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the outbound proxy.';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'display_name';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the display name.';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_id';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the user id.';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'auth_id';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the auth ID.';
+ $z++;
+ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'password';
+ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
+ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the password.';
+ $z++;
?>
\ No newline at end of file
diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php
index 617e8baf0f..b2881d1afc 100644
--- a/app/devices/app_languages.php
+++ b/app/devices/app_languages.php
@@ -64,6 +64,60 @@
$text['description-device_template']['en-us'] = 'Select a template.';
$text['description-device_template']['pt-pt'] = '';
+ $text['label-lines']['en-us'] = 'Lines';
+ $text['label-lines']['pt-pt'] = '';
+
+ $text['label-line']['en-us'] = 'Line';
+ $text['label-line']['pt-pt'] = '';
+
+ $text['label-line_number']['en-us'] = 'Line Number';
+ $text['label-line_number']['pt-pt'] = '';
+
+ $text['description-line_number']['en-us'] = 'Select a line number.';
+ $text['description-line_number']['pt-pt'] = '';
+
+ $text['label-server_address']['en-us'] = 'Server Address';
+ $text['label-server_address']['pt-pt'] = '';
+
+ $text['description-server_address']['en-us'] = 'Select a server address.';
+ $text['description-server_address']['pt-pt'] = '';
+
+ $text['label-server_address']['en-us'] = 'Server Address';
+ $text['label-server_address']['pt-pt'] = '';
+
+ $text['description-server_address']['en-us'] = 'Select a server address.';
+ $text['description-server_address']['pt-pt'] = '';
+
+ $text['label-outbound_proxy']['en-us'] = 'Outbound Proxy';
+ $text['label-outbound_proxy']['pt-pt'] = '';
+
+ $text['description-outbound_proxy']['en-us'] = 'Enter the outbound proxy.';
+ $text['description-outbound_proxy']['pt-pt'] = '';
+
+ $text['label-display_name']['en-us'] = 'Display Name';
+ $text['label-display_name']['pt-pt'] = '';
+
+ $text['description-display_name']['en-us'] = 'Enter the display name.';
+ $text['description-display_name']['pt-pt'] = '';
+
+ $text['label-user_id']['en-us'] = 'User ID';
+ $text['label-user_id']['pt-pt'] = '';
+
+ $text['description-user_id']['en-us'] = 'Enter the user ID.';
+ $text['description-user_id']['pt-pt'] = '';
+
+ $text['label-auth_id']['en-us'] = 'Auth ID';
+ $text['label-auth_id']['pt-pt'] = '';
+
+ $text['description-auth_id']['en-us'] = 'Enter the auth ID.';
+ $text['description-auth_id']['pt-pt'] = '';
+
+ $text['label-password']['en-us'] = 'Password';
+ $text['label-password']['pt-pt'] = '';
+
+ $text['description-password']['en-us'] = 'Enter the password.';
+ $text['description-password']['pt-pt'] = '';
+
//$text['label-device_username']['en-us'] = 'Username';
//$text['label-device_username']['pt-pt'] = '';
diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php
index 1d790c6752..c58fd80218 100644
--- a/app/devices/device_edit.php
+++ b/app/devices/device_edit.php
@@ -52,19 +52,28 @@ require_once "includes/require.php";
//get http post variables and set them to php variables
if (count($_POST) > 0) {
- $device_mac_address = check_str($_POST["device_mac_address"]);
- $device_mac_address = strtolower($device_mac_address);
- $device_mac_address = preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address);
- $device_label = check_str($_POST["device_label"]);
- $device_vendor = check_str($_POST["device_vendor"]);
- $device_model = check_str($_POST["device_model"]);
- $device_firmware_version = check_str($_POST["device_firmware_version"]);
- $device_provision_enable = check_str($_POST["device_provision_enable"]);
- $device_template = check_str($_POST["device_template"]);
- $device_username = check_str($_POST["device_username"]);
- $device_password = check_str($_POST["device_password"]);
- $device_time_zone = check_str($_POST["device_time_zone"]);
- $device_description = check_str($_POST["device_description"]);
+ //devices
+ $device_mac_address = check_str($_POST["device_mac_address"]);
+ $device_mac_address = strtolower($device_mac_address);
+ $device_mac_address = preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address);
+ $device_label = check_str($_POST["device_label"]);
+ $device_vendor = check_str($_POST["device_vendor"]);
+ $device_model = check_str($_POST["device_model"]);
+ $device_firmware_version = check_str($_POST["device_firmware_version"]);
+ $device_provision_enable = check_str($_POST["device_provision_enable"]);
+ $device_template = check_str($_POST["device_template"]);
+ $device_username = check_str($_POST["device_username"]);
+ $device_password = check_str($_POST["device_password"]);
+ $device_time_zone = check_str($_POST["device_time_zone"]);
+ $device_description = check_str($_POST["device_description"]);
+ //lines
+ $line_number = check_str($_POST["line_number"]);
+ $server_address = check_str($_POST["server_address"]);
+ $outbound_proxy = check_str($_POST["outbound_proxy"]);
+ $display_name = check_str($_POST["display_name"]);
+ $user_id = check_str($_POST["user_id"]);
+ $auth_id = check_str($_POST["auth_id"]);
+ $password = check_str($_POST["password"]);
}
//use the mac address to find the vendor
@@ -121,7 +130,7 @@ require_once "includes/require.php";
//if (strlen($device_password) == 0) { $msg .= "Please provide: Password
\n"; }
//if (strlen($device_time_zone) == 0) { $msg .= "Please provide: Time Zone
\n"; }
//if (strlen($device_description) == 0) { $msg .= "Please provide: Description
\n"; }
- if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
+ if (strlen($msg) > 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
echo "
| ".$text['label-line']." | \n"; + echo "".$text['label-server_address']." | \n"; + echo "".$text['label-outbound_proxy']." | \n"; + echo "".$text['label-display_name']." | \n"; + echo "".$text['label-user_id']." | \n"; + echo "".$text['label-auth_id']." | \n"; + echo "".$text['label-password']." | \n"; + echo "\n"; + echo " |
| \n"; + echo " ".$row['line_number']." \n"; + echo " | \n"; + echo "\n"; + echo " ".$row['server_address']." \n"; + echo " | \n"; + echo "\n"; + echo " ".$row['outbound_proxy']." \n"; + echo " | \n"; + echo "\n"; + echo " ".$row['display_name']." \n"; + echo " | \n"; + echo "\n"; + echo " ".$row['user_id']." \n"; + echo " | \n"; + echo "\n"; + echo " ".$row['auth_id']." \n"; + echo " | \n"; + echo "\n"; + echo " ".$row['password']." \n"; + echo " | \n"; + echo "\n"; + if (permission_exists('device_edit')) { + echo " $v_link_label_edit\n"; + } + if (permission_exists('device_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"; + 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 $msg." "; + echo " |
| \n";
+ echo " "; + + echo " | ";
+ echo "