Add device_key_icon permission (#6262)

* Add device_key_icon permission

* Use the new device_key_icon permission.

* Use the device_key_icon permission
This commit is contained in:
FusionPBX 2022-01-25 09:53:03 -07:00 committed by GitHub
parent 3541625f6d
commit 94eab98ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 26 deletions

View File

@ -268,19 +268,15 @@
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_view'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_add'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_edit'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_delete'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_all'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
@ -290,38 +286,30 @@
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_key_view'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_key_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_key_add'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_key_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_key_edit'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_key_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_key_delete'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_key_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_key_all'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_key_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_view'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_view';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_add'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_add';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_edit'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_edit';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_delete'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_delete';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_all'; $apps[$x]['permissions'][$y]['name'] = 'device_profile_setting_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
@ -329,6 +317,8 @@
$apps[$x]['permissions'][$y]['name'] = 'device_export'; $apps[$x]['permissions'][$y]['name'] = 'device_export';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++; $y++;
$apps[$x]['permissions'][$y]['name'] = 'device_key_icon';
$y++;
//default settings //default settings
$y = 0; $y = 0;

View File

@ -391,7 +391,9 @@
} }
//$array['devices'][0]['device_keys'][$y]['device_key_protected'] = $row["device_key_protected"]; //$array['devices'][0]['device_keys'][$y]['device_key_protected'] = $row["device_key_protected"];
$array['devices'][0]['device_keys'][$y]['device_key_label'] = $row["device_key_label"]; $array['devices'][0]['device_keys'][$y]['device_key_label'] = $row["device_key_label"];
$array['devices'][0]['device_keys'][$y]['device_key_icon'] = $row["device_key_icon"]; if (permission_exists('device_key_icon')) {
$array['devices'][0]['device_keys'][$y]['device_key_icon'] = $row["device_key_icon"];
}
$y++; $y++;
} }
} }
@ -1335,7 +1337,9 @@
echo " <td class='vtable'>".$text['label-device_key_extension']."</td>\n"; 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 class='vtable'>".$text['label-device_key_icon']."</td>\n"; if (permission_exists('device_key_icon')) {
echo " <td class='vtable'>".$text['label-device_key_icon']."</td>\n";
}
if (is_array($device_keys) && @sizeof($device_keys) > 1 && permission_exists('device_key_delete')) { if (is_array($device_keys) && @sizeof($device_keys) > 1 && permission_exists('device_key_delete')) {
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_keys', 'delete_toggle_keys');\" onmouseout=\"swap_display('delete_label_keys', 'delete_toggle_keys');\">\n"; echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_keys', 'delete_toggle_keys');\" onmouseout=\"swap_display('delete_label_keys', 'delete_toggle_keys');\">\n";
echo " <span id='delete_label_keys'>".$text['label-delete']."</span>\n"; echo " <span id='delete_label_keys'>".$text['label-delete']."</span>\n";
@ -1367,7 +1371,9 @@
echo " <td class='vtable'>".$text['label-device_key_extension']."</td>\n"; 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 class='vtable'>".$text['label-device_key_icon']."</td>\n"; if (permission_exists('device_key_icon')) {
echo " <td class='vtable'>".$text['label-device_key_icon']."</td>\n";
}
if (is_array($device_keys) && @sizeof($device_keys) > 1 && permission_exists('device_key_delete')) { if (is_array($device_keys) && @sizeof($device_keys) > 1 && permission_exists('device_key_delete')) {
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_keys', 'delete_toggle_keys');\" onmouseout=\"swap_display('delete_label_keys', 'delete_toggle_keys');\">\n"; echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_keys', 'delete_toggle_keys');\" onmouseout=\"swap_display('delete_label_keys', 'delete_toggle_keys');\">\n";
echo " <span id='delete_label_keys'>".$text['label-delete']."</span>\n"; echo " <span id='delete_label_keys'>".$text['label-delete']."</span>\n";
@ -1580,9 +1586,11 @@
echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_label]' style='width: 75px;' maxlength='255' value=\"".escape($row['device_key_label'])."\"/>\n"; echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_label]' style='width: 75px;' maxlength='255' value=\"".escape($row['device_key_label'])."\"/>\n";
echo "</td>\n"; echo "</td>\n";
echo "<td align='left'>\n"; if (permission_exists('device_key_icon')) {
echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_icon]' style='width: 75px;' maxlength='255' value=\"".escape($row['device_key_icon'])."\"/>\n"; echo "<td align='left'>\n";
echo "</td>\n"; echo " <input class='formfld' type='text' name='device_keys[".$x."][device_key_icon]' style='width: 75px;' maxlength='255' value=\"".escape($row['device_key_icon'])."\"/>\n";
echo "</td>\n";
}
if (is_array($device_keys) && @sizeof($device_keys) > 1 && permission_exists('device_key_delete')) { if (is_array($device_keys) && @sizeof($device_keys) > 1 && permission_exists('device_key_delete')) {
if (is_uuid($row['device_key_uuid'])) { if (is_uuid($row['device_key_uuid'])) {

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2016-2021 Portions created by the Initial Developer are Copyright (C) 2016-2022
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
*/ */
@ -231,7 +231,9 @@
$array['device_keys'][0]['device_key_line'] = $device_key_line; $array['device_keys'][0]['device_key_line'] = $device_key_line;
$array['device_keys'][0]['device_key_value'] = $device_key_value; $array['device_keys'][0]['device_key_value'] = $device_key_value;
$array['device_keys'][0]['device_key_label'] = $device_key_label; $array['device_keys'][0]['device_key_label'] = $device_key_label;
$array['device_keys'][0]['device_key_icon'] = $device_key_icon; if (permission_exists('device_key_icon')) {
$array['device_keys'][0]['device_key_icon'] = $device_key_icon;
}
$array['device_keys'][0]['device_key_category'] = $device_key_category; $array['device_keys'][0]['device_key_category'] = $device_key_category;
$array['device_keys'][0]['device_key_vendor'] = $device_key_vendor; $array['device_keys'][0]['device_key_vendor'] = $device_key_vendor;
@ -252,7 +254,9 @@
$array['device_keys'][0]['device_key_type'] = $device_key_type; $array['device_keys'][0]['device_key_type'] = $device_key_type;
$array['device_keys'][0]['device_key_value'] = $device_key_value; $array['device_keys'][0]['device_key_value'] = $device_key_value;
$array['device_keys'][0]['device_key_label'] = $device_key_label; $array['device_keys'][0]['device_key_label'] = $device_key_label;
$array['device_keys'][0]['device_key_icon'] = $device_key_icon; if (permission_exists('device_key_icon')) {
$array['device_keys'][0]['device_key_icon'] = $device_key_icon;
}
} }
if ($save) { if ($save) {
//add the temporary permissions //add the temporary permissions
@ -470,7 +474,9 @@
} }
echo " <th>".$text['label-device_key_value']."</th>\n"; echo " <th>".$text['label-device_key_value']."</th>\n";
echo " <th>".$text['label-device_key_label']."</th>\n"; echo " <th>".$text['label-device_key_label']."</th>\n";
echo " <th class='shrink'>".$text['label-device_key_icon']."</th>\n"; if (permission_exists('device_key_icon')) {
echo " <th class='shrink'>".$text['label-device_key_icon']."</th>\n";
}
echo " </tr>\n"; echo " </tr>\n";
} }
@ -610,11 +616,13 @@
echo " </td>\n"; echo " </td>\n";
echo " <td class='input'>\n"; echo " <td class='input'>\n";
echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_label]' maxlength='255' value=\"".$row['device_key_label']."\">\n"; echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_label]' maxlength='255' value=\"".$row['device_key_label']."\">\n";
echo " </td>\n";
echo " <td class='input'>\n";
echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_icon]' maxlength='255' value=\"".$row['device_key_icon']."\">\n";
echo " <input type='hidden' name='device_keys[".$x."][device_profile_uuid]' value=\"".$row['device_profile_uuid']."\">\n"; echo " <input type='hidden' name='device_keys[".$x."][device_profile_uuid]' value=\"".$row['device_profile_uuid']."\">\n";
echo " </td>\n"; echo " </td>\n";
if (permission_exists('device_key_icon')) {
echo " <td class='input'>\n";
echo " <input class='formfld' style='min-width: 50px; max-width: 100px;' type='text' name='device_keys[".$x."][device_key_icon]' maxlength='255' value=\"".$row['device_key_icon']."\">\n";
echo " </td>\n";
}
echo " </tr>\n"; echo " </tr>\n";
//set the previous vendor //set the previous vendor