From e5d141dab65997f11eb748150f5d8d3d37d7fc35 Mon Sep 17 00:00:00 2001 From: fisharebest Date: Tue, 25 Jan 2011 08:40:37 +0000 Subject: manageservers.php has been replaced with admin_site_ipaddress.php --- manageservers.php | 223 ------------------------------------------------------ 1 file changed, 223 deletions(-) delete mode 100644 manageservers.php diff --git a/manageservers.php b/manageservers.php deleted file mode 100644 index 239c6b9d95..0000000000 --- a/manageservers.php +++ /dev/null @@ -1,223 +0,0 @@ -Access Denied
You do not have access to this resource.'); - //-- display messages as to why the editing access was denied - if (!WT_USER_GEDCOM_ADMIN) echo "
".WT_I18N::translate('This user name cannot edit this GEDCOM.'); - echo "

".WT_I18N::translate('Close Window')."
"; - print_footer(); - exit; -} - -$action = safe_GET('action'); -if (empty($action)) $action = safe_POST('action'); -$address = safe_GET('address'); -if (empty($address)) $address = safe_POST('address'); -$comment = safe_GET('comment'); -if (empty($comment)) $comment = safe_POST('comment'); -$comment = str_replace(array("\\", "\$", "\""), array("\\\\", "\\\$", "\\\""), $comment); - -$deleteBanned = safe_POST('deleteBanned'); -if (!empty($deleteBanned)) { // A "remove banned IP" button was pushed - $action = 'deleteBanned'; - $address = $deleteBanned; -} - -$deleteSearch = safe_POST('deleteSearch'); -if (!empty($deleteSearch)) { // A "remove search engine IP" button was pushed - $action = 'deleteSearch'; - $address = $deleteSearch; -} - -if (empty($action)) $action = 'showForm'; - -/* -* Validate input string to be an IP address -*/ -function validIP($address) { - if (!preg_match('/^\d{1,3}\.(\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)$/', $address)) return false; - $pieces = explode('.', $address); - foreach ($pieces as $number) { - if ($number!="*" && $number>255) return false; - } - return true; -} - -if ($action=='addBanned' || $action=='addSearch' || $action=='deleteBanned' || $action=='deleteSearch') { - if (validIP($address)) { - // Even if we are adding a new record, we must delete the existing one first. - WT_DB::prepare( - "DELETE FROM `##ip_address` WHERE ip_address=?" - )->execute(array($address)); - if ($action=='addBanned') { - WT_DB::prepare( - "INSERT INTO `##ip_address` (ip_address, category, comment) VALUES (?, ?, ?)" - )->execute(array($address, 'banned', $comment)); - } - if ($action=='addSearch') { - WT_DB::prepare( - "INSERT INTO `##ip_address` (ip_address, category, comment) VALUES (?, ?, ?)" - )->execute(array($address, 'search-engine', $comment)); - } - } else { - if ($action=='addBanned') { - $errorBanned=WT_I18N::translate('Invalid IP address.'); - } - if ($action=='addSearch') { - $errorSearch=WT_I18N::translate('Invalid IP address.'); - } - } - $action='showForm'; -} - -?> - - - -

', - '

', WT_I18N::translate('Manage sites'), '

', - '', - '
', - '
', - '', - '', - '', - '', - '', - '
', WT_I18N::translate('Manually mark Search Engines by IP'), ''. help_link('help_manual_search_engines'), '
', - ''; - - $sql="SELECT ip_address, comment FROM `##ip_address` WHERE category='search-engine' ORDER BY INET_ATON(ip_address)"; - $index=0; - $search_engines=WT_DB::prepare($sql)->fetchAssoc(); - foreach ($search_engines as $ip_address=>$ip_comment) { - echo ''; - echo ''; - } - echo ''; - echo ''; - - if (!empty($errorSearch)) { - echo ''; - $errorSearch = ''; - } - echo '
'; - if (isset($WT_IMAGES["remove"])) { - echo ''; - } else { - echo ''; - } - echo '
'; - if (isset($WT_IMAGES["add"])) { - echo ''; - } else { - echo ''; - } - echo ''; - echo '
', WT_I18N::translate('You may enter a comment here.'), '
'; - echo $errorSearch; - echo '
'; -?> - - - - -
-
- - - - - -
- - -
- -fetchAssoc(); -foreach ($banned as $ip_address=>$ip_comment) { - echo ''; - echo ''; -} -echo ''; -echo ''; - -if (!empty($errorBanned)) { - echo ''; - $errorBanned = ''; -} -echo '
'; - if (isset($WT_IMAGES["remove"])) { - echo ''; - } else { - echo ''; - } - echo '
'; -if (isset($WT_IMAGES["add"])) { - echo ''; -} else { - echo ''; -} -echo ''; -echo '
', WT_I18N::translate('You may enter a comment here.'), '
'; - echo $errorBanned; - echo '
'; -print_footer(); -- cgit v1.3