Add a new permission to control whether a user is allowed to enable or disable an extension.

This commit is contained in:
Mark Crane 2013-12-14 00:50:57 +00:00
parent 49414038cd
commit 7acdde431e
2 changed files with 35 additions and 25 deletions

View File

@ -58,6 +58,10 @@
$apps[$x]['permissions'][$y]['name'] = "extension_toll";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "extension_enabled";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "outbound_caller_id_select";
//$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
//$apps[$x]['permissions'][$y]['groups'][] = "admin";

View File

@ -377,7 +377,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
$sql .= "sip_bypass_media, ";
$sql .= "dial_string, ";
if (permission_exists('extension_enabled')) {
$sql .= "enabled, ";
}
$sql .= "description ";
$sql .= ")";
$sql .= "values ";
@ -434,7 +436,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
$sql .= "'$sip_bypass_media', ";
$sql .= "'$dial_string', ";
if (permission_exists('extension_enabled')) {
$sql .= "'$enabled', ";
}
$sql .= "'$description' ";
$sql .= ")";
$db->exec(check_sql($sql));
@ -1638,6 +1642,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
//--- end: show_advanced -----------------------
if (permission_exists('extension_enabled')) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-enabled'].":\n";
@ -1662,6 +1667,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo $text['description-enabled']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";