Merge pull request #5695 from daniel-lucio/patch-179

More permissions on the extensions
This commit is contained in:
FusionPBX 2020-12-29 09:53:20 -07:00 committed by GitHub
commit b86772e74b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 142 additions and 108 deletions

View File

@ -202,6 +202,26 @@
$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user"; $apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "extension_directory";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "extension_limit";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "extension_call_group";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
$y++;
$apps[$x]['permissions'][$y]['name'] = "extension_hold_music";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "user";
//default settings //default settings

View File

@ -405,12 +405,16 @@
if (permission_exists("emergency_caller_id_number")) { if (permission_exists("emergency_caller_id_number")) {
$array["extensions"][$i]["emergency_caller_id_number"] = $emergency_caller_id_number; $array["extensions"][$i]["emergency_caller_id_number"] = $emergency_caller_id_number;
} }
$array["extensions"][$i]["directory_first_name"] = $directory_first_name; if (permission_exists("extension_directory")) {
$array["extensions"][$i]["directory_last_name"] = $directory_last_name; $array["extensions"][$i]["directory_first_name"] = $directory_first_name;
$array["extensions"][$i]["directory_visible"] = $directory_visible; $array["extensions"][$i]["directory_last_name"] = $directory_last_name;
$array["extensions"][$i]["directory_exten_visible"] = $directory_exten_visible; $array["extensions"][$i]["directory_visible"] = $directory_visible;
$array["extensions"][$i]["limit_max"] = $limit_max; $array["extensions"][$i]["directory_exten_visible"] = $directory_exten_visible;
$array["extensions"][$i]["limit_destination"] = $limit_destination; }
if (permission_exists("extension_limit")) {
$array["extensions"][$i]["limit_max"] = $limit_max;
$array["extensions"][$i]["limit_destination"] = $limit_destination;
}
if (permission_exists("extension_user_context")) { if (permission_exists("extension_user_context")) {
$array["extensions"][$i]["user_context"] = $user_context; $array["extensions"][$i]["user_context"] = $user_context;
} }
@ -429,12 +433,16 @@
if (strlen($call_timeout) > 0) { if (strlen($call_timeout) > 0) {
$array["extensions"][$i]["call_timeout"] = $call_timeout; $array["extensions"][$i]["call_timeout"] = $call_timeout;
} }
$array["extensions"][$i]["call_group"] = $call_group; if (permission_exists("extension_call_group")) {
$array["extensions"][$i]["call_group"] = $call_group;
}
$array["extensions"][$i]["call_screen_enabled"] = $call_screen_enabled; $array["extensions"][$i]["call_screen_enabled"] = $call_screen_enabled;
if (permission_exists('extension_user_record')) { if (permission_exists('extension_user_record')) {
$array["extensions"][$i]["user_record"] = $user_record; $array["extensions"][$i]["user_record"] = $user_record;
} }
$array["extensions"][$i]["hold_music"] = $hold_music; if (permission_exists('extension_hold_music')) {
$array["extensions"][$i]["hold_music"] = $hold_music;
}
$array["extensions"][$i]["auth_acl"] = $auth_acl; $array["extensions"][$i]["auth_acl"] = $auth_acl;
if (permission_exists("extension_cidr")) { if (permission_exists("extension_cidr")) {
$array["extensions"][$i]["cidr"] = $cidr; $array["extensions"][$i]["cidr"] = $cidr;
@ -1468,89 +1476,93 @@
echo "</tr>\n"; echo "</tr>\n";
} }
echo "<tr>\n"; if (permission_exists("extension_directory")) {
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<tr>\n";
echo " ".$text['label-directory_full_name']."\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "</td>\n"; echo " ".$text['label-directory_full_name']."\n";
echo "<td class='vtable' align='left'>\n"; echo "</td>\n";
echo " <input class='formfld' type='text' name='directory_first_name' maxlength='255' value=\"".escape($directory_first_name)."\">\n"; echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='directory_last_name' maxlength='255' value=\"".escape($directory_last_name)."\">\n"; echo " <input class='formfld' type='text' name='directory_first_name' maxlength='255' value=\"".escape($directory_first_name)."\">\n";
echo "<br />\n"; echo " <input class='formfld' type='text' name='directory_last_name' maxlength='255' value=\"".escape($directory_last_name)."\">\n";
echo $text['description-directory_full_name']."\n"; echo "<br />\n";
echo "</td>\n"; echo $text['description-directory_full_name']."\n";
echo "</tr>\n"; echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-directory_visible']."\n"; echo " ".$text['label-directory_visible']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='directory_visible'>\n"; echo " <select class='formfld' name='directory_visible'>\n";
if ($directory_visible == "true") { if ($directory_visible == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n"; echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
} }
else { else {
echo " <option value='true'>".$text['label-true']."</option>\n"; echo " <option value='true'>".$text['label-true']."</option>\n";
} }
if ($directory_visible == "false") { if ($directory_visible == "false") {
echo " <option value='false' selected >".$text['label-false']."</option>\n"; echo " <option value='false' selected >".$text['label-false']."</option>\n";
} }
else { else {
echo " <option value='false'>".$text['label-false']."</option>\n"; echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " </select>\n"; echo " </select>\n";
echo "<br />\n"; echo "<br />\n";
echo "<br />\n"; echo "<br />\n";
echo $text['description-directory_visible']."\n"; echo $text['description-directory_visible']."\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-directory_exten_visible']."\n"; echo " ".$text['label-directory_exten_visible']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='directory_exten_visible'>\n"; echo " <select class='formfld' name='directory_exten_visible'>\n";
if ($directory_exten_visible == "true") { if ($directory_exten_visible == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n"; echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($directory_exten_visible == "false") {
echo " <option value='false' selected >".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "<br />\n";
echo $text['description-directory_exten_visible']."\n";
echo "</td>\n";
echo "</tr>\n";
} }
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($directory_exten_visible == "false") {
echo " <option value='false' selected >".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "<br />\n";
echo $text['description-directory_exten_visible']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n"; if (permission_exists("extension_limit")) {
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<tr>\n";
echo " ".$text['label-limit_max']."\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "</td>\n"; echo " ".$text['label-limit_max']."\n";
echo "<td class='vtable' align='left'>\n"; echo "</td>\n";
echo " <input class='formfld' type='text' name='limit_max' maxlength='255' value=\"".escape($limit_max)."\">\n"; echo "<td class='vtable' align='left'>\n";
echo "<br />\n"; echo " <input class='formfld' type='text' name='limit_max' maxlength='255' value=\"".escape($limit_max)."\">\n";
echo $text['description-limit_max']."\n"; echo "<br />\n";
echo "</td>\n"; echo $text['description-limit_max']."\n";
echo "</tr>\n"; echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-limit_destination']."\n"; echo " ".$text['label-limit_destination']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='limit_destination' maxlength='255' value=\"".escape($limit_destination)."\">\n"; echo " <input class='formfld' type='text' name='limit_destination' maxlength='255' value=\"".escape($limit_destination)."\">\n";
echo "<br />\n"; echo "<br />\n";
echo $text['description-limit_destination']."\n"; echo $text['description-limit_destination']."\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
}
if (permission_exists('voicemail_edit') && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) { if (permission_exists('voicemail_edit') && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
echo "<tr>\n"; echo "<tr>\n";
@ -1679,30 +1691,32 @@
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "<tr>\n"; if (permission_exists("extension_call_group")) {
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<tr>\n";
echo " ".$text['label-call_group']."\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo "</td>\n"; echo " ".$text['label-call_group']."\n";
echo "<td class='vtable' align='left'>\n"; echo "</td>\n";
if (is_array($_SESSION['call group']['name'])) { echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_group'>\n"; if (is_array($_SESSION['call group']['name'])) {
echo " <option value=''></option>\n"; echo " <select class='formfld' name='call_group'>\n";
foreach ($_SESSION['call group']['name'] as $name) { echo " <option value=''></option>\n";
if ($name == $call_group) { foreach ($_SESSION['call group']['name'] as $name) {
echo " <option value='".escape($name)."' selected='selected'>".escape($name)."</option>\n"; if ($name == $call_group) {
} echo " <option value='".escape($name)."' selected='selected'>".escape($name)."</option>\n";
else { }
echo " <option value='".escape($name)."'>".escape($name)."</option>\n"; else {
echo " <option value='".escape($name)."'>".escape($name)."</option>\n";
}
} }
echo " </select>\n";
} else {
echo " <input class='formfld' type='text' name='call_group' maxlength='255' value=\"".escape($call_group)."\">\n";
} }
echo " </select>\n"; echo "<br />\n";
} else { echo $text['description-call_group']."\n";
echo " <input class='formfld' type='text' name='call_group' maxlength='255' value=\"".escape($call_group)."\">\n"; echo "</td>\n";
echo "</tr>\n";
} }
echo "<br />\n";
echo $text['description-call_group']."\n";
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('extension_call_screen')) { if (permission_exists('extension_call_screen')) {
echo "<tr>\n"; echo "<tr>\n";
@ -1769,7 +1783,7 @@
echo "</tr>\n"; echo "</tr>\n";
} }
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold')) { if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold') && permission_exists('extension_hold_music')) {
echo "<tr>\n"; echo "<tr>\n";
echo "<td width=\"30%\" class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td width=\"30%\" class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-hold_music']."\n"; echo " ".$text['label-hold_music']."\n";