The buttonbar at the top of each page is now a fixed 'div' element
authorarjen <arjen>
Wed, 21 Nov 2007 14:38:06 +0000 (14:38 +0000)
committerarjen <arjen>
Wed, 21 Nov 2007 14:38:06 +0000 (14:38 +0000)
instead of a framed page.
Contributed by Edwin Nadorp.

15 files changed:
src/web/abuse.php
src/web/classes.php
src/web/gnucomo.css
src/web/index.php [new file with mode: 0644]
src/web/issues.php
src/web/log.php
src/web/login.php
src/web/logout.php
src/web/notification.php
src/web/objects.php
src/web/page.class.php
src/web/parameter.php
src/web/parameter_compare.php
src/web/services.php
src/web/users.php

index 03347bf..5da4b0d 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : abuse.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.3 $
+**      VERSION NUMBER : $Revision: 1.4 $
 **
 **  DESCRIPTION      : Abuse list page
 **
 
 /*****************************
    $Log: abuse.php,v $
-   Revision 1.3  2007-10-19 07:15:52  arjen
+   Revision 1.4  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.3  2007/10/19 07:15:52  arjen
    In the abuse list, IP addresses can be whitelisted.
 
    Revision 1.2  2007/01/11 13:44:29  arjen
@@ -39,7 +44,7 @@
 
 ******************************/
 
-// RCSID = "$Id: abuse.php,v 1.3 2007-10-19 07:15:52 arjen Exp $";
+// RCSID = "$Id: abuse.php,v 1.4 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -56,7 +61,10 @@ class abuse_list extends page
          $res = pg_exec($this->database, "SELECT objectname FROM object
                                           WHERE objectid=CAST('" . $_GET['oid']."' AS BIGINT)");
          $obj = pg_fetch_object($res, 0);
-         echo "<h1>Abuse List for " . $obj->objectname . "</h1><hr>";
+
+         echo "<script type='text/ecmascript'>";
+         echo "document.getElementById('menu_title').innerHTML =";
+         echo " '<h1>Abuse List for " . $obj->objectname . "<\/h1>'</script>";
 
          if (!empty($_POST['ACTION']) && ($_POST['ACTION'] == 'Abuse'))
          {
@@ -176,14 +184,14 @@ class abuse_list extends page
          }
          else
          {
-            echo "<form method='post'>";
+            echo "<form method='post' action='abuse.php'>";
             echo "Report <input type='submit' name='ACTION' value='Abuse'>";
             echo " for IP address <input type='text' name='source'>";
             echo " or <input type='submit' name='ACTION' value='Whitelist'>";
             echo " with status <input type='text' name='status'>";
             echo "</form>"; 
    
-            echo "<form method='post'>";
+            echo "<form method='post' action='abuse.php'>";
             echo "<input type='submit' name='ACTION' value='Investigate'>";
             echo " or <input type='submit' name='ACTION' value='Block'>";
             echo " this subnet: <input type='text' name='subnet'>";
index d481649..1bafa1c 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : classes.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.1 $
+**      VERSION NUMBER : $Revision: 1.2 $
 **
 **  DESCRIPTION      :  Parameter classes Administration page.
 **                      Input parameters: action (POST) : empty, 'Create'
 
 /*****************************
    $Log: classes.php,v $
-   Revision 1.1  2005-06-04 07:22:40  arjen
+   Revision 1.2  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.1  2005/06/04 07:22:40  arjen
    New page: Parameter classes administration.
 
 
 ******************************/
 
-// RCSID = "$Id: classes.php,v 1.1 2005-06-04 07:22:40 arjen Exp $";
+// RCSID = "$Id: classes.php,v 1.2 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -46,7 +51,7 @@ function clientscripts()
 
 ?>
 
-<script language='JavaScript'>
+<script type='text/ecmascript'>
 
 function CheckCreate(f)
 {
@@ -105,7 +110,8 @@ class class_page extends page
 
    if (isset($_GET['classname']) && isset($_GET['propname']))
    {
-      echo "<h1>Detailed information for property " . $_GET['propname']
+      echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Detailed information<\/h1>'</script><br>";
+      echo "<h1>for property " . $_GET['propname']
            . " of class " . $_GET['classname'] . "</h1><br>\n";
 
       if (isset($_POST['action']) && $_POST['action'] == 'Save Changes')
@@ -140,7 +146,7 @@ class class_page extends page
                                     . "' AND property_name='" . $_GET['propname'] . "'");
       $cls = pg_fetch_object($res, 0);
 
-      echo "<form action='classes.php?classname=" . $cls->name . "&propname=" . $cls->property_name . "' method='POST'>";
+      echo "<form action='classes.php?classname=" . $cls->name . "&amp;propname=" . $cls->property_name . "' method='POST'>";
       echo "<table>";
 
       echo "<tr><td>Description</td><td><input name='description' type='text' value='";
@@ -179,19 +185,19 @@ class class_page extends page
    }
    else
    {
-   echo "<h1>Parameter Classes Administration</h1><hr>";
+   echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Parameter Classes Administration<\/h1>'</script><br>";
 
    $res = pg_exec($this->database, "SELECT name, property_name, description FROM parameter_class
                                     ORDER BY name, property_name");
 
    echo "<table>";
-   echo "<tr><th>Class</th><th>Property</th><th>Description</th><tr>";
+   echo "<tr><th>Class</th><th>Property</th><th>Description</th></tr>";
    $cls = 0;
    while ($cls < pg_numrows($res))
    {
       $u = pg_fetch_object($res, $cls);
       ?>
-      <tr><td align='center'><a href='classes.php?classname=<?php echo $u->name?>&propname=<?php echo $u->property_name ?>'><img src='change.png'></a><br>
+      <tr><td align='center'><a href='classes.php?classname=<?php echo $u->name?>&amp;propname=<?php echo $u->property_name ?>'><img src='change.png'></a><br>
              <b><?php echo $u->name ?></b>
       </td><td>
          <?php echo $u->property_name ?>
@@ -212,7 +218,6 @@ class class_page extends page
 ?>
 
 <h2>Create new parameter class property:</h2>
-<p>
 
 <form action='classes.php' method='post' onSubmit='return CheckCreate(this)'>
 Class name: <input name='classname' type='text'>
@@ -220,7 +225,6 @@ Property name: <input name='propname' type='text'>
 <br>
 <input type='submit' name='action' value='Create'>
 </form>
-</p>
 
 <?php
    }
index 5660da0..af253a5 100644 (file)
@@ -121,3 +121,56 @@ img
 {
    border-style : none ;
 }
+
+#header {
+  position      : fixed;
+  width         : 100%;
+  height        : 60px;
+  top           : 13px;
+  right         : 0px;
+  bottom        : auto;
+  left          : 3px;
+  border-bottom : 1px solid #cccccc;
+}
+
+#menu_title {
+  position      : fixed;
+  width         : auto;
+  height        : 80px;
+  top           : 0px;
+  right         : auto;
+  bottom        : auto;
+  left          : 380px;
+  border-bottom : 0px solid #cccccc;
+}
+
+#content {
+  position      : fixed;
+  top           : 73px;
+  bottom        : 20px;
+  margin        : 0px 0px 0px 5px;
+  width         : auto;
+  height        : auto;
+  padding-left  : 5px;
+  padding-right : 12px;
+  color         : #000000;
+  border-left   : 0px solid #cccccc;
+  overflow      : auto;
+}
+
+#footer {
+  position    : fixed;
+  width       : 100%;
+  height      : 20px;
+  top         : auto;
+  right       : 0;
+  bottom      : 0;
+  margin-left : 10px;
+  border-top  : 1px solid #cccccc;
+  text-align  : center;
+}
+
+#log_date {
+  font-family : sans-serif;
+  font-size   : 20px;
+}
diff --git a/src/web/index.php b/src/web/index.php
new file mode 100644 (file)
index 0000000..f68410e
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+
+/**************************************************************************
+**  (c) Copyright 2003, Andromeda Technology & Automation
+** This is free software; you can redistribute it and/or modify it under the
+** terms of the GNU General Public License, see the file COPYING.
+***************************************************************************
+** MODULE INFORMATION *
+***********************
+**      FILE NAME      : login.php
+**      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
+**      VERSION NUMBER : $Revision: 1.1 $
+**
+**  DESCRIPTION      : The entry page for the Gnucomo web interface
+**
+**  EXPORTED OBJECTS : 
+**  LOCAL    OBJECTS : 
+**  MODULES  USED    :
+***************************************************************************
+**  ADMINISTRATIVE INFORMATION *
+********************************
+**      ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
+**      CREATION DATE   : Dec 03, 2002
+**      LAST UPDATE     : Feb 08, 2003
+**      MODIFICATIONS   : 
+**************************************************************************/
+
+/*****************************
+   $Log: index.php,v $
+   Revision 1.1  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.3  2003/02/13 09:01:29  arjen
+   All web interface pages use the page class.
+
+******************************/
+
+// RCSID = "$Id: index.php,v 1.1 2007-11-21 14:38:06 arjen Exp $";
+
+ini_set('include_path', '.:./classes:../phpclasses');
+require_once('page.class.php');
+//session_start();
+
+$login_page = new page("Gnucomo Login");
+
+$login_page->Showpage();
+
+?>
index 0f4bb43..82ef93c 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : issues.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.1 $
+**      VERSION NUMBER : $Revision: 1.2 $
 **
 **  DESCRIPTION      :  Issue types Administration page.
 **                      Input parameters: action (POST) : empty, 'Create'
 
 /*****************************
    $Log: issues.php,v $
-   Revision 1.1  2007-02-01 12:31:23  arjen
+   Revision 1.2  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.1  2007/02/01 12:31:23  arjen
    Added web interface for editing issues
 
 
 ******************************/
 
-// RCSID = "$Id: issues.php,v 1.1 2007-02-01 12:31:23 arjen Exp $";
+// RCSID = "$Id: issues.php,v 1.2 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -46,7 +51,7 @@ function clientscripts()
 
 ?>
 
-<script language='JavaScript'>
+<script type='text/ecmascript'>
 
 function CheckCreate(f)
 {
@@ -101,19 +106,19 @@ class issue_page extends page
                                 . $_POST['issueid'] . "'");
    }
 
-   echo "<h1>Issue Types Administration</h1><hr>";
+   echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Issue Types Administration<\/h1>'</script><br>";
 
    $res = pg_exec($this->database, "SELECT type_of_issueid, name, suggested_priority, description
                                     FROM type_of_issue ORDER BY name");
 
    echo "<table>";
-   echo "<tr><th>Issue</th><th>Priority</th><th>Description</th><tr>";
+   echo "<tr><th>Issue</th><th>Priority</th><th>Description</th></tr>";
    $cls = 0;
    while ($cls < pg_numrows($res))
    {
       $u = pg_fetch_object($res, $cls);
       ?>
-      <tr><td align='center'><img src='bell.png'><br>
+      <tr><td align='center'><img src='bell.png' alt='bell'><br>
              <b><?php echo $u->name ?></b>
       </td><td>
          <?php echo $u->suggested_priority ?>
@@ -134,7 +139,6 @@ class issue_page extends page
 ?>
 
 <h2>Create new issue type:</h2>
-<p>
 
 <form action='issues.php' method='post' onSubmit='return CheckCreate(this)'>
 Issue name: <input name='issuename' type='text'>
@@ -149,7 +153,6 @@ Description: <input name='issuedescr' type='text'>
 <br>
 <input type='submit' name='action' value='Create'>
 </form>
-</p>
 
 <?php
    }
index 89691d1..346c58d 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : log.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.7 $
+**      VERSION NUMBER : $Revision: 1.8 $
 **
 **  DESCRIPTION      : Logs page
 **
 
 /*****************************
    $Log: log.php,v $
-   Revision 1.7  2007-10-27 08:38:18  arjen
+   Revision 1.8  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.7  2007/10/27 08:38:18  arjen
    Removed link to advanced log analysis
 
    Revision 1.6  2005/06/04 07:18:26  arjen
@@ -51,7 +56,7 @@
 
 ******************************/
 
-// RCSID = "$Id: log.php,v 1.7 2007-10-27 08:38:18 arjen Exp $";
+// RCSID = "$Id: log.php,v 1.8 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -65,47 +70,54 @@ class log_page extends page
    {
       if (!empty($_GET['oid']))
       {
+         $oid = $_GET['oid'];
          $res = pg_exec($this->database, "SELECT objectname FROM object
-                               WHERE objectid=CAST('" . $_GET['oid']. "' AS BIGINT)");
+                               WHERE objectid=CAST('$oid' AS BIGINT)");
          $obj = pg_fetch_object($res, 0);
-         echo "<h1>Log for " . $obj->objectname . "</h1><hr>";
+         echo "<script type='text/ecmascript'>
+               document.getElementById('menu_title').innerHTML = \"<h1>Log for "
+                . $obj->objectname . "<\/h1>\"
+               </script>";
 
          //  Determine which day to display.
          //  This is either from a previous button though a _POST[] variable
          //  or the last day in the log table by default.
 
-         if (empty($_POST['logday']))
+         if (empty($_GET['logday']))
          {
             $res = pg_exec($this->database, "SELECT date_trunc('day',object_timestamp) FROM log
-                                  WHERE objectid='". $_GET['oid'] ."'
+                                  WHERE objectid='$oid'
                                   ORDER BY object_timestamp DESC LIMIT 1");
 
-            $last_time = pg_fetch_object($res, 0);
-            $logday = strtotime($last_time->date_trunc);
+            if( pg_num_rows($res) > 0 )
+            {
+               $last_time = pg_fetch_object($res, 0);
+               $logday = strtotime($last_time->date_trunc);
+            }
+            else
+            {
+               $logday = "";
+            }
          }
          else
          {
-            $logday = $_POST['logday'];
+            $logday = $_GET['logday'];
          }
 
          //  Make buttons to request the previous and the next day of logs.
 
-         echo "<form method='POST'>";
-         echo "<input type='submit' value='<<'>";
-         echo "<input type='hidden' name='logday' value='" . ($logday - 24 * 60 * 60) . "'>";
-         echo "</form>";
-
-         echo "<h3>" . date('F d, Y', $logday) ."</h3>";
-
-         echo "<form method='POST'>";
-         echo "<input type='submit' value='>>'>";
-         echo "<input type='hidden' name='logday' value='" . ($logday + 24 * 60 * 60) . "'>";
-         echo "</form>";
+         echo "<div id=\"log_date\">";
+         $logday1 = $logday - 24 * 60 * 60;
+         echo "<a href=\"log.php?oid=$oid&amp;logday=$logday1\" title=\"previous day\">&lt;&lt;</a>";
+         echo "&nbsp;" . date('F d, Y', $logday) . "&nbsp;";
+         $logday2 = $logday + 24 * 60 * 60;
+         echo "<a href=\"log.php?oid=$oid&amp;logday=$logday2\" title=\"next day\">&gt;&gt;</a>";
+         echo "</div>";
 
          // Show the log for one day only.
 
          $res = pg_exec($this->database, "SELECT logid, object_timestamp, servicecode, rawdata FROM log "
-                        ."WHERE objectid = CAST('" . $_GET['oid'] . "' AS BIGINT)
+                        ."WHERE objectid = CAST('$oid' AS BIGINT)
                          AND date_trunc('day', object_timestamp)='" . date('Y-m-d', $logday) . "'
                          ORDER BY object_timestamp, logid");
 
index ffbc65a..efba025 100755 (executable)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : login.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.3 $
+**      VERSION NUMBER : $Revision: 1.4 $
 **
 **  DESCRIPTION      : The entry page for the Gnucomo web interface
 **
 
 /*****************************
    $Log: login.php,v $
-   Revision 1.3  2003-02-13 09:01:29  arjen
+   Revision 1.4  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.3  2003/02/13 09:01:29  arjen
    All web interface pages use the page class.
 
 ******************************/
 
-// RCSID = "$Id: login.php,v 1.3 2003-02-13 09:01:29 arjen Exp $";
+// RCSID = "$Id: login.php,v 1.4 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 require_once('page.class.php');
+//session_start();
 
 $login_page = new page("Gnucomo Login");
 
index 45b0bcf..51ed43d 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : logout.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.2 $
+**      VERSION NUMBER : $Revision: 1.3 $
 **
 **  DESCRIPTION      : Gnucomo logout script.
 **                     Simply clears the username in the session and
 
 /*****************************
    $Log: logout.php,v $
-   Revision 1.2  2003-02-13 09:00:45  arjen
+   Revision 1.3  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.2  2003/02/13 09:00:45  arjen
    Added comment header
 
 ******************************/
 
-// RCSID = "$Id: logout.php,v 1.2 2003-02-13 09:00:45 arjen Exp $";
+// RCSID = "$Id: logout.php,v 1.3 2007-11-21 14:38:06 arjen Exp $";
 
 session_start();
 $_SESSION['username'] = '';
 
-include('login.php');
+//include('login.php');
+header( "Location: login.php" );
index d779819..09edc5c 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : notification.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.4 $
+**      VERSION NUMBER : $Revision: 1.5 $
 **
 **  DESCRIPTION      : Display and handle notifications.
 **                     There are two major views to this page: either a list of
 
 /*****************************
    $Log: notification.php,v $
-   Revision 1.4  2007-01-11 13:44:29  arjen
+   Revision 1.5  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.4  2007/01/11 13:44:29  arjen
    Manually edit parameters.
    View logs from abusing IP addresses.
 
@@ -52,7 +57,7 @@
 
 ******************************/
 
-// RCSID = "$Id: notification.php,v 1.4 2007-01-11 13:44:29 arjen Exp $";
+// RCSID = "$Id: notification.php,v 1.5 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -62,7 +67,7 @@ function clientscripts()
 {
 ?>
 
-<script language='JavaScript'>
+<script type='text/ecmascript'>
 
 function CheckRemark(f)
 {
@@ -129,6 +134,7 @@ class notification_page extends page
                                        . " ORDER BY notificationid");
 
       echo "<table>";
+      echo '<tr><th>Time</th><th>Number</th><th>Issue</th><th>Status</th><th>Priority</th></tr>';
       $row = 0;
       while ($row < pg_numrows($res))
       {
@@ -165,6 +171,7 @@ class notification_page extends page
       $res = pg_exec($this->database, "SELECT objectname FROM object WHERE objectid= CAST ('" . $note->objectid . "' AS BIGINT)");
       $obj = pg_fetch_object($res, 0);
       echo "<h1>Notification " . $note->notificationid . " for " . $obj->objectname . "</h1><hr>";
+      echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Notification " . $note->notificationid . " for " . $obj->objectname . "<\/h1>'</script><br>";
 
       $r = pg_exec($this->database, "SELECT description FROM type_of_issue WHERE type_of_issueid = CAST ('"
                        . $note->type_of_issueid . "' AS BIGINT)");
@@ -292,8 +299,8 @@ class notification_page extends page
       );
 
       echo "<h2>Enter a remark for the next action</h2>";
-      echo "<form method='post' onSubmit='return CheckRemark(this)'>";
-      echo "<textarea name='remark'></textarea><br>";
+      echo "<form method='post' onSubmit='return CheckRemark(this)' action=''>";
+      echo "<textarea name='remark' cols='30' rows='5'></textarea><br>";
 
       /*  Display a list of possible actions */
 
@@ -309,7 +316,7 @@ class notification_page extends page
          if ($first)
          {
             $first = false;
-            echo " checked='on'";
+            echo " CHECKED";
          }
          echo " value='$act'>" . $action->description . "<br>";
       }
@@ -328,7 +335,7 @@ class notification_page extends page
 
          $res = pg_exec($this->database, "SELECT objectname FROM object WHERE objectid=" . $_GET['oid']);
          $obj = pg_fetch_object($res, 0);
-         echo "<h1>Notifications for " . $obj->objectname . "</h1><hr>";
+        echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Notifications for " . $obj->objectname . "<\/h1>'</script><br>";
 
          $res = pg_exec($this->database, "SELECT notificationid, timestamp, type_of_issueid,
                                               statuscode, priority
@@ -337,6 +344,7 @@ class notification_page extends page
                                           . " ORDER BY notificationid");
 
          echo "<table>";
+         echo '<tr><th>Time</th><th>Number</th><th>Issue</th><th>Status</th><th>Priority</th></tr>';
          $row = 0;
          while ($row < pg_numrows($res))
          {
index 6a9c434..b2a4bfc 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : objects.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.10 $
+**      VERSION NUMBER : $Revision: 1.11 $
 **
 **  DESCRIPTION      : Objects Administration page.
 **                     Input parameters: action (POST) : empty, 'Create'
 
 /*****************************
    $Log: objects.php,v $
-   Revision 1.10  2005-06-04 07:24:38  arjen
+   Revision 1.11  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.10  2005/06/04 07:24:38  arjen
    New page: Abuse list
 
    Revision 1.9  2003/09/01 06:55:00  arjen
@@ -62,7 +67,7 @@
 
 ******************************/
 
-// RCSID = "$Id: objects.php,v 1.10 2005-06-04 07:24:38 arjen Exp $";
+// RCSID = "$Id: objects.php,v 1.11 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -72,7 +77,7 @@ function clientscripts()
 {
 ?>
 
-<script language='JavaScript'>
+<script type='text/ecmascript'>
 
 function CheckCreate(f)
 {
@@ -157,7 +162,7 @@ class object_page extends page
 
    if (isset($_GET['oid']))
    {
-      echo "<h1>Detailed information for object " . $_GET['oid'] . "</h1><hr>";
+      echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = \"<h1>Detailed information for object " . $_GET['oid'] . "<\/h1>\"</script><br>\n";
 
       if (isset($_POST['action']) && $_POST['action'] == 'Save Changes')
       {
@@ -260,13 +265,13 @@ class object_page extends page
       echo $obj->objectname . "'></td></tr>";
       echo "<tr><td>Identification code</td><td><input name='ocode' type='text' value='";
       echo $obj->objectcode . "'></td></tr>";
-      echo "<tr><td>Description</td><td><textarea name='odescription'>";
+      echo "<tr><td>Description</td><td><textarea name='odescription' rows='3' cols='30'>";
       echo $obj->object_description . "</textarea></td></tr>";
-      echo "<tr><td>Owner</td><td><textarea name='oowner'>";
+      echo "<tr><td>Owner</td><td><textarea name='oowner' rows='3' cols='30'>";
       echo $obj->object_owner . "</textarea></td></tr>";
-      echo "<tr><td>Physical location</td><td><textarea name='olocation'>";
+      echo "<tr><td>Physical location</td><td><textarea name='olocation' rows='3' cols='30'>";
       echo $obj->physical_location . "</textarea></td></tr>";
-      echo "<tr><td>Remarks</td><td><textarea name='oremark'>";
+      echo "<tr><td>Remarks</td><td><textarea name='oremark' rows='3' cols='30'>";
       echo $obj->remark . "</textarea></td></tr>";
       echo "<tr><td>Timezone</td><td><input name='otimezone' type='text' value='";
       echo $obj->timezone . "'></td></tr>";
@@ -287,7 +292,8 @@ class object_page extends page
          $srv_obj_res = pg_exec($this->database, "SELECT * FROM object_service WHERE objectid='"
                                    . $obj->objectid . "' AND servicecode='" . $srv->servicecode . "'");
 
-         echo "<tr><form action='objects.php?oid=" . $obj->objectid . "' method='POST'>";
+         echo "<tr>";
+         echo "<form action='objects.php?oid=" . $obj->objectid . "' method='POST'>";
          echo "<input type='hidden' name='servcode' value='" . $srv->servicecode . "'>";
 
          if (pg_numrows($srv_obj_res) == 0)
@@ -321,7 +327,8 @@ class object_page extends page
          $usr_obj_res = pg_exec($this->database, "SELECT * FROM object_user WHERE objectid='"
                                    . $obj->objectid . "' AND username='" . $usr->username . "'");
 
-         echo "<tr><form action='objects.php?oid=" . $obj->objectid . "' method='POST'>";
+         echo "<tr>";
+         echo "<form action='objects.php?oid=" . $obj->objectid . "' method='POST'>";
          echo "<input type='hidden' name='username' value='" . $usr->username . "'>";
 
          if (pg_numrows($usr_obj_res) == 0)
@@ -343,7 +350,11 @@ class object_page extends page
    }
    else
    {
-      echo "<h1>Objects Administration</h1><hr>";
+      echo "<script type='text/ecmascript'>
+            document.getElementById('menu_title').innerHTML = \"<h1>Objects Administration<\/h1>\"
+            </script>
+            <br>";
+
 
       $res = pg_exec($this->database, "SELECT * FROM object ORDER BY objectname");
 ?>
@@ -375,18 +386,34 @@ class object_page extends page
          $count_notifications += $this->nr_notifications;
          $closed_notifications += $this->closed_notifications;
          ?>
-         <tr><td><center><a href='objects.php?oid=<?php echo $u->objectid?>'><img src='server.png'></a><br>
+         <tr><td><center><a href='objects.php?oid=<?php echo $u->objectid?>'><img src='server.png' alt='server'></a><br>
                 <b><?php echo $u->objectname ?></b></center>
          </td><td>
                <?php echo nl2br($u->object_description) ?>
          </td><td class='number'>
-             <?php echo "<a href='log.php?oid=$u->objectid'> $this->nr_logs </a>" ?>
+             <?php if ( $this->nr_logs > 0 )
+                   { 
+                       echo "<a href='log.php?oid=$u->objectid'> $this->nr_logs </a>";
+                   }
+                   else
+                   { 
+                      echo "0";
+                   }
+              ?>
          </td><td class='number'>
              <?php echo "<a href='parameter.php?oid=$u->objectid'>" . $this->nr_parameters
                       . " (" . $this->removed_parameters . " removed)</a>" ?>
          </td><td class='number'>
-             <?php echo "<a href='notification.php?oid=$u->objectid'>" . $this->nr_notifications
-                      . " (" . $this->closed_notifications . " closed)</a>" ?>
+             <?php if( $this->nr_notifications == $this->closed_notifications )
+                   {
+                      echo $this->nr_notifications . " (" . $this->closed_notifications . " closed)"; 
+                  }
+                   else
+                   {
+                      echo "<a href='notification.php?oid=$u->objectid'>" . $this->nr_notifications
+                      . " (" . $this->closed_notifications . " closed)</a>"; 
+                   }
+              ?>
          </td><td class='number'>
              <?php echo "<a href='abuse.php?oid=$u->objectid'>" . "Abuse list"
                       . " </a>" ?>
@@ -413,14 +440,12 @@ class object_page extends page
 ?>
 
 <h2>Create new object:</h2>
-<p>
 
 <form action='objects.php' method='post' onSubmit='return CheckCreate(this)'>
 Object's name (FQDN): <input name='objectname' type='text'>
 <br>
 <input type='submit' name='action' value='Create'>
 </form>
-</p>
 
 <?php
 
index 2a6812a..70b134b 100644 (file)
@@ -8,7 +8,7 @@
 ***********************
 **      FILE NAME      : page.class.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.9 $
+**      VERSION NUMBER : $Revision: 1.10 $
 **
 **  DESCRIPTION      : Base class for Gnucomo web interface pages.
 **
 
 /*****************************
    $Log: page.class.php,v $
-   Revision 1.9  2007-10-23 14:47:42  arjen
+   Revision 1.10  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.9  2007/10/23 14:47:42  arjen
    Prepared for release 0.0.10
 
    Revision 1.8  2007/01/11 13:44:29  arjen
@@ -57,7 +62,7 @@
 
 ******************************/
 
-// RCSID = "$Id: page.class.php,v 1.9 2007-10-23 14:47:42 arjen Exp $";
+// RCSID = "$Id: page.class.php,v 1.10 2007-11-21 14:38:06 arjen Exp $";
 
 
 require_once('gnucomo_config.php');
@@ -79,14 +84,12 @@ function login_form()
    <div class='login'>
    <h1 align="center">GNU Computer Monitoring</h1>
    <h4 align="center"><i>Version 0.0.10, October 19, 2007</i></h4>
-   <p>
-      <h2 class='error'><?php echo $last_error?></h2>
-   </p>
+   <h2 class='error'><?php echo $last_error?></h2>
    <center><table class='form'>
    <tr>
    <td width='50%' class='form'>
-      <a href='http://gnucomo.org/' target='_top'><img src='logo.png' alt='GnoCoMo logo'></a></td>
-   <td class='form'><form name="login" method="POST">
+      <a href='http://gnucomo.org/' target='_top'><img src='logo.png' alt='GnuCoMo logo'></a></td>
+   <td class='form'><form name="login" method="POST" action="index.php">
        <table class='form'>
        <tr>
        <td class='form'>Username</td>
@@ -142,12 +145,29 @@ class page
       <title><?php echo $this->the_title ?></title>
       </head>
       <body>
+        <div id="header">
+           <a href='index.php'><img src='small-logo.png' title='Gnucomo' alt='Gnucomo'></a>
+           <a href='objects.php'><img src='server.png' title='Objects' alt='Objects'></a>
+           <a href='users.php'><img src='user.png' title='Users' alt='Users'></a>
+           <a href='services.php'><img src='service.png' title='Services' alt='Services'></a>
+           <a href='issues.php'><img src='bell.png' title='Issues' alt='Issues'></a>
+           <a href='classes.php'><img src='change.png' title='Classes' alt='Classes'></a>
+           <!-- a href='notification2.php'>N2</a -->
+           <a href='logout.php'><img src='exit.png' title='Logout' alt='Logout'></a>
+        </div>
+
+        <div id="menu_title">&nbsp;</div>
+
+        <div id="content">
 <?php
    }
 
    function Body()
    {
-      echo "The default body.";
+      //echo "The default body.";
+      echo "<div id='content'>
+                 <img src='logo.png' alt='GnuCoMo'>
+            </div>";
    }
 
    function Tail()
@@ -156,6 +176,10 @@ class page
       {
          pg_close($this->database);
       }
+      echo "<br></div>
+            <div id='footer'>
+            &copy; <a href='http://www.gnucomo.org'>GnuCoMo</a>
+            </div>";
       echo "</body>";
       echo "</html>";
    }
index 393457b..81c13dc 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : parameter.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.8 $
+**      VERSION NUMBER : $Revision: 1.9 $
 **
 **  DESCRIPTION      : Parameter administration for a specific object.
 **                     Input - GET[oid]    : Object id
 
 /*****************************
    $Log: parameter.php,v $
-   Revision 1.8  2007-01-11 13:44:29  arjen
+   Revision 1.9  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.8  2007/01/11 13:44:29  arjen
    Manually edit parameters.
    View logs from abusing IP addresses.
 
@@ -53,7 +58,7 @@
 
 ******************************/
 
-// RCSID = "$Id: parameter.php,v 1.8 2007-01-11 13:44:29 arjen Exp $";
+// RCSID = "$Id: parameter.php,v 1.9 2007-11-21 14:38:06 arjen Exp $";
 
 
 ini_set('include_path', '.:./classes:../phpclasses');
@@ -96,9 +101,11 @@ class param_page extends page
 
       $res = pg_exec($this->database, "SELECT objectname FROM object WHERE objectid=CAST('" . $ObjId ."' AS BIGINT)");
       $obj = pg_fetch_object($res, 0);
-      echo "<h1>Parameters for " . $obj->objectname . "</h1>";
+      echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Parameters for " . $obj->objectname . "<\/h1>'</script><br>";
 
-      echo "Action = " . $_POST['action'] . "<br>";
+      if( isset($_POST['action']) ) {
+        echo "Action = " . $_POST['action'] . "<br>";
+      }
       //  See if we have an update for the database
       if (isset($_POST['action']) && $_POST['action'] == 'Create Parameter')
       {
@@ -207,7 +214,7 @@ class param_page extends page
             <tr><td align='center'>
                <?php echo $par->class?>
             </td><td>
-               <?php echo "<a href=parameter.php?paramid=" . $par->paramid . ">" . $par->name . "</a>"?>
+               <?php echo "<a href=\"parameter.php?paramid=" . $par->paramid . "\">" . $par->name . "</a>"?>
             </td><td>
                <?php echo $par->description?>
             </td><td>
@@ -232,7 +239,6 @@ class param_page extends page
       echo round($duration / $row * 1000, 3) . " milliseconds per parameter).<br>";
       ?>
         <h2>Create new parameter:</h2>
-        <p>
         <form action='parameter.php?oid=<?php echo $ObjId ?>' method='post'>
           Class : <input type='text' name='paramclass'>
           Name : <input type='text' name='paramname'>
@@ -240,7 +246,6 @@ class param_page extends page
         <br>
         <input type='submit' name='action' value='Create Parameter'>
         </form>
-        </p>
       <?php 
    }
    if (!empty($_GET['paramid']))
index db8d4c8..0755d80 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : parameter_compare.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.6 $
+**      VERSION NUMBER : $Revision: 1.7 $
 **
 **  DESCRIPTION      : 
 **
 
 /*****************************
    $Log: parameter_compare.php,v $
-   Revision 1.6  2003-12-03 08:03:28  arjen
+   Revision 1.7  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.6  2003/12/03 08:03:28  arjen
    Optionally show or hide removed parameters from the parameter
    comparison page.
 
@@ -46,7 +51,7 @@
 
 ******************************/
 
-// RCSID = "$Id: parameter_compare.php,v 1.6 2003-12-03 08:03:28 arjen Exp $";
+// RCSID = "$Id: parameter_compare.php,v 1.7 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -156,7 +161,7 @@ class param_diff extends page
       echo "<tr><th>Name</th><th>Properties</th><th>Name</th><th>Propterties</th></tr>\n";
 
       $hide_removed = true;
-      $hide_removed = $_POST['show_removed'] != 'on';
+      $hide_removed = empty($_POST['show_removed']) || $_POST['show_removed'] != 'on';
 
       $row = 0;
       while ($row < pg_numrows($res))
@@ -214,7 +219,6 @@ class param_diff extends page
                display_parameter($nextpar->name, $prnext, $Style, $this->is_removed($nextpar->paramid));
                display_parameter($par->name, $pr, $Style, $this->is_removed($par->paramid));
             }
          }
          else
          {
index c48b494..23dc9f9 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : services.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.3 $
+**      VERSION NUMBER : $Revision: 1.4 $
 **
 **  DESCRIPTION      :  Service Administration page.
 **                      Input parameters: action (POST) : empty, 'Create'
 
 /*****************************
    $Log: services.php,v $
-   Revision 1.3  2007-10-19 07:16:44  arjen
+   Revision 1.4  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.3  2007/10/19 07:16:44  arjen
    Improved interface for editing check patterns.
 
    Revision 1.2  2005/06/04 07:25:59  arjen
@@ -40,7 +45,7 @@
 
 ******************************/
 
-// RCSID = "$Id: services.php,v 1.3 2007-10-19 07:16:44 arjen Exp $";
+// RCSID = "$Id: services.php,v 1.4 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -51,7 +56,7 @@ function clientscripts()
 
 ?>
 
-<script language='JavaScript'>
+<script type='text/ecmascript'>
 
 function CheckCreate(f)
 {
@@ -101,7 +106,9 @@ class service_page extends page
 
    if (isset($_GET['servcode']))
    {
-      echo "<h1>Detailed information for service " . $_GET['servcode'] . "</h1><br>\n";
+      echo "<script type='text/ecmascript'>
+              document.getElementById('menu_title').innerHTML = 
+               '<h1>Detailed Information for service " . $_GET['servcode'] . "<\/h1>'</script><br>";
 
       if (isset($_POST['action']) && $_POST['action'] == 'Save Changes')
       {
@@ -155,7 +162,7 @@ class service_page extends page
          echo "<option value='$prior'";
          if ($prior == $srv->default_priority)
          {
-            echo " selected='true'";
+            echo " SELECTED";
          }
          echo ">$prior</option>\n";
       }
@@ -166,7 +173,7 @@ class service_page extends page
          echo "<option value='$prior'";
          if ($prior == $srv->max_priority)
          {
-            echo " selected='true'";
+            echo " SELECTED";
          }
          echo ">$prior</option>\n";
       }
@@ -236,18 +243,18 @@ class service_page extends page
    }
    else
    {
-   echo "<h1>Service Administration</h1><hr>";
+   echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>Service  Administration<\/h1>'</script><br>";
 
    $res = pg_exec($this->database, "SELECT * FROM service ORDER BY servicecode");
 
    echo "<table>";
-   echo "<tr><th>Service code</th><th>Name</th><th>Priority</th><th>Max priority</th><tr>";
+   echo "<tr><th>Service code</th><th>Name</th><th>Priority</th><th>Max priority</th></tr>";
    $srv = 0;
    while ($srv < pg_numrows($res))
    {
       $u = pg_fetch_object($res, $srv);
       ?>
-      <tr><td align='center'><a href='services.php?servcode=<?php echo $u->servicecode?>'><img src='service.png'></a><br>
+      <tr><td align='center'><a href='services.php?servcode=<?php echo $u->servicecode?>'><img src='service.png' alt='service'></a><br>
              <b><?php echo $u->servicecode ?></b>
       </td><td>
          <?php echo $u->servicename ?>
@@ -269,7 +276,6 @@ class service_page extends page
 ?>
 
 <h2>Create new service:</h2>
-<p>
 
 <form action='services.php' method='post' onSubmit='return CheckCreate(this)'>
 Service code: <input name='servcode' type='text'>
@@ -286,12 +292,11 @@ Maximum priority: <select name='maxprior'>
 <option value='2'>2</option>
 <option value='3'>3</option>
 <option value='4'>4</option>
-<option value='5' selected='true'>5</option>
+<option value='5' SELECTED>5</option>
 </select>
 <br>
 <input type='submit' name='action' value='Create'>
 </form>
-</p>
 
 <?php
    }
index ef2ab22..5041ef7 100644 (file)
@@ -9,7 +9,7 @@
 ***********************
 **      FILE NAME      : users.php
 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
-**      VERSION NUMBER : $Revision: 1.4 $
+**      VERSION NUMBER : $Revision: 1.5 $
 **
 **  DESCRIPTION      :  User Administration page.
 **                      Input parameters: action (POST) : empty, 'Create'
 
 /*****************************
    $Log: users.php,v $
-   Revision 1.4  2004-01-10 20:03:02  arjen
+   Revision 1.5  2007-11-21 14:38:06  arjen
+   The buttonbar at the top of each page is now a fixed 'div' element
+   instead of a framed page.
+   Contributed by Edwin Nadorp.
+
+   Revision 1.4  2004/01/10 20:03:02  arjen
    *** empty log message ***
 
    Revision 1.3  2003/02/21 08:44:19  arjen
@@ -41,7 +46,7 @@
 
 ******************************/
 
-// RCSID = "$Id: users.php,v 1.4 2004-01-10 20:03:02 arjen Exp $";
+// RCSID = "$Id: users.php,v 1.5 2007-11-21 14:38:06 arjen Exp $";
 
 ini_set('include_path', '.:./classes:../phpclasses');
 
@@ -51,7 +56,7 @@ function clientscripts()
 {
 
 ?>
-<script language='JavaScript'>
+<script type='text/ecmascript'>
 function CheckCreate(f)
 {
    if (f.username.value == "")
@@ -136,8 +141,9 @@ class user_page extends page
 
    if (isset($_GET['username']))
    {
-      echo "<h1>Detailed information for user " . $_GET['username'] . "</h1><br>\n";
-
+      echo "<script type='text/ecmascript'>
+              document.getElementById('menu_title').innerHTML =
+              '<h1>Detailed information for user " . $_GET['username'] . "<\/h1>'</script><br>";
       if (isset($_POST['action']) && $_POST['action'] == 'Save Changes')
       {
          $qry = "UPDATE usr SET display_name='" . $_POST['dspname'] . "'";
@@ -165,7 +171,7 @@ class user_page extends page
          echo "<option value='$seclevel'";
          if ($seclevel == $usr->security_level)
          {
-            echo " selected='true'";
+            echo " SELECTED";
          }
          echo ">$seclevel</option>\n";
       }
@@ -176,7 +182,7 @@ class user_page extends page
    }
    else
    {
-   echo "<h1>User Administration</h1><hr>";
+   echo "<script type='text/ecmascript'>document.getElementById('menu_title').innerHTML = '<h1>User Administration<\/h1>'</script><br>";
    $res = pg_exec($this->database, "SELECT username, display_name, email, security_level
                                     FROM usr ORDER BY username");
 
@@ -186,7 +192,7 @@ class user_page extends page
    {
       $u = pg_fetch_object($res, $usr);
       ?>
-      <tr><td align='center'><a href='users.php?username=<?php echo $u->username ?>'><img src='user.png'></a><br>
+      <tr><td align='center'><a href='users.php?username=<?php echo $u->username ?>'><img src='user.png' alt='users'></a><br>
              <b><?php echo $u->username ?></b>
       </td><td>
          <?php echo $u->display_name ?>
@@ -214,7 +220,6 @@ class user_page extends page
 ?>
 
 <h2>Create new user:</h2>
-<p>
 
 <form action='users.php' method='post' onSubmit='return CheckCreate(this)'>
 User name: <input name='username' type='text'>
@@ -236,7 +241,6 @@ Verify password: <input type='password' name='pwverify'>
 <br>
 <input type='submit' name='action' value='Create'>
 </form>
-</p>
 
 <h2>Change your password:</h2>
 <form action='users.php' method='post' onSubmit='return CheckPW(this)'>