mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
some formatting cleanups, introduce some more FIXMEs to look at, plus replace mysql_fetch_array by mysql_fetch_assoc, for great justice
git-svn-id: http://www.observium.org/svn/observer/trunk@2029 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -8,7 +8,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
{
|
||||
if ($_GET['user_id'])
|
||||
{
|
||||
$user_data = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user_id = '" . $_GET['user_id'] . "'"));
|
||||
$user_data = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE user_id = '" . $_GET['user_id'] . "'"));
|
||||
echo("<p><h2>" . $user_data['realname'] . "</h2><a href='?page=edituser'>Change...</a></p>");
|
||||
// Perform actions if requested
|
||||
|
||||
@@ -61,7 +61,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
echo("<h3>Device Access</h3>");
|
||||
|
||||
$device_perm_data = mysql_query("SELECT * from devices_perms as P, devices as D WHERE `user_id` = '" . $_GET['user_id'] . "' AND D.device_id = P.device_id");
|
||||
while ($device_perm = mysql_fetch_array($device_perm_data))
|
||||
while ($device_perm = mysql_fetch_assoc($device_perm_data))
|
||||
{
|
||||
echo("<strong>" . $device_perm['hostname'] . " <a href='?page=edituser&action=deldevperm&user_id=" . $_GET['user_id'] . "&device_id=" . $device_perm['device_id'] . "'><img src='images/16/cross.png' align=absmiddle border=0></a></strong><br />");
|
||||
$access_list[] = $device_perm['device_id'];
|
||||
@@ -79,7 +79,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
<select name='device_id' class=selector>");
|
||||
|
||||
$device_list = mysql_query("SELECT * FROM `devices` ORDER BY hostname");
|
||||
while ($device = mysql_fetch_array($device_list))
|
||||
while ($device = mysql_fetch_assoc($device_list))
|
||||
{
|
||||
unset($done);
|
||||
foreach ($access_list as $ac) { if ($ac == $device['device_id']) { $done = 1; } }
|
||||
@@ -97,7 +97,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
$interface_perm_data = mysql_query("SELECT * from ports_perms as P, ports as I, devices as D WHERE `user_id` = '" . $_GET['user_id'] .
|
||||
"' AND I.interface_id = P.interface_id AND D.device_id = I.device_id");
|
||||
|
||||
while ($interface_perm = mysql_fetch_array($interface_perm_data))
|
||||
while ($interface_perm = mysql_fetch_assoc($interface_perm_data))
|
||||
{
|
||||
echo("<table><tr><td><strong>".$interface_perm['hostname']." - ".$interface_perm['ifDescr']."</strong><br />".
|
||||
"" . $interface_perm['ifAlias'] . "</td><td width=50> <a href='?page=edituser&action=delifperm&user_id=" . $_GET['user_id'] .
|
||||
@@ -119,7 +119,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
<option value=''>Select a device</option>");
|
||||
|
||||
$device_list = mysql_query("SELECT * FROM `devices` ORDER BY hostname");
|
||||
while ($device = mysql_fetch_array($device_list))
|
||||
while ($device = mysql_fetch_assoc($device_list))
|
||||
{
|
||||
unset($done);
|
||||
foreach ($access_list as $ac) { if ($ac == $device['device_id']) { $done = 1; } }
|
||||
@@ -137,7 +137,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
$bill_perm_data = mysql_query("SELECT * from bills AS B, bill_perms AS P WHERE P.user_id = '" . $_GET['user_id'] .
|
||||
"' AND P.bill_id = B.bill_id");
|
||||
|
||||
while ($bill_perm = mysql_fetch_array($bill_perm_data))
|
||||
while ($bill_perm = mysql_fetch_assoc($bill_perm_data))
|
||||
{
|
||||
echo("<table><tr><td><strong>".$bill_perm['bill_name']."</strong></td><td width=50> <a href='?page=edituser&action=delbillperm&user_id=" .
|
||||
$_GET['user_id'] . "&bill_id=" . $bill_perm['bill_id'] . "'><img src='images/16/cross.png' align=absmiddle border=0></a></td></tr></table>");
|
||||
@@ -157,7 +157,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
<select name='bill_id' class=selector>");
|
||||
|
||||
$bills = mysql_query("SELECT * FROM `bills` ORDER BY `bill_name`");
|
||||
while ($bill = mysql_fetch_array($bills))
|
||||
while ($bill = mysql_fetch_assoc($bills))
|
||||
{
|
||||
unset($done);
|
||||
foreach ($bill_access_list as $ac) { if ($ac == $bill['bill_id']) { $done = 1; } }
|
||||
@@ -179,7 +179,7 @@ if ($_SESSION['userlevel'] != '10') { include("includes/error-no-perm.inc.php");
|
||||
echo("<form method='get' action=''>
|
||||
<input type='hidden' value='edituser' name='page'>
|
||||
<select name='user_id'>");
|
||||
while ($user_entry = mysql_fetch_array($user_list))
|
||||
while ($user_entry = mysql_fetch_assoc($user_list))
|
||||
{
|
||||
echo("<option value='" . $user_entry['user_id'] . "'>" . $user_entry['username'] . "</option>");
|
||||
}
|
||||
|
Reference in New Issue
Block a user