move authenticate to a little later, update CHANGELOG for VMware support, minor cleanups, prettify message- and errorboxes

git-svn-id: http://www.observium.org/svn/observer/trunk@1979 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-26 19:28:39 +00:00
parent 7454791074
commit 7ffefc0d57
12 changed files with 32 additions and 22 deletions

View File

@@ -20,6 +20,7 @@ SVN 0.10-current
* Add support for Ingrasys iPoMan 1200 series PDUs
* Add support for Socomec Net Vision UPS systems
* Add support for ServerTech Sentry3 power systems
* Add support for VMWare ESX hosts, and listing their virtual machines
* MySQL and nginx application pollers
* Add support for IPMI polling on servers
* Add a new discovery parameter to only discover new devices, this can be run every 5 minutes

View File

@@ -6,15 +6,22 @@ session_start();
// Preflight checks
if (!is_dir($config['rrd_dir']))
{
echo("<div class='errorbox'>RRD Log Directory is missing ({$config['rrd_dir']}). Graphing may fail.</div>");
}
if (!is_dir($config['temp_dir']))
{
echo("<div class='errorbox'>Temp Directory is missing ({$config['tmp_dir']}). Graphing may fail.</div>");
}
if (!is_writable($config['temp_dir']))
{
echo("<div class='errorbox'>Temp Directory is not writable ({$config['tmp_dir']}). Graphing may fail.</div>");
}
if (isset($_GET['logout']) && $_SESSION['authenticated']) {
if (isset($_GET['logout']) && $_SESSION['authenticated'])
{
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('" . $_SESSION['username'] . "', '".$_SERVER["REMOTE_ADDR"]."', 'logged out')");
unset($_SESSION);
session_destroy();
@@ -24,13 +31,14 @@ if (isset($_GET['logout']) && $_SESSION['authenticated']) {
$auth_message = "Logged Out";
}
if (isset($_GET['username']) && isset($_GET['password'])){
if (isset($_GET['username']) && isset($_GET['password']))
{
$_SESSION['username'] = mres($_GET['username']);
$_SESSION['password'] = mres($_GET['password']);
} elseif (isset($_POST['username']) && isset($_POST['password'])){
} elseif (isset($_POST['username']) && isset($_POST['password'])) {
$_SESSION['username'] = mres($_POST['username']);
$_SESSION['password'] = mres($_POST['password']);
} elseif (isset($_COOKIE['username']) && isset($_COOKIE['password'])){
} elseif (isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
$_SESSION['username'] = mres($_COOKIE['username']);
$_SESSION['password'] = mres($_COOKIE['password']);
}
@@ -46,7 +54,7 @@ if (file_exists('includes/authentication/' . $config['auth_mechanism'] . '.inc.p
}
else
{
echo("<div class='errorbox'>ERROR: no valid auth_mechanism defined</div>");
print_error('ERROR: no valid auth_mechanism defined!');
exit();
}

View File

@@ -334,12 +334,12 @@ function humanspeed($speed)
function print_error($text)
{
echo('<table class="errorbox" cellpadding="3"><tr><td><img src="/images/15/exclamation.png" align="absmiddle"> '.$text.'</td></tr></table>');
echo('<div class="errorbox"><img src="/images/15/exclamation.png" align="absmiddle"> '.$text.'</div>');
}
function print_message($text)
{
echo('<table class="messagebox" cellpadding="3"><tr><td><img src="/images/16/tick.png" align="absmiddle"> '.$text.'</td></tr></table>');
echo('<div class="messagebox"><img src="/images/16/tick.png" align="absmiddle"> '.$text.'</div>');
}
function devclass($device)

View File

@@ -23,7 +23,6 @@ include("../includes/defaults.inc.php");
include("../config.php");
include("../includes/functions.php");
include("includes/functions.inc.php");
include("includes/authenticate.inc.php");
$start = utime();
$now = time();
@@ -61,8 +60,8 @@ if (is_array($config['branding']))
<?php
if ($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$config['page_refresh']."'>"); }
?>
<link href="<?php echo($config['stylesheet']); ?>" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="<?php echo($config['favicon']); ?>" />
<link href="<?php echo($config['stylesheet']); ?>" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="<?php echo($config['favicon']); ?>" />
<link rel="stylesheet" href="css/mktree.css" type="text/css" />
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
@@ -81,13 +80,15 @@ function popUp(URL)
<script type="text/javascript" src="js/overlib.js"></script>
<div id="center">
<?php
<?php include("includes/".$config['web_header']); ?>
include("includes/authenticate.inc.php");
include("includes/".$config['web_header']);
<?php if ($_SESSION['authenticated']) {include("includes/print-menubar.php"); } else {echo('<hr color="#444444" />'); } ?>
if ($_SESSION['authenticated']) { include("includes/print-menubar.php"); } else { echo('<hr color="#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>

View File

@@ -83,7 +83,7 @@ if ($_GET['opta'] == "add")
<tr>
<td width='40' align=center valign=middle><div style='font-weight: bold; font-size: 16px;'>Bills</div></td>
<td width='240'><span style='font-weight: bold; font-size: 14px;'></span>
<input type="text" name="hostname" id="hostname" size=40 value="<?php echo($_POST['hostname']); ?>" />
<input type="text" name="hostname" id="hostname" size=40 value="<?php echo($_POST['hostname']); ?>" />
</td>
<td width='100'>
<select name='os' id='os'>

View File

@@ -6,7 +6,7 @@ print_optionbar_start('25');
<form method="post" action="">
<label><strong>Search</strong>
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
</label>
<label>
<strong>Program</strong>

View File

@@ -17,7 +17,7 @@ print_optionbar_start(62);
<tr>
<td width="30" align="center" valign="middle"></td>
<td width="300"><span style="font-weight: bold; font-size: 14px;"></span>
<input type="text" name="hostname" id="hostname" size="40" value="<?php echo($_POST['hostname']); ?>" />
<input type="text" name="hostname" id="hostname" size="40" value="<?php echo($_POST['hostname']); ?>" />
</td>
<td width="200">
<select name='os' id='os'>

View File

@@ -3,7 +3,7 @@
<form method="post" action="">
<label><strong>Descr</strong>
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
</label>
<label>
<strong>Part No</strong>
@@ -40,7 +40,7 @@
?>
</select>
</label>
<input type="text" size=24 name="device_string" id="device_string" value="<?php echo($_POST['device_string']); ?>" />
<input type="text" size=24 name="device_string" id="device_string" value="<?php echo($_POST['device_string']); ?>" />
<input style type=submit class=submit value=Search>
<?php

View File

@@ -27,7 +27,7 @@ while ($data = mysql_fetch_array($query))
<td>
</td>
<td width=400>
<input type="text" name="address" id="address" size=40 value="<?php echo($_POST['address']); ?>" />
<input type="text" name="address" id="address" size=40 value="<?php echo($_POST['address']); ?>" />
<input style="align:right;" type=submit class=submit value=Search></div>
</td>
</form>

View File

@@ -27,7 +27,7 @@ while ($data = mysql_fetch_array($query))
<td>
</td>
<td width=400>
<input type="text" name="address" id="address" size=40 value="<?php echo($_POST['address']); ?>" />
<input type="text" name="address" id="address" size=40 value="<?php echo($_POST['address']); ?>" />
<input style="align:right;" type=submit class=submit value=Search></div>
</td>
</form>

View File

@@ -64,7 +64,7 @@
</select>
</td>
<td>
<input type="text" name="ifAlias" id="ifAlias" size=40 value="<?php echo($_POST['ifAlias']); ?>" />
<input type="text" name="ifAlias" id="ifAlias" size=40 value="<?php echo($_POST['ifAlias']); ?>" />
Deleted <input type=checkbox id="deleted" name="deleted" value=1 <?php if ($_POST['deleted']) { echo("checked"); } ?> ></input>
</td>
<td style="text-align: right;">

View File

@@ -6,7 +6,7 @@
<form method="post" action="">
<label><strong>Search</strong>
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
</label>
<label>
<strong>Program</strong>