- Fixed Bug #0000010: Do not commit empty user passwords to DB.

- Removed navbar from admin.php since its broken there anyway.
- Catch empty results in "Overview" page.
- Some formating and cleanup.
This commit is contained in:
Frank Fegert 2009-06-25 19:40:21 +00:00
parent 706a738ff1
commit 3f1dfaea2e
3 changed files with 5 additions and 11 deletions

View File

@ -86,10 +86,8 @@ if ($_POST["css"] != "") {
} }
if ($tmonpolld->isEnabled()=="1") { if ($tmonpolld->isEnabled()=="1") {
$polldenabled = "enabled and ".$tmonpolld->getStatus(); $polldenabled = "enabled and ".$tmonpolld->getStatus();
//$cellcolor = "green";
} else { } else {
$polldenabled = "disabled"; $polldenabled = "disabled";
//$cellcolor = "red";
} }
echo "<form action=".$_SERVER['PHP_SELF']."?q=".$tsmmonitor->GETVars['qq']."&m=".$tsmmonitor->GETVars['menu']." method='post'>"; echo "<form action=".$_SERVER['PHP_SELF']."?q=".$tsmmonitor->GETVars['qq']."&m=".$tsmmonitor->GETVars['menu']." method='post'>";
echo "<table class='zebra'>"; echo "<table class='zebra'>";
@ -250,7 +248,8 @@ if ($_POST["css"] != "") {
if ($_POST["txt".$col['Field']] != "") { if ($_POST["txt".$col['Field']] != "") {
$val = md5($_POST["txt".$col['Field']]); $val = md5($_POST["txt".$col['Field']]);
} else { } else {
$val = ""; $pwerr = "<p style='font-size: 14px; font-weight: bold; color: red;'>Password cannot be empty! Password was not reset.</p>";
continue;
} }
} else { } else {
$val = $_POST["txt".$col['Field']]; $val = $_POST["txt".$col['Field']];
@ -273,6 +272,7 @@ if ($_POST["css"] != "") {
} }
$adodb->updateDB("cfg_".$_GET['q'], $colarray, 'id'); $adodb->updateDB("cfg_".$_GET['q'], $colarray, 'id');
} }
if (!empty($pwerr)) echo $pwerr;
echo "<form action=".$_SERVER['PHP_SELF']."?q=".$tsmmonitor->GETVars['qq']."&m=".$tsmmonitor->GETVars['menu']." method='post'>"; echo "<form action=".$_SERVER['PHP_SELF']."?q=".$tsmmonitor->GETVars['qq']."&m=".$tsmmonitor->GETVars['menu']." method='post'>";
echo "<table class='zebra'>"; echo "<table class='zebra'>";
$thead = $tsmmonitor->getTableheader(); $thead = $tsmmonitor->getTableheader();
@ -281,11 +281,7 @@ if ($_POST["css"] != "") {
if ($tbody != "") { if ($tbody != "") {
echo $tbody; echo $tbody;
} else { } else {
echo "<tr class='d0'><td colspan='".($thead["numfields"]+1)."' align='center'>No entries found in database.</td></tr>"; echo "<tr class='d0'><td colspan='".($thead["numfields"] + 1)."' align='center'>No entries found in database.</td></tr>";
}
$nav = $tsmmonitor->showPageNavigation("40");
if ($nav!="") {
echo "<tr><td colspan='".($thead["numfields"]+1)."' align='center' class='footer'><a class='navhead'>".$nav."</a></td></tr>";
} }
echo "</table>"; echo "</table>";
echo "<input type='submit' class='button' name='Add' value='Add' onclick='submit();'>"; echo "<input type='submit' class='button' name='Add' value='Add' onclick='submit();'>";

View File

@ -47,7 +47,6 @@
<td width='48%' valign='top'> <td width='48%' valign='top'>
<table class='zebra'> <table class='zebra'>
<tr><th colspan="2">TSM Database</th></tr> <tr><th colspan="2">TSM Database</th></tr>
<?php //echo getOverviewRows(getInfobox("database")); ?>
<?php echo $tsmmonitor->getOverviewRows($tsmmonitor->configarray["infoboxarray"]["database"]); ?> <?php echo $tsmmonitor->getOverviewRows($tsmmonitor->configarray["infoboxarray"]["database"]); ?>
</table> </table>
</td> </td>
@ -57,7 +56,6 @@
<td width='48%' valign='top'> <td width='48%' valign='top'>
<table class='zebra'> <table class='zebra'>
<tr><th colspan="2">Total Data</th></tr> <tr><th colspan="2">Total Data</th></tr>
<?php //echo getOverviewRows(getInfobox("totaldata")); ?>
<?php echo $tsmmonitor->getOverviewRows($tsmmonitor->configarray["infoboxarray"]["totaldata"]); ?> <?php echo $tsmmonitor->getOverviewRows($tsmmonitor->configarray["infoboxarray"]["totaldata"]); ?>
</table> </table>
</td> </td>
@ -66,7 +64,6 @@
<td width='48%' valign='top'> <td width='48%' valign='top'>
<table class='zebra'> <table class='zebra'>
<tr><th colspan="2">Schedule Status</th></tr> <tr><th colspan="2">Schedule Status</th></tr>
<?php //echo getOverviewRows(getInfobox("schedules")); ?>
<?php echo $tsmmonitor->getOverviewRows($tsmmonitor->configarray["infoboxarray"]["schedules"]); ?> <?php echo $tsmmonitor->getOverviewRows($tsmmonitor->configarray["infoboxarray"]["schedules"]); ?>
</table> </table>
</td> </td>

View File

@ -1156,6 +1156,7 @@ class TSMMonitor {
} else { } else {
$sql = "SELECT name, result from res_overview_".$this->GETVars['server']." where name='".$subindexqueryarray[$key]["name"]."'"; $sql = "SELECT name, result from res_overview_".$this->GETVars['server']." where name='".$subindexqueryarray[$key]["name"]."'";
$sqlres = $this->adodb->fetchArrayDB($sql); $sqlres = $this->adodb->fetchArrayDB($sql);
if (empty($sqlres[0]["result"])) $sqlres[0]["result"] = 0;
$comperator = $subindexqueryarray[$key]["alert_comp"]; $comperator = $subindexqueryarray[$key]["alert_comp"];
$alertval = $subindexqueryarray[$key]["alert_val"]; $alertval = $subindexqueryarray[$key]["alert_val"];
$alertcol = $subindexqueryarray[$key]["alert_col"]; $alertcol = $subindexqueryarray[$key]["alert_col"];