Update device_profile_edit.php

Add permission_exists to check for device_key_extension permission in device profiles.
This commit is contained in:
FusionPBX
2016-07-28 15:53:33 -06:00
committed by GitHub
parent c94ffd93d4
commit e8a39633ef

View File

@@ -22,11 +22,13 @@
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
require_once "root.php";
require_once "resources/require.php"; //includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions //check permissions
require_once "resources/check_auth.php";
if (permission_exists('device_profile_add') || permission_exists('device_profile_edit')) { if (permission_exists('device_profile_add') || permission_exists('device_profile_edit')) {
//access granted //access granted
} }
@@ -244,6 +246,7 @@ require_once "resources/require.php";
obj[0].parentNode.removeChild(obj[2]); obj[0].parentNode.removeChild(obj[2]);
} }
</script> </script>
<?php <?php
//show the content //show the content
echo "<form method='post' name='frm' id='frm' action=''>\n"; echo "<form method='post' name='frm' id='frm' action=''>\n";
@@ -292,14 +295,19 @@ require_once "resources/require.php";
echo " <td class='vtable'>".$text['label-device_key_type']."</td>\n"; echo " <td class='vtable'>".$text['label-device_key_type']."</td>\n";
echo " <td class='vtable'>".$text['label-device_key_line']."</td>\n"; echo " <td class='vtable'>".$text['label-device_key_line']."</td>\n";
echo " <td class='vtable'>".$text['label-device_key_value']."</td>\n"; echo " <td class='vtable'>".$text['label-device_key_value']."</td>\n";
echo " <td class='vtable'>".$text['label-device_key_extension']."</td>\n"; if (permission_exists('device_key_extension') {
echo " <td class='vtable'>".$text['label-device_key_extension']."</td>\n";
}
echo " <td class='vtable'>".$text['label-device_key_label']."</td>\n"; echo " <td class='vtable'>".$text['label-device_key_label']."</td>\n";
echo " <td>&nbsp;</td>\n"; echo " <td>&nbsp;</td>\n";
echo " </tr>\n"; echo " </tr>\n";
} }
$x = 0; $x = 0;
foreach($device_keys as $row) { foreach($device_keys as $row) {
//set the device vendor
$device_vendor = $row['device_key_vendor']; $device_vendor = $row['device_key_vendor'];
//set the column names //set the column names
if ($previous_device_key_vendor != $row['device_key_vendor']) { if ($previous_device_key_vendor != $row['device_key_vendor']) {
echo " <tr>\n"; echo " <tr>\n";
@@ -652,9 +660,11 @@ require_once "resources/require.php";
echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_value]' style='width: 120px;' maxlength='255' value=\"".$row['device_key_value']."\">\n"; echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_value]' style='width: 120px;' maxlength='255' value=\"".$row['device_key_value']."\">\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='' align='left'>\n"; if (permission_exists('device_key_extension') {
echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_extension]' style='width: 120px;' maxlength='255' value=\"".$row['device_key_extension']."\">\n"; echo "<td class='' align='left'>\n";
echo "</td>\n"; echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_extension]' style='width: 120px;' maxlength='255' value=\"".$row['device_key_extension']."\">\n";
echo "</td>\n";
}
echo "<td class='' align='left'>\n"; echo "<td class='' align='left'>\n";
echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_label]' style='width: 150px;' maxlength='255' value=\"".$row['device_key_label']."\">\n"; echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_label]' style='width: 150px;' maxlength='255' value=\"".$row['device_key_label']."\">\n";
@@ -744,4 +754,4 @@ require_once "resources/require.php";
//show the footer //show the footer
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>