mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-04 10:43:49 +00:00
do not show others extension to non-admin users
This commit is contained in:
@@ -271,6 +271,24 @@ else {
|
||||
echo " <option value=''></option>\n";
|
||||
$sql = "select extension_uuid, extension, number_alias from v_extensions ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
|
||||
if (!(if_group("admin") || if_group("superadmin"))) {
|
||||
if (count($_SESSION['user']['extension']) > 0) {
|
||||
$sql .= "and (";
|
||||
$x = 0;
|
||||
foreach($_SESSION['user']['extension'] as $row) {
|
||||
if ($x > 0) { $sql .= "or "; }
|
||||
$sql .= "extension = '".$row['user']."' ";
|
||||
$x++;
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
else {
|
||||
//used to hide any results when a user has not been assigned an extension
|
||||
$sql .= "and extension = 'disabled' ";
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= "order by ";
|
||||
$sql .= "extension asc ";
|
||||
$sql .= ", number_alias asc ";
|
||||
@@ -284,7 +302,9 @@ else {
|
||||
unset ($prep_statement);
|
||||
echo " </select>\n";
|
||||
echo " <input type='text' class='formfld' style='".$style['caller_id_number']."' name='caller_id_number' id='caller_id_number' value='".$caller_id_number."'>\n";
|
||||
echo " <input type='button' id='btn_toggle_source' class='btn' name='' alt='".$text['button-back']."' value='◁' onclick=\"toggle('source');\">\n";
|
||||
if ((if_group("admin") || if_group("superadmin"))) {
|
||||
echo " <input type='button' id='btn_toggle_source' class='btn' name='' alt='".$text['button-back']."' value='◁' onclick=\"toggle('source');\">\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
@@ -651,4 +671,4 @@ else {
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
*/
|
||||
|
||||
require_once "root.php";
|
||||
@@ -61,6 +62,24 @@ require_once "resources/require.php";
|
||||
$sql .= "where ";
|
||||
$sql .= "enabled = 'true' ";
|
||||
$sql .= "and domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
|
||||
if (!(if_group("admin") || if_group("superadmin"))) {
|
||||
if (count($_SESSION['user']['extension']) > 0) {
|
||||
$sql .= "and (";
|
||||
$x = 0;
|
||||
foreach($_SESSION['user']['extension'] as $row) {
|
||||
if ($x > 0) { $sql .= "or "; }
|
||||
$sql .= "extension = '".$row['user']."' ";
|
||||
$x++;
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
else {
|
||||
//used to hide any results when a user has not been assigned an extension
|
||||
$sql .= "and extension = 'disabled' ";
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= "order by ";
|
||||
$sql .= "extension asc";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -315,4 +334,4 @@ require_once "resources/require.php";
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user