[Additional chknet code
tony@tonywhitmore.co.uk**20041018212239] {
addfile ./chknet/settings.php
hunk ./CHANGELOG 1
+Development - 18/10/2004
+========================
+* Added further functionality to chknet
+
hunk ./CHANGELOG 8
+* Added start of ChkNet code
hunk ./TODO 54
-* Change to "Get help with MODULE"
+* Change to "Get help with MODULE" - done with chknet
hunk ./TODO 56
+* Move module settings to inside the module - probably keep table though - DONE with chknet
+* Add default values to ChkNet settings table
hunk ./chknet/intro.php 44
- function produce_cell($name)
+ function produce_cell($array)
hunk ./chknet/intro.php 47
- echo "
fetchRow();
- $pingpath = $row['value'];
- $query = "SELECT value FROM settings WHERE function = 'pingoptions'";
- $result = $db->query($query);
- if (DB::isError($db)) {die($db->getMessage());}
- $row = $result->fetchRow();
- $pingoptions = $row['value'];
+ while ( $row = $result->fetchRow() )
+ {
+ $$row['function'] = $row['value'];
+ }
+
hunk ./chknet/intro.php 58
- $return = "alive";
- if ( $return == "alive" )
+ $output = shell_exec($pingpath . ' ' . $pingoptions . ' ' . $array['hostname']);
+ echo " | (" . $array['hostname'] . ")\n";
hunk ./chknet/intro.php 73
+
hunk ./chknet/intro.php 81
- echo "\n";
+ echo "\n";
hunk ./chknet/intro.php 90
- if ( $j = 0 )
+ if ( $j == 0 )
hunk ./chknet/intro.php 98
- produce_cell($row2['name']);
+ produce_cell($row2);
hunk ./chknet/intro.php 111
-
hunk ./chknet/intro.php 125
- that a device on a hostname or IP address has responded to an ICMP request.
+ that a device on a hostname or IP address has responded to an ICMP echo request.
hunk ./chknet/settings.php 1
-
+\n";
+
+$query = "SELECT * FROM chknet_settings";
+
+if ( isset($_POST['not_new']) )
+ {
+ // Pull all the current settings from the database
+ $result = $db->query($query);
+ if (DB::isError($db)) {die($db->getMessage());}
+ while ( $row = $result->fetchRow() )
+ { // for each row in the settings table
+ if ( $row['function'] != "chunksperday" )
+ { // Don't update the chunksperday setting, but all others
+ $query1 = "UPDATE chknet_settings SET value='" . $_POST[$row['function']] . "' WHERE function='" . $row['function'] . "'";
+ $result1 = $db->query($query1);
+ if (DB::isError($db)) {die($db->getMessage());}
+ }
+ }
+ // Closing comment and navbutton
+ echo "Settings updated!\n";
+ navbutton("intro.php","OK");
+ }
+else
+ {
+ // Start the form that holds the data.
+ echo "\n";
+ }
+
+?>
hunk ./includes/STORM/chknet/html/admin_nav.inc 54
+ echo "\n";
+ echo "Edit ChkNet Settings\n";
+ echo "\n";
+ echo "\n";
+
+// Start and end the spacer cell between navigation elements.
+ echo " | \n";
+
+// Start the cell for the navigation element.
+ echo "\n";
hunk ./includes/STORM/chknet/misc/functions.inc 196
- $query = "SELECT value FROM settings WHERE function='chknetrefresh'";
+ $query = "SELECT value FROM chknet_settings WHERE function='refresh'";
} | |