diff --git a/app/devices/app_config.php b/app/devices/app_config.php
index d8f6591886..6f3f3cfaac 100644
--- a/app/devices/app_config.php
+++ b/app/devices/app_config.php
@@ -39,6 +39,18 @@
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_mac_address';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_label';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_template';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
$apps[$x]['permissions'][$y]['name'] = "device_extension_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
@@ -105,6 +117,15 @@
$y++;
$apps[$x]['permissions'][$y]['name'] = 'device_domain';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_username_password';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_alternate';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = "device_profile_view";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
@@ -127,6 +148,25 @@
$y++;
$apps[$x]['permissions'][$y]['name'] = 'device_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_vendor';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_model';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_firmware';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_enable';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
+ $apps[$x]['permissions'][$y]['name'] = 'device_description';
+ $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
+ $apps[$x]['permissions'][$y]['groups'][] = 'admin';
+ $y++;
//schema details
$y = 0; //table array index
diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php
index 3ff97b01d8..af2231ef23 100644
--- a/app/devices/device_edit.php
+++ b/app/devices/device_edit.php
@@ -128,10 +128,25 @@ require_once "resources/require.php";
//get http post variables and set them to php variables
if (count($_POST) > 0) {
+ //device mac address
+ if (permission_exists('device_mac_address')) {
+ $device_mac_address = check_str($_POST["device_mac_address"]);
+ $device_mac_address = strtolower(preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address));
+ $_POST["device_mac_address"] = $device_mac_address;
+ }
+ else {
+ $orm = new orm;
+ $orm->name('devices');
+ $orm->uuid($device_uuid);
+ $result = $orm->find()->get();
+ //$message = $orm->message;
+ foreach ($result as &$row) {
+ $device_mac_address = $row["device_mac_address"];
+ $_POST["device_mac_address"] = $device_mac_address;
+ }
+ unset ($prep_statement);
+ }
//devices
- $device_mac_address = check_str($_POST["device_mac_address"]);
- $device_mac_address = strtolower(preg_replace('#[^a-fA-F0-9./]#', '', $device_mac_address));
- $_POST["device_mac_address"] = $device_mac_address;
$device_label = check_str($_POST["device_label"]);
$device_vendor = check_str($_POST["device_vendor"]);
$device_uuid_alternate = check_str($_POST["device_uuid_alternate"]);
@@ -514,7 +529,7 @@ require_once "resources/require.php";
echo "\n";
echo "
\n";
echo " \n";
- if ($action != "add") {
+ if (permission_exists('device_add') && $action != "add") {
echo " \n";
}
echo " \n";
@@ -526,195 +541,211 @@ require_once "resources/require.php";
echo " ".$text['label-device_mac_address']."\n";
echo " | \n";
echo "\n";
- echo " \n";
+ if (permission_exists('device_mac_address')) {
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_mac_address']."\n";
+ }
+ else {
+ echo $device_mac_address;
+ }
echo " \n";
- echo " \n";
- echo $text['description-device_mac_address']."\n";
echo " | \n";
echo "\n";
+
echo "\n";
echo "| \n";
echo " ".$text['label-device_label']."\n";
echo " | \n";
echo "\n";
- echo " \n";
- echo " \n";
- echo $text['description-device_label']."\n";
+ if (permission_exists('device_label')) {
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_label']."\n";
+ }
+ else {
+ echo $device_label;
+ }
+
echo " | \n";
echo "
\n";
- echo "\n";
- echo "| \n";
- echo " ".$text['label-device_template']."\n";
- echo " | \n";
- echo "\n";
- $device = new device;
- $template_dir = $device->get_template_dir();
+ if (permission_exists('device_template')) {
+ echo " |
\n";
+ echo "| \n";
+ echo " ".$text['label-device_template']."\n";
+ echo " | \n";
+ echo "\n";
+ $device = new device;
+ $template_dir = $device->get_template_dir();
- echo " | \n";
- echo "
\n";
-
- echo " ";
- echo " | ".$text['label-lines']." | ";
- echo " ";
- echo " \n";
+ if (strlen($text['description-lines']) > 0) {
+ echo " ".$text['description-lines']."\n";
+ }
+ echo " | ";
+ echo "
";
+ }
+
+ if (permission_exists('device_profile_edit')) {
//device profile
$sql = "select * from v_device_profiles ";
$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
@@ -738,7 +769,9 @@ require_once "resources/require.php";
echo " ";
echo " ";
}
+ }
+ if (permission_exists('device_key_edit')) {
$vendor_count = 0;
foreach($device_keys as $row) {
if ($previous_vendor != $row['device_key_vendor']) {
@@ -1065,7 +1098,7 @@ require_once "resources/require.php";
}
//device settings
- if (permission_exists('device_setting_add')) {
+ if (permission_exists('device_setting_edit')) {
echo " ";
echo " | ".$text['label-settings']." | ";
echo " ";
@@ -1153,75 +1186,85 @@ require_once "resources/require.php";
echo " |
\n";
}
- echo "\n";
- echo "| \n";
- echo " ".$text['label-device']."\n";
- echo " | \n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo " \n";
- echo " \n";
- echo $text['description-device']."\n";
- echo " | \n";
- echo "
\n";
-
- echo "\n";
- echo "| \n";
- echo " ".$text['label-device_uuid_alternate']."\n";
- echo " | \n";
- echo "\n";
- if (strlen($device_uuid_alternate) == 0) {
- echo " ";
+ if (permission_exists('device_username_password')) {
+ echo " |
\n";
+ echo "| \n";
+ echo " ".$text['label-device']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-device']."\n";
+ echo " | \n";
+ echo "
\n";
}
- else {
- $label = $device_alternate[0]['device_label'];
- if (strlen($label) == 0) { $label = $device_alternate[0]['device_description']; }
- if (strlen($label) == 0) { $label = $device_alternate[0]['device_mac_address']; }
- echo " \n";
- unset($label);
+
+ if (permission_exists('device_alternate')) {
+ echo "\n";
+ echo "| \n";
+ echo " ".$text['label-device_uuid_alternate']."\n";
+ echo " | \n";
+ echo "\n";
+ if (strlen($device_uuid_alternate) == 0) {
+ echo " ";
+ }
+ else {
+ $label = $device_alternate[0]['device_label'];
+ if (strlen($label) == 0) { $label = $device_alternate[0]['device_description']; }
+ if (strlen($label) == 0) { $label = $device_alternate[0]['device_mac_address']; }
+ echo " \n";
+ unset($label);
+ }
+ echo $text['description-device_uuid_alternate']."\n";
+ echo " | \n";
+ echo "
\n";
}
- echo $text['description-device_uuid_alternate']."\n";
- echo "\n";
- echo "\n";
- echo "\n";
- echo "| \n";
- echo " ".$text['label-device_vendor']."\n";
- echo " | \n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo $text['description-device_vendor']."\n";
- echo " | \n";
- echo "
\n";
+ if (permission_exists('device_vendor')) {
+ echo "\n";
+ echo "| \n";
+ echo " ".$text['label-device_vendor']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_vendor']."\n";
+ echo " | \n";
+ echo "
\n";
+ }
- echo "\n";
- echo "| \n";
- echo " ".$text['label-device_model']."\n";
- echo " | \n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo $text['description-device_model']."\n";
- echo " | \n";
- echo "
\n";
+ if (permission_exists('device_model')) {
+ echo "\n";
+ echo "| \n";
+ echo " ".$text['label-device_model']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_model']."\n";
+ echo " | \n";
+ echo "
\n";
+ }
- echo "\n";
- echo "| \n";
- echo " ".$text['label-device_firmware_version']."\n";
- echo " | \n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo $text['description-device_firmware_version']."\n";
- echo " | \n";
- echo "
\n";
+ if (permission_exists('device_firmware')) {
+ echo "\n";
+ echo "| \n";
+ echo " ".$text['label-device_firmware_version']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_firmware_version']."\n";
+ echo " | \n";
+ echo "
\n";
+ }
if (permission_exists('device_domain')) {
echo "\n";
@@ -1253,38 +1296,46 @@ require_once "resources/require.php";
echo " \n";
}
- echo "
\n";
- echo "| \n";
- echo " ".$text['label-device_provision_enable']."\n";
- echo " | \n";
- echo "\n";
- echo " \n";
- if ($device_provision_enable == "true" || strlen($device_provision_enable) == 0) {
- echo " \n";
+ if (permission_exists('device_enable')) {
+ echo "\n";
+ echo "| \n";
+ echo " ".$text['label-device_provision_enable']."\n";
+ echo " | \n";
+ echo "\n";
+ echo " \n";
+ if ($device_provision_enable == "true" || strlen($device_provision_enable) == 0) {
+ echo " \n";
+ }
+ else {
+ echo " \n";
+ }
+ if ($device_provision_enable == "false") {
+ echo " \n";
+ }
+ else {
+ echo " \n";
+ }
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_provision_enable']."\n";
+ echo " | \n";
+ echo " \n";
}
- else {
- echo " \n";
- }
- if ($device_provision_enable == "false") {
- echo " \n";
- }
- else {
- echo " \n";
- }
- echo " \n";
- echo " \n";
- echo $text['description-device_provision_enable']."\n";
- echo " | \n";
- echo "
\n";
echo "\n";
echo "| \n";
echo " ".$text['label-device_description']."\n";
echo " | \n";
echo "\n";
- echo " \n";
- echo " \n";
- echo $text['description-device_description']."\n";
+ if (permission_exists('device_description')) {
+ echo " \n";
+ echo " \n";
+ echo $text['description-device_description']."\n";
+ }
+ else {
+ echo $device_description."\n";
+ }
+
echo " | \n";
echo "
\n";
echo " \n";
diff --git a/resources/templates/conf/autoload_configs/lua.conf.xml b/resources/templates/conf/autoload_configs/lua.conf.xml
index 0758bb6762..534505dc3b 100644
--- a/resources/templates/conf/autoload_configs/lua.conf.xml
+++ b/resources/templates/conf/autoload_configs/lua.conf.xml
@@ -13,7 +13,7 @@
These entries will be pre-pended to the LUA_PATH environment variable
-->
-
+
diff --git a/resources/templates/provision/yealink/t22p/{$mac}.cfg b/resources/templates/provision/yealink/t22p/{$mac}.cfg
index 7fef6e9bfc..ce904e36e6 100644
--- a/resources/templates/provision/yealink/t22p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t22p/{$mac}.cfg
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =
diff --git a/resources/templates/provision/yealink/t23g/{$mac}.cfg b/resources/templates/provision/yealink/t23g/{$mac}.cfg
index e09d088c44..8641aa3259 100644
--- a/resources/templates/provision/yealink/t23g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t23g/{$mac}.cfg
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
account.1.nat.stun_port = 3478
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
-account.1.nat.udp_update_enable = 1
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time = 30
diff --git a/resources/templates/provision/yealink/t23p/{$mac}.cfg b/resources/templates/provision/yealink/t23p/{$mac}.cfg
index e09d088c44..8641aa3259 100644
--- a/resources/templates/provision/yealink/t23p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t23p/{$mac}.cfg
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
account.1.nat.stun_port = 3478
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
-account.1.nat.udp_update_enable = 1
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time = 30
diff --git a/resources/templates/provision/yealink/t26p/{$mac}.cfg b/resources/templates/provision/yealink/t26p/{$mac}.cfg
index ecc4c4997b..2761774eaa 100644
--- a/resources/templates/provision/yealink/t26p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t26p/{$mac}.cfg
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =
diff --git a/resources/templates/provision/yealink/t27p/{$mac}.cfg b/resources/templates/provision/yealink/t27p/{$mac}.cfg
index e09d088c44..8641aa3259 100644
--- a/resources/templates/provision/yealink/t27p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t27p/{$mac}.cfg
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
account.1.nat.stun_port = 3478
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
-account.1.nat.udp_update_enable = 1
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time = 30
diff --git a/resources/templates/provision/yealink/t28p/{$mac}.cfg b/resources/templates/provision/yealink/t28p/{$mac}.cfg
index ecc4c4997b..2761774eaa 100644
--- a/resources/templates/provision/yealink/t28p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t28p/{$mac}.cfg
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =
diff --git a/resources/templates/provision/yealink/t29g/{$mac}.cfg b/resources/templates/provision/yealink/t29g/{$mac}.cfg
index e09d088c44..8641aa3259 100644
--- a/resources/templates/provision/yealink/t29g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t29g/{$mac}.cfg
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
account.1.nat.stun_port = 3478
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
-account.1.nat.udp_update_enable = 1
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time = 30
diff --git a/resources/templates/provision/yealink/t32g/{$mac}.cfg b/resources/templates/provision/yealink/t32g/{$mac}.cfg
index b7de551e22..a7f7534e5e 100644
--- a/resources/templates/provision/yealink/t32g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t32g/{$mac}.cfg
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =
diff --git a/resources/templates/provision/yealink/t38g/{$mac}.cfg b/resources/templates/provision/yealink/t38g/{$mac}.cfg
index e2f464c29b..cffa4df9dc 100644
--- a/resources/templates/provision/yealink/t38g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t38g/{$mac}.cfg
@@ -223,8 +223,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =
diff --git a/resources/templates/provision/yealink/t41p/{$mac}.cfg b/resources/templates/provision/yealink/t41p/{$mac}.cfg
index e09d088c44..8641aa3259 100644
--- a/resources/templates/provision/yealink/t41p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t41p/{$mac}.cfg
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
account.1.nat.stun_port = 3478
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
-account.1.nat.udp_update_enable = 1
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time = 30
diff --git a/resources/templates/provision/yealink/t42g/{$mac}.cfg b/resources/templates/provision/yealink/t42g/{$mac}.cfg
index 94d6cc28a1..70c98e9022 100644
--- a/resources/templates/provision/yealink/t42g/{$mac}.cfg
+++ b/resources/templates/provision/yealink/t42g/{$mac}.cfg
@@ -126,7 +126,7 @@ account.1.nat.stun_server =
account.1.nat.stun_port = 3478
#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
-account.1.nat.udp_update_enable = 1
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time = 30
diff --git a/resources/templates/provision/yealink/vp530/{$mac}.cfg b/resources/templates/provision/yealink/vp530/{$mac}.cfg
index a380a3f81d..b35405d03e 100644
--- a/resources/templates/provision/yealink/vp530/{$mac}.cfg
+++ b/resources/templates/provision/yealink/vp530/{$mac}.cfg
@@ -253,8 +253,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =
diff --git a/resources/templates/provision/yealink/w52p/{$mac}.cfg b/resources/templates/provision/yealink/w52p/{$mac}.cfg
index a6bc0d586a..2509a41fbf 100644
--- a/resources/templates/provision/yealink/w52p/{$mac}.cfg
+++ b/resources/templates/provision/yealink/w52p/{$mac}.cfg
@@ -147,8 +147,8 @@ account.1.nat.stun_server =
#Configure the STUN server port, the default value is 3478.
account.1.nat.stun_port =
-#Enable or disable the NAT keep-alive; 0-Disabled, 1-Enabled (default);
-account.1.nat.udp_update_enable =
+#Enable or disable the NAT keep-alive; 0-Disabled, 1-Default (default), 2-Option, 3-Notify;
+account.1.nat.udp_update_enable = 3
#Specify the keep-alive interval (in seconds), the default value is 30.
account.1.nat.udp_update_time =