mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
- User with restricted privileges will see only Locations where they have any access on. Other locations will be filtered from the lists.
git-svn-id: http://www.observium.org/svn/observer/trunk@1916 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -104,7 +104,11 @@ if ($_SESSION['userlevel'] >= '10') {
|
|||||||
## Display Locations entry if $config['show_locations']
|
## Display Locations entry if $config['show_locations']
|
||||||
if ($config['show_locations'])
|
if ($config['show_locations'])
|
||||||
{
|
{
|
||||||
$locations = mysql_query("SELECT DISTINCT location FROM devices ORDER BY location");
|
if($_SESSION['userlevel'] >= '5') {
|
||||||
|
$locations = mysql_query("SELECT DISTINCT location FROM devices GROUP BY location ORDER BY location");
|
||||||
|
} else {
|
||||||
|
$locations = mysql_query("SELECT DISTINCT location FROM devices AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' GROUP BY location ORDER BY location");
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<li><a class="menu2four" href="locations/"><img src="images/16/building.png" border="0" align="absmiddle" /> Locations</a>
|
<li><a class="menu2four" href="locations/"><img src="images/16/building.png" border="0" align="absmiddle" /> Locations</a>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -89,7 +89,13 @@ print_optionbar_start(62);
|
|||||||
<select name="location" id="location">
|
<select name="location" id="location">
|
||||||
<option value="">All Locations</option>
|
<option value="">All Locations</option>
|
||||||
<?php
|
<?php
|
||||||
$query = mysql_query("SELECT `location` FROM `devices` WHERE 1 $where GROUP BY `location` ORDER BY `location`");
|
|
||||||
|
if($_SESSION['userlevel'] >= '5') {
|
||||||
|
$query = mysql_query("SELECT location FROM devices WHERE 1 $where GROUP BY location ORDER BY location");
|
||||||
|
} else {
|
||||||
|
$query = mysql_query("SELECT location FROM devices AS D, devices_perms AS P WHERE 1 $where AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' GROUP BY location ORDER BY location");
|
||||||
|
}
|
||||||
|
|
||||||
while ($data = mysql_fetch_array($query))
|
while ($data = mysql_fetch_array($query))
|
||||||
{
|
{
|
||||||
if ($data['location'])
|
if ($data['location'])
|
||||||
|
|||||||
Reference in New Issue
Block a user