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

@@ -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)