From: arjen Date: Wed, 21 Nov 2007 14:38:06 +0000 (+0000) Subject: The buttonbar at the top of each page is now a fixed 'div' element X-Git-Tag: V0_0_11~10 X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=31422ea85d1f6bdf9fddd2c0dead9241d238eeb4 The buttonbar at the top of each page is now a fixed 'div' element instead of a framed page. Contributed by Edwin Nadorp. --- diff --git a/src/web/abuse.php b/src/web/abuse.php index 03347bf..5da4b0d 100644 --- a/src/web/abuse.php +++ b/src/web/abuse.php @@ -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 ** @@ -27,7 +27,12 @@ /***************************** $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 "

Abuse List for " . $obj->objectname . "


"; + + echo ""; if (!empty($_POST['ACTION']) && ($_POST['ACTION'] == 'Abuse')) { @@ -176,14 +184,14 @@ class abuse_list extends page } else { - echo "
"; + echo ""; echo "Report "; echo " for IP address "; echo " or "; echo " with status "; echo "
"; - echo "
"; + echo ""; echo ""; echo " or "; echo " this subnet: "; diff --git a/src/web/classes.php b/src/web/classes.php index d481649..1bafa1c 100644 --- a/src/web/classes.php +++ b/src/web/classes.php @@ -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' @@ -29,13 +29,18 @@ /***************************** $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() ?> -
"; + echo "

for property " . $_GET['propname'] . " of class " . $_GET['classname'] . "


\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 ""; + echo ""; echo ""; echo "
Descriptiondocument.getElementById('menu_title').innerHTML = '

Parameter Classes Administration<\/h1>'
"; $res = pg_exec($this->database, "SELECT name, property_name, description FROM parameter_class ORDER BY name, property_name"); echo ""; - echo ""; + echo ""; $cls = 0; while ($cls < pg_numrows($res)) { $u = pg_fetch_object($res, $cls); ?> -
ClassPropertyDescription
ClassPropertyDescription

+

name ?>
property_name ?> @@ -212,7 +218,6 @@ class class_page extends page ?>

Create new parameter class property:

-

Class name: @@ -220,7 +225,6 @@ Property name:
-

Showpage(); + +?> diff --git a/src/web/issues.php b/src/web/issues.php index 0f4bb43..82ef93c 100644 --- a/src/web/issues.php +++ b/src/web/issues.php @@ -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' @@ -29,13 +29,18 @@ /***************************** $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() ?> -
"; $res = pg_exec($this->database, "SELECT type_of_issueid, name, suggested_priority, description FROM type_of_issue ORDER BY name"); echo ""; - echo ""; + echo ""; $cls = 0; while ($cls < pg_numrows($res)) { $u = pg_fetch_object($res, $cls); ?> -
IssuePriorityDescription
IssuePriorityDescription

+
bell
name ?>
suggested_priority ?> @@ -134,7 +139,6 @@ class issue_page extends page ?>

Create new issue type:

-

Issue name: @@ -149,7 +153,6 @@ Description:
-

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 "

Log for " . $obj->objectname . "


"; + echo ""; // 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 "
"; - echo ""; - echo ""; - echo "
"; - - echo "

" . date('F d, Y', $logday) ."

"; - - echo "
"; - echo ""; - echo ""; - echo "
"; + echo "
"; + $logday1 = $logday - 24 * 60 * 60; + echo "<<"; + echo " " . date('F d, Y', $logday) . " "; + $logday2 = $logday + 24 * 60 * 60; + echo ">>"; + echo "
"; // 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"); diff --git a/src/web/login.php b/src/web/login.php index ffbc65a..efba025 100755 --- a/src/web/login.php +++ b/src/web/login.php @@ -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 ** @@ -27,15 +27,21 @@ /***************************** $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"); diff --git a/src/web/logout.php b/src/web/logout.php index 45b0bcf..51ed43d 100644 --- a/src/web/logout.php +++ b/src/web/logout.php @@ -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 @@ -29,14 +29,20 @@ /***************************** $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" ); diff --git a/src/web/notification.php b/src/web/notification.php index d779819..09edc5c 100644 --- a/src/web/notification.php +++ b/src/web/notification.php @@ -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 @@ -36,7 +36,12 @@ /***************************** $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() { ?> -
"; $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 "

Enter a remark for the next action

"; - echo "
"; - echo "
"; + echo ""; + echo "
"; /* 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 . "
"; } @@ -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 "

Notifications for " . $obj->objectname . "


"; + echo "
"; $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 ""; + echo ''; $row = 0; while ($row < pg_numrows($res)) { diff --git a/src/web/objects.php b/src/web/objects.php index 6a9c434..b2a4bfc 100644 --- a/src/web/objects.php +++ b/src/web/objects.php @@ -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' @@ -29,7 +29,12 @@ /***************************** $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() { ?> -
\n"; if (isset($_POST['action']) && $_POST['action'] == 'Save Changes') { @@ -260,13 +265,13 @@ class object_page extends page echo $obj->objectname . "'>"; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; echo ""; @@ -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 ""; + echo ""; + echo ""; echo ""; 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 ""; + echo ""; + echo ""; echo ""; if (pg_numrows($usr_obj_res) == 0) @@ -343,7 +350,11 @@ class object_page extends page } else { - echo "

Objects Administration


"; + echo " +
"; + $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; ?> -
TimeNumberIssueStatusPriority
Identification code
Description
Owner
Physical location
Remarks
Timezone

+
server
objectname ?>
object_description) ?> - objectid'> $this->nr_logs " ?> + nr_logs > 0 ) + { + echo " $this->nr_logs "; + } + else + { + echo "0"; + } + ?> objectid'>" . $this->nr_parameters . " (" . $this->removed_parameters . " removed)" ?> - objectid'>" . $this->nr_notifications - . " (" . $this->closed_notifications . " closed)" ?> + nr_notifications == $this->closed_notifications ) + { + echo $this->nr_notifications . " (" . $this->closed_notifications . " closed)"; + } + else + { + echo "" . $this->nr_notifications + . " (" . $this->closed_notifications . " closed)"; + } + ?> objectid'>" . "Abuse list" . " " ?> @@ -413,14 +440,12 @@ class object_page extends page ?>

Create new object:

-

Object's name (FQDN):
-

GNU Computer Monitoring

Version 0.0.10, October 19, 2007

-

-

-

+

- +
- GnoCoMo logo
+ GnuCoMo logo
@@ -142,12 +145,29 @@ class page <?php echo $this->the_title ?> + + + + +
+ GnuCoMo +
"; } function Tail() @@ -156,6 +176,10 @@ class page { pg_close($this->database); } + echo "
+ "; echo ""; echo ""; } diff --git a/src/web/parameter.php b/src/web/parameter.php index 393457b..81c13dc 100644 --- a/src/web/parameter.php +++ b/src/web/parameter.php @@ -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 @@ -28,7 +28,12 @@ /***************************** $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 "

Parameters for " . $obj->objectname . "

"; + echo "
"; - echo "Action = " . $_POST['action'] . "
"; + if( isset($_POST['action']) ) { + echo "Action = " . $_POST['action'] . "
"; + } // 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 \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 { diff --git a/src/web/services.php b/src/web/services.php index c48b494..23dc9f9 100644 --- a/src/web/services.php +++ b/src/web/services.php @@ -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' @@ -29,7 +29,12 @@ /***************************** $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() ?> -
"; if (isset($_POST['action']) && $_POST['action'] == 'Save Changes') { @@ -155,7 +162,7 @@ class service_page extends page echo "\n"; } @@ -166,7 +173,7 @@ class service_page extends page echo "\n"; } @@ -236,18 +243,18 @@ class service_page extends page } else { - echo "

Service Administration


"; + echo "
"; $res = pg_exec($this->database, "SELECT * FROM service ORDER BY servicecode"); echo "
Username
class?> - paramid . ">" . $par->name . ""?> + paramid . "\">" . $par->name . ""?> description?> @@ -232,7 +239,6 @@ class param_page extends page echo round($duration / $row * 1000, 3) . " milliseconds per parameter).
"; ?>

Create new parameter:

-

Class : Name : @@ -240,7 +246,6 @@ class param_page extends page
-

NamePropertiesNamePropterties
"; - echo ""; + echo ""; $srv = 0; while ($srv < pg_numrows($res)) { $u = pg_fetch_object($res, $srv); ?> -
Service codeNamePriorityMax priority
Service codeNamePriorityMax priority

+
service
servicecode ?>
servicename ?> @@ -269,7 +276,6 @@ class service_page extends page ?>

Create new service:

-

Service code: @@ -286,12 +292,11 @@ Maximum priority:
-

-
"; 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 "\n"; } @@ -176,7 +182,7 @@ class user_page extends page } else { - echo "

User Administration


"; + echo "
"; $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); ?> -

+
users
username ?>
display_name ?> @@ -214,7 +220,6 @@ class user_page extends page ?>

Create new user:

-

User name: @@ -236,7 +241,6 @@ Verify password:
-

Change your password: