* @license http://www.bh3.org/license.php The BH3 License * @link http:// * * A new version with an INCLUDE to get the code, and not copied into each page, code only needs to be updated ONE place only and not on every page * This code is store in: Advanced settings, Expert, After openening the BODY tag * * Last updated: * 14 Sep 2017 - First version * */ $connect = false; include $_SERVER['DOCUMENT_ROOT'].'/bh3_org_globals.php'; if ($connect) { require $_SERVER['DOCUMENT_ROOT'].'/bh3_org_get_file_paths.php'; // Include the script it here rather han copying together with this script into the calling page include $_SERVER['DOCUMENT_ROOT'].$php_path.'test_valid_parameters_and_blocked_ip.php'; } else { echo "

Sorry, not connected to the database so no slide-show to display...

"; } ?>

Welcum WEB MASTER to the BH3 Back Passage - Update IP filter - The Safe Haven for Bergen Hash House Harriers

* @license http://www.bh3.org/license.php The BH3 License * @link http:// * * A new version with an INCLUDE to get the code, and not copied into each page, code only needs to be updated ONE place only and not on every page * * Last updated: * 14 Sep 2017 - First version * */ // A special version because this is code from the middle of a page where most variables are already set if (!isset($connect)) { $connect = false; include $_SERVER['DOCUMENT_ROOT'].'/bh3_org_globals.php'; } if ($connect) { if (!isset($php_path)) { require $_SERVER['DOCUMENT_ROOT'].'/bh3_org_get_file_paths.php'; } // Include the script it here rather han copying together with this script into the calling page include $_SERVER['DOCUMENT_ROOT'].$php_path.'slideshow_top.php'; } else { echo "

Sorry, not connected to the database so no slide-show to display...

"; } ?>
Go to content

Welcum WEB MASTER to the BH3 Back Passage - Update IP filter

Back Passage > Web Master
* @license http://www.bh3.org/license BH3 License * @link http:// * * Stand alone script: back-passage-menu.php => ALL MODIFICATIONS MUST BE MADE TO THIS SCRIPT THEN COPIED TO INCOMEDIA! * * Last updated: * 16 Oct 2017 - First version * 17 Oct 2017 - Special version to be used on the LIST-RUN-FEES and LIST-PARTICIPANTS pages * */ // A special version because this is code from the middle of a page where most variables are already set if (!isset($connect)) { $connect = false; include $_SERVER['DOCUMENT_ROOT'].'/bh3_org_globals.php'; } if ($connect) { if (!isset($php_path)) { require $_SERVER['DOCUMENT_ROOT'].'/bh3_org_get_file_paths.php'; } // Include the script it here rather han copying together with this script into the calling page include_once $_SERVER['DOCUMENT_ROOT'].$php_path.'func-back-passage-menu.php'; // A special version for a page displayed on WM, HC and MA areas // if (isset($_REQUEST['m'])) { // if ($_REQUEST['m'] == '1') { $menu = "wm"; // } elseif ($_REQUEST['m'] == '0') { // $menu = "hc"; // } else { // $menu = "ma"; // } // } else { // $menu = "ma"; // } list ($dummy) = func_back_passage_menu($menu); } else { echo "

Sorry, not connected to the database so no slide-show to display...

"; } ?>
* @license http://www.bh3.org/license.php The BH3 License * @link http:// * * Stand alone script: update-ip-filter.php => ALL MODIFICATIONS MUST BE MADE TO THIS SCRIPT THEN COPIED TO INCOMEDIA! * * Last updated: * 16 May 2018 - First version * 23 May 2018 - Added 'ON DUPLICATE KEY' to prevent the same IP address being stored many times * */ $connect = false; include $_SERVER['DOCUMENT_ROOT'].'/bh3_org_globals.php'; if ($connect) { $print_debug = "----START OF DEBUG LISTING
"; if (!$php_path) { require $_SERVER['DOCUMENT_ROOT'].'/bh3_org_get_file_paths.php'; require_once $_SERVER['DOCUMENT_ROOT'].$php_path.'func_store_error_message.php'; require_once $_SERVER['DOCUMENT_ROOT'].$php_path.'get_sys_data.php'; require_once $_SERVER['DOCUMENT_ROOT'].$php_path.'func_find_current_event.php'; require_once 'menu.php'; $on_the_web = false; $suggested_target = "blank"; $backpassage_menu = "1"; echo "

Function:
- This script adds IP addresses to the IP filter table

Please note:
- Nothing special

Script:
".$_SERVER['SCRIPT_NAME']."

"; } else { $on_the_web = true; $suggested_target = "self"; } include $_SERVER['DOCUMENT_ROOT'].$php_path.'get_database_name.php'; $next_script = $_SERVER['SCRIPT_NAME']; $fonts = "my_font"; $user_ip = $_SERVER['REMOTE_ADDR']; $last_update_changed = array(); // This
overrides a style set by Incomedia echo "
"; if (!isset($backpassage_menu)) { if ($menu == "wm") { $backpassage_menu = "1"; } else { $backpassage_menu = "0"; } } if (isset($_REQUEST['ac'])) { $action = $_REQUEST['ac']; if (!$action) { $action = "1st"; } else { } } else { $action = "1st"; } $print_debug .= "Parameters collected so far
- action type: ".$action."
"; $print_debug .= "Menu = ".$backpassage_menu."
"; if (isset($_REQUEST)) { foreach ($_REQUEST as $key => $key_value) { $print_debug .= $key.": ".$key_value.", "; } } $print_debug .= "
"; if ($action == "1st") { //--------------------------------------------------------------------- // 1st time: Display possible options //--------------------------------------------------------------------- // $web_master = false; // This is to allow the Web Master to access pages that are closed before everyone else (if variable set to TRUE in the system data table) if ($wm_kh_registration_access) { $mysql_query = "SELECT `status` FROM `".$database_name."`.`bh3_ip_filter` WHERE `ip_address` = '".$_SERVER['REMOTE_ADDR']."'"; $rs = mysql_query($mysql_query); if ($rs) { if (mysql_num_rows($rs) == 1) { $web_master = true; } } else { $error_message_01 = "SELECT error (bh3_ip_filter)"; $error_message_02 = $current_linked_script; $error_message_03 = str_replace("'", "''", $mysql_query); $error_message_04 = str_replace("'", "''", mysql_error()); list ($error_code, $debug_status_func_1) = store_error_message($debug, $value, $connect, true, $error_message_01, $error_message_02, $error_message_03, $error_message_04, $user_ip); $print_debug .= $debug_status_func_1."
"; } } $command = "
"; if ($_REQUEST['xy'] == "!") { $command .= "Wrong password - try again: "; } elseif ($_REQUEST['xy'] == "!!") { $command .= "Error retrieving password from password list - try again: "; } else { $command .= "You will need to supply a password to proceed: "; } $command .= "

"; } elseif ($action == "2nd") { //--------------------------------------------------------------------- // 2nd time: Either display form if a new location is to be stored or display the drop-down list //--------------------------------------------------------------------- // First check the password switch ($_REQUEST['m']) { case '0': $user_name = "hc"; break; case '1': $user_name = "wm"; break; default: $user_name = "hc"; } $mysql_query = "SELECT `user_password_hash` FROM `".$database_name."`.`users` WHERE `user_name` = 'auto'"; $rs_select_pswd = mysql_query($mysql_query); if (!$rs_select_pswd) { $error_message_01 = "SELECT error (users)"; $error_message_02 = $_SERVER['SCRIPT_NAME']; $error_message_03 = str_replace("'", "''", $mysql_query); $error_message_04 = str_replace("'", "''", mysql_error()); list ($error_code, $text) = store_error_message($debug, $value, $connect, true, $error_message_01, $error_message_02, $error_message_03, $error_message_04, $user_ip); $print_debug .= $text."
"; echo ""; } else { if (mysql_num_rows($rs_select_pswd) < 1) { $command = "Unknown user id?
"; } else { $row_pswd = mysql_fetch_array($rs_select_pswd); if (md5($_REQUEST['psw']) !== $row_pswd['user_password_hash']) { $print_debug .= "Hash from database: ".$row_pswd['user_password_hash']." vs.
Hash from password: ".md5($_REQUEST['psw'])." (".$_REQUEST['psw'].")
"; echo ""; } else { //$mysql_query = "INSERT INTO `".$database_name."`.`".$table."` (`table_name`, `hex_1`, `hex_2`, `ip_address`, `last_updated`) VALUES ('".$key_value[0]."', '".$hash_ip."', '".$hash_updated."', '".$user_ip."', '".$key_value[1]."') ON DUPLICATE KEY UPDATE `hex_2` = '".$hash_updated."', `ip_address` = '".$user_ip."', `last_updated` = '".$key_value[1]."'"; $mysql_query = "INSERT INTO `".$database_name."`.`bh3_ip_filter` (`id`, `ip_address`, `accessed_by`, `status`, `description`, `time_stamp`) VALUES (NULL, '".$user_ip."', 'WM', 'active', 'Automatically stored', CURRENT_TIMESTAMP) ON DUPLICATE KEY UPDATE `description` = concat('Automatically updated, ',`description`), `time_stamp` = CURRENT_TIMESTAMP"; $rs_insert_temp = mysql_query($mysql_query); if (!$rs_insert_temp) { $error_message_01 = "INSERT error (bh3_ip_filter)"; $error_message_02 = $_SERVER['SCRIPT_NAME']; $error_message_03 = str_replace("'", "''", $mysql_query); $error_message_04 = str_replace("'", "''", mysql_error()); list ($error_code, $text) = store_error_message($debug, $value, $connect, true, $error_message_01, $error_message_02, $error_message_03, $error_message_04, $user_ip); $print_debug .= $text."
"; } else { $command = "
RESULTS
- Updated IP filters
"; array_push ($last_update_changed , array("bh3_ip_filter", date("Y-m-d H:i:s"))); } } } } } else { //--------------------------------------------------------------------- // UNKNOWN parameter passed //--------------------------------------------------------------------- $command = "
Unknown parameter passed ".$action.". MIFFED!"; } // The code that updates the 'telephones' table is in an external file (easier to maintain rather than storing in umpteen scripts) if (count($last_update_changed) > 0) { include $_SERVER['DOCUMENT_ROOT'].$php_path.'update_last_updated_table.php'; } print "
".$command."
"; // This
overrides a style set by Incomedia echo "
"; $print_debug .= "----END OF DEBUG LISTING"; mysql_close($link); if (!$on_the_web) { print "

".$print_debug."

"; require 'bottom.php'; } } else { function Warning_handler($errno, $errstr) { echo("

Bugger, no e-mail was sent because the e-mail function reported the following error:
".$errstr); } set_error_handler("Warning_handler", E_WARNING); echo "



Sorry, no data to display. Will try to inform the web master ...

"; $headers = "From: foggy_glasses@bh3.org\r\n"; $headers .= "Date: ".date("D, d M Y H:i:s") . " UT\r\n"; $error_header = "Connection error"; mail('error@bh3.org', $error_header, "Database unavailable", $headers); } ?>

The Safe Haven for Bergen Hash House Harriers

Running since 1996 - On the Web since 1999

Designed by GIN'n'TONIC - Powered by WHISKY
* @license http://www.bh3.org/license.php The BH3 License * @link http:// * * Stand alone script: index_footer_copyright.php => ALL MODIFICATIONS MUST BE MADE TO THIS SCRIPT THEN COPIED TO INCOMEDIA! * * Last updated: * 23 Jun 2016 - First version * 20 Nov 2017 - Adjusted to function in the footer set up by v14 of the Incomedia software * */ $connect = false; include $_SERVER['DOCUMENT_ROOT'].'/bh3_org_globals.php'; if ($connect) { $print_debug = "----START OF DEBUG LISTING
"; // if (!$php_path) { if (!isset($php_path)) { require $_SERVER['DOCUMENT_ROOT'].'/bh3_org_get_file_paths.php'; require_once $_SERVER['DOCUMENT_ROOT'].$php_path.'func_store_error_message.php'; require_once $_SERVER['DOCUMENT_ROOT'].$php_path.'get_sys_data.php'; require_once 'menu.php'; $on_the_web = false; $suggested_target = "blank"; echo "

Function:
- Displays the copyright notice on the index page

Please note:
- Nothing special

Script:
- ".$_SERVER['SCRIPT_NAME']."
 

"; } else { $on_the_web = true; $suggested_target = "self"; } require_once $_SERVER['DOCUMENT_ROOT'].$php_path.'interscandi_func_get_text_for_page.php'; $article_array = array(); array_push ($article_array, 373); $article = ""; $current_year = date("Y"); for ($i=0; $i"; include $_SERVER['DOCUMENT_ROOT'].$php_path.'replace_variables_in_text.php'; if (strlen($text) > 0) { $article .= $text; } } if (strlen($article) > 0) { //Replace some of the formatting code added to the article // $article = str_replace("
", "
", $article); // $article = str_replace("", "", $article); $article = str_replace("", "", $article); echo "".$article.""; } $print_debug .= "----END OF DEBUG LISTING
"; if (!$on_the_web) { print "

".$print_debug."

"; require 'bottom.php'; } // This is the last script so close the database connection mysql_close($link); } else { function Warning_handler($errno, $errstr) { echo("

Bugger, no e-mail was sent because the e-mail function reported the following error:
".$errstr); } set_error_handler("Warning_handler", E_WARNING); echo "



Sorry, no data to display. Will try to inform the web master ...

"; $headers = "From: foggy_glasses@bh3.org\r\n"; $headers .= "Date: ".date("D, d M Y H:i:s") . " UT\r\n"; $error_header = "Connection error"; mail('error@bh3.org', $error_header, "Database unavailable", $headers); } ?>
Back to content