mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
better logon process
git-svn-id: http://www.observium.org/svn/observer/trunk@318 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -30,8 +30,9 @@ if($_GET['logout']) {
|
||||
if($userlevel) {
|
||||
$_SESSION['userlevel'] = $userlevel;
|
||||
$_SESSION['authenticated'] = true;
|
||||
$_SESSION['username'] = $_POST['username'];
|
||||
$_SESSION['username'] = $username;
|
||||
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('$username', '".$_SERVER["REMOTE_ADDR"]."', 'logged in')");
|
||||
header("Location: ".$_SERVER['REQUEST_URI']);
|
||||
} else {
|
||||
$auth_message = "Authentication Failed";
|
||||
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('$username', '".$_SERVER["REMOTE_ADDR"]."', 'authentication failure')");
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
} ?>
|
||||
<li><a href="alerts/"><img src='images/16/exclamation.png' border=0 align=absmiddle> Alerts</a></li>
|
||||
<li><a href="inventory/"><img src='images/16/bricks.png' border=0 align=absmiddle> Inventory</a></li>
|
||||
<?php
|
||||
if($_SESSION['userlevel'] >= '10') {
|
||||
echo("
|
||||
|
||||
<li><a href='authlog/'><img src='images/16/lock.png' border=0 align=absmiddle> Authlog</a></li>");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
<!--[if lte IE 6]></a><![endif]-->
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?
|
||||
|
||||
if($_SESSION['userlevel'] == '10') {
|
||||
$query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `authlog` ORDER BY `datetime` DESC LIMIT 0,250";
|
||||
|
||||
|
||||
$data = mysql_query($query);
|
||||
|
||||
|
||||
echo("<table cellspacing=0 cellpadding=1 width=100%>");
|
||||
|
||||
while($entry = mysql_fetch_array($data)) {
|
||||
|
||||
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
|
||||
|
||||
echo("<tr style=\"background-color: $bg\">
|
||||
<td class=syslog width=160>
|
||||
" . $entry['datetime'] . "
|
||||
</td>
|
||||
<td class=list-bold width=125>
|
||||
".$entry['user']."
|
||||
</td>
|
||||
<td class=syslog width=150>
|
||||
".$entry['address']."
|
||||
</td>
|
||||
<td class=syslog width=150>
|
||||
".$entry['result']."
|
||||
</td>
|
||||
<td></td>
|
||||
");
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user