mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updates and fixes
git-svn-id: http://www.observium.org/svn/observer/trunk@439 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
4
cron.sh
4
cron.sh
@@ -2,8 +2,8 @@
|
||||
|
||||
#./discovery.php --forced >> /var/log/observer.log
|
||||
|
||||
./poll-device.php --odd >> /var/log/observer.log &
|
||||
./poll-device.php --even >> /var/log/observer.log &
|
||||
./poll-device.php --all >> /var/log/observer.log &
|
||||
#./poll-device.php --even >> /var/log/observer.log &
|
||||
|
||||
#./poll-device.php --odd3 >> /var/log/observer.log &
|
||||
#./poll-device.php --even3 >> /var/log/observer.log &
|
||||
|
@@ -1,40 +1,52 @@
|
||||
<?php
|
||||
|
||||
|
||||
@ini_set("session.gc_maxlifetime","0");
|
||||
|
||||
session_start();
|
||||
|
||||
if($_GET['logout']) {
|
||||
$olduser = $_SESSION['username'];
|
||||
unset($_SESSION);
|
||||
session_destroy();
|
||||
header('Location: /');
|
||||
setcookie ("username", "", time() - 3600);
|
||||
setcookie ("encrypted", "", time() - 3600);
|
||||
setcookie ("username", "", time() - 60*60*24*100, "/");
|
||||
setcookie ("password", "", time() - 60*60*24*100, "/");
|
||||
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('$olduser', '".$_SERVER["REMOTE_ADDR"]."', 'logged out')");
|
||||
$auth_message = "Logged Out";
|
||||
} else {
|
||||
unset ($_SESSION['authenticated']);
|
||||
|
||||
|
||||
if($_POST['username'] && $_POST['password']){
|
||||
$username = mres($_POST['username']);
|
||||
$password = mres($_POST['password']);
|
||||
$encrypted = md5($password);
|
||||
$sql = "SELECT * FROM `users` WHERE `username`='$username' AND `password`='$encrypted'";
|
||||
$query = mysql_query($sql);
|
||||
$row = @mysql_fetch_array($query);
|
||||
if($row['level']) {
|
||||
$_SESSION['userlevel'] = $row['level'];
|
||||
$_SESSION['user_id'] = $row['user_id'];
|
||||
$_SESSION['authenticated'] = true;
|
||||
$_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')");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($_POST['username'] && $_POST['password']){
|
||||
$_SESSION['username'] = mres($_POST['username']);
|
||||
$_SESSION['password'] = mres($_POST['password']);
|
||||
}
|
||||
|
||||
if($_COOKIE['username'] && $_COOKIE['password']){
|
||||
$_SESSION['username'] = mres($_COOKIE['username']);
|
||||
$_SESSION['password'] = mres($_COOKIE['password']);
|
||||
}
|
||||
|
||||
|
||||
$encrypted = md5($_SESSION['password']);
|
||||
$sql = "SELECT * FROM `users` WHERE `username`='".$_SESSION['username']."' AND `password`='".$encrypted."'";
|
||||
$query = mysql_query($sql);
|
||||
$row = @mysql_fetch_array($query);
|
||||
if($row['username'] && $row['username'] == $_SESSION['username']) {
|
||||
$_SESSION['userlevel'] = $row['level'];
|
||||
$_SESSION['user_id'] = $row['user_id'];
|
||||
if(!$_SESSION['authenticated']) {
|
||||
$_SESSION['authenticated'] = true;
|
||||
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('".$_SESSION['username']."', '".$_SERVER["REMOTE_ADDR"]."', 'logged in')");
|
||||
header("Location: ".$_SERVER['REQUEST_URI']);
|
||||
}
|
||||
if(isset($_POST['remember'])){
|
||||
setcookie("username", $_SESSION['username'], time()+60*60*24*100, "/");
|
||||
setcookie("password", $_SESSION['password'], time()+60*60*24*100, "/");
|
||||
}
|
||||
} else {
|
||||
$auth_message = "Authentication Failed";
|
||||
unset ($_SESSION['authenticated']);
|
||||
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('".$_SESSION['username']."', '".$_SERVER["REMOTE_ADDR"]."', 'authentication failure')");
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -103,11 +103,11 @@ function popUp(URL) {
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if($_SESSION['authenticated']) {include("includes/print-menubar.php");} else {echo("<hr colour=#444444 />");} ?>
|
||||
|
||||
<div class=clearer></div>
|
||||
|
||||
|
||||
<div class="content-mat" style="border: 1px none #fcc;">
|
||||
<div id="content" style="border: 1px none #ccc; min-height:650px;">
|
||||
<div style="margin: 7px;"></div>
|
||||
|
@@ -20,17 +20,17 @@
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$day&to=$now&width=400&height=150";
|
||||
$daily_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$week&to=$now&width=400&height=150";
|
||||
$weekly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$month&to=$now&width=400&height=150";
|
||||
$monthly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cempMemPool&from=$year&to=$now&width=400&height=150";
|
||||
$yearly_graph = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
|
@@ -3,6 +3,8 @@
|
||||
$interface_query = mysql_query("select * from interfaces WHERE interface_id = '".$_GET['opta']."'");
|
||||
$interface = mysql_fetch_array($interface_query);
|
||||
|
||||
$port_details = 1;
|
||||
|
||||
$hostname = $device['hostname'];
|
||||
$hostid = $device['interface_id'];
|
||||
$ifname = $interface['ifDescr'];
|
||||
@@ -22,9 +24,6 @@ $interface = mysql_fetch_array($interface_query);
|
||||
$inf = fixifName($ifname);
|
||||
|
||||
$bg="#ffffff";
|
||||
# echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%>");
|
||||
# include("includes/device-header.inc");
|
||||
# echo("</table>");
|
||||
|
||||
$show_all = 1;
|
||||
|
||||
|
@@ -20,6 +20,9 @@
|
||||
|
||||
<td><input type='password' name='password'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' align='right'><input type='checkbox' name='remember'>
|
||||
<font size='2'>Remember Me</td>
|
||||
<tr>
|
||||
<td colspan=2 align='right'><input name='submit' type='submit' value='Login'></td>
|
||||
</tr>");
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
## Common Functions
|
||||
|
||||
function mres($string) { // short function wrapper because the real one is stupidly long and ugly. aestetics.
|
||||
return mysql_real_escape_string($string);
|
||||
}
|
||||
|
||||
function getifhost($id) {
|
||||
$sql = mysql_query("SELECT `device_id` from `interfaces` WHERE `interface_id` = '$id'");
|
||||
$result = @mysql_result($sql, 0);
|
||||
|
@@ -55,10 +55,6 @@ function only_alphanumeric( $string )
|
||||
}
|
||||
|
||||
|
||||
function mres($string) { // short function wrapper because the real one is stupidly long and ugly. aestetics.
|
||||
return mysql_real_escape_string($string);
|
||||
}
|
||||
|
||||
function validate_hostip($host) {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user