Diff
11 years ago
.htaccess
14 years ago
Diff.php
14 years ago
GeoIP.dat
10 years ago
IPTraf.php
11 years ago
compat.php
10 years ago
conntest.php
11 years ago
cronview.php
10 years ago
dashboard.php
10 years ago
dbview.php
11 years ago
diffResult.php
11 years ago
email_genericAlert.php
10 years ago
email_newIssues.php
10 years ago
email_passwdChanged.php
10 years ago
email_pleaseChangePasswd.php
10 years ago
email_unlockRequest.php
11 years ago
menuHeader.php
12 years ago
menu_activity.php
10 years ago
menu_blockedIPs.php
10 years ago
menu_countryBlocking.php
10 years ago
menu_diagnostic.php
10 years ago
menu_options.php
10 years ago
menu_passwd.php
10 years ago
menu_rangeBlocking.php
10 years ago
menu_scan.php
10 years ago
menu_scanSchedule.php
10 years ago
menu_sitePerf.php
11 years ago
menu_sitePerfStats.php
11 years ago
menu_twoFactor.php
10 years ago
menu_waf.php
10 years ago
menu_whois.php
11 years ago
pageTitle.php
11 years ago
schedWeekEntry.php
12 years ago
sysinfo.php
10 years ago
unknownFiles.php
11 years ago
viewFullActivityLog.php
10 years ago
wf503.php
10 years ago
wfAPI.php
10 years ago
wfAction.php
14 years ago
wfActivityReport.php
10 years ago
wfArray.php
13 years ago
wfBrowscap.php
12 years ago
wfBrowscapCache.php
10 years ago
wfBulkCountries.php
13 years ago
wfCache.php
10 years ago
wfConfig.php
10 years ago
wfCountryMap.php
13 years ago
wfCrawl.php
10 years ago
wfCrypt.php
11 years ago
wfDB.php
10 years ago
wfDiagnostic.php
10 years ago
wfDict.php
14 years ago
wfDirectoryIterator.php
11 years ago
wfGeoIP.php
10 years ago
wfHelperBin.php
11 years ago
wfHelperString.php
11 years ago
wfIPWhitelist.php
10 years ago
wfIssues.php
10 years ago
wfLockedOut.php
13 years ago
wfLog.php
10 years ago
wfRate.php
14 years ago
wfScan.php
11 years ago
wfScanEngine.php
10 years ago
wfSchema.php
10 years ago
wfUnlockMsg.php
11 years ago
wfUpdateCheck.php
11 years ago
wfUtils.php
10 years ago
wfView.php
10 years ago
wfViewResult.php
11 years ago
wordfenceClass.php
10 years ago
wordfenceConstants.php
10 years ago
wordfenceHash.php
10 years ago
wordfenceScanner.php
10 years ago
wordfenceURLHoover.php
11 years ago
menu_countryBlocking.php
133 lines
| 1 | <?php |
| 2 | require('wfBulkCountries.php'); |
| 3 | ?> |
| 4 | <script type="text/javascript"> |
| 5 | WFAD.countryMap = <?php echo json_encode($wfBulkCountries); ?>; |
| 6 | </script> |
| 7 | <div class="wordfenceModeElem" id="wordfenceMode_countryBlocking"></div> |
| 8 | <div class="wrap" id="paidWrap"> |
| 9 | <?php require('menuHeader.php'); ?> |
| 10 | <?php $pageTitle = "Block Selected Countries from Accessing your Site"; $helpLink="http://docs.wordfence.com/en/Country_blocking"; $helpLabel="Learn more about Country Blocking"; include('pageTitle.php'); ?> |
| 11 | <?php if(! wfConfig::get('isPaid')){ ?> |
| 12 | <div class="wf-premium-callout" style="margin: 20px"> |
| 13 | <h3>Country Blocking is only available to Premium Members</h3> |
| 14 | <p>Country blocking is a premium feature that lets you block attacks or malicious activity that originates in a specific country</p> |
| 15 | |
| 16 | <p>Upgrade to Premium today for less than $5 per month:</p> |
| 17 | <ul> |
| 18 | <li>Receive real-time Firewall and Scan engine rule updates for protection as threats emerge</li> |
| 19 | <li>Other advanced features like IP reputation monitoring, an advanced comment spam filter, advanced scanning options and cell phone sign-in give you the best protection available</li> |
| 20 | <li>Access to Premium Support</li> |
| 21 | <li>Discounts of up to 75% available for multiyear and multi-license purchases</li> |
| 22 | </ul> |
| 23 | |
| 24 | <p class="center"><a class="button button-primary" |
| 25 | href="https://www.wordfence.com/gnl1countryBlock1/wordfence-signup/">Get Premium</a></p> |
| 26 | </div> |
| 27 | <?php } ?> |
| 28 | <?php if(wfConfig::get('cacheType') == 'falcon'){ ?> |
| 29 | <div class="wfFalconNotice"> |
| 30 | <b>Note regarding country blocking with Falcon Engine enabled:</b><br /><br /> |
| 31 | Country blocking will only work on the login page and other dynamic pages with |
| 32 | Wordfence Falcon Engine enabled. We do this to keep your site fast and avoid |
| 33 | a country lookup on every request. |
| 34 | Serving cached pages only uses 2 to 3% of the resources that a non-cached page uses, |
| 35 | so malicious countries won't eat up your server resources when they load cached pages. |
| 36 | If you would like full country blocking, you can enable Basic Caching on the "Site Performance" page. |
| 37 | </div> |
| 38 | <?php } ?> |
| 39 | |
| 40 | <div class="wordfenceWrap" style="margin: 20px 20px 20px 30px;"> |
| 41 | <table class="wfConfigForm"> |
| 42 | <tr><td colspan="2"><h2>Country Blocking Options</h2></td></tr> |
| 43 | <?php if(! wfConfig::get('firewallEnabled')){ ?><tr><td colspan="2"><div style="color: #F00; font-weight: bold;">Firewall is disabled. You can enable it on the <a href="admin.php?page=WordfenceSecOpt">Wordfence Options page</a> at the top.</div></td></tr><?php } ?> |
| 44 | <tr><th>What to do when we block someone:</th><td> |
| 45 | <select id="wfBlockAction"> |
| 46 | <option value="block"<?php if(wfConfig::get('cbl_action') == 'block'){ echo ' selected'; } ?>>Show the standard Wordfence blocked message</option> |
| 47 | <option value="redir"<?php if(wfConfig::get('cbl_action') == 'redir'){ echo ' selected'; } ?>>Redirect to the URL below</option> |
| 48 | </select> |
| 49 | </td></tr> |
| 50 | <tr><th>URL to redirect blocked users to:</th><td><input type="text" id="wfRedirURL" size="40" value="<?php if(wfConfig::get('cbl_redirURL')){ echo esc_attr(wfConfig::get('cbl_redirURL')); } ?>" /> |
| 51 | <br /> |
| 52 | <span style="color: #999;">Must start with http:// for example http://yoursite.com/blocked/</span></td></tr> |
| 53 | <tr><th>Block countries even if they are logged in:</th><td><input type="checkbox" id="wfLoggedInBlocked" value="1" <?php if(wfConfig::get('cbl_loggedInBlocked')){ echo 'checked'; } ?> /></td></tr> |
| 54 | <tr><th>Block access to the login form:</th><td><input type="checkbox" id="wfLoginFormBlocked" value="1" <?php if(wfConfig::get('cbl_loginFormBlocked')){ echo 'checked'; } ?> /></td></tr> |
| 55 | <tr><th>Block access to the rest of the site (outside the login form):</th><td><input type="checkbox" id="wfRestOfSiteBlocked" value="1" <?php if(wfConfig::get('cbl_restOfSiteBlocked')){ echo 'checked'; } ?> /></td></tr> |
| 56 | <tr><td colspan="2"><h2>Advanced Country Blocking Options</h2></td></tr> |
| 57 | <tr><th colspan="2"> |
| 58 | If user hits the URL |
| 59 | <input type="text" id="wfBypassRedirURL" value="<?php echo esc_attr(wfConfig::get('cbl_bypassRedirURL'), array()); ?>" size="20" /> |
| 60 | then redirect that user to |
| 61 | <input type="text" id="wfBypassRedirDest" value="<?php echo esc_attr(wfConfig::get('cbl_bypassRedirDest'), array()); ?>" size="20" /> and set a cookie that will bypass all country blocking. |
| 62 | </th></tr> |
| 63 | <tr><th colspan="2"> |
| 64 | If user who is allowed to access the site views the URL |
| 65 | <input type="text" id="wfBypassViewURL" value="<?php echo esc_attr(wfConfig::get('cbl_bypassViewURL', ""), array()); ?>" size="20" /> |
| 66 | then set a cookie that will bypass country blocking in future in case that user hits the site from a blocked country. |
| 67 | </th></tr> |
| 68 | |
| 69 | </table> |
| 70 | <h2>Select which countries to block</h2> |
| 71 | <div id="wfBulkBlockingContainer" style="margin-bottom: 10px;"> |
| 72 | <a href="#" onclick="jQuery('.wfCountryCheckbox').prop('checked', true); return false;">Select All</a> |
| 73 | <a href="#" onclick="jQuery('.wfCountryCheckbox').prop('checked', false); return false;">Deselect All</a> |
| 74 | <table border="0" cellpadding="0" cellspacing="0"> |
| 75 | <tr> |
| 76 | <?php |
| 77 | $counter = 0; |
| 78 | asort($wfBulkCountries); |
| 79 | foreach($wfBulkCountries as $code => $name){ |
| 80 | echo '<td style=""><input class="wfCountryCheckbox" id="wfCountryCheckbox_' . $code . '" type="checkbox" value="' . $code . '" /> ' . $name . ' </td>'; |
| 81 | $counter++; |
| 82 | if($counter % 5 == 0){ |
| 83 | echo "</tr><tr>\n"; |
| 84 | } |
| 85 | } |
| 86 | ?> |
| 87 | </tr> |
| 88 | </table> |
| 89 | </div> |
| 90 | <table border="0" cellpadding="0" cellspacing="0"><tr> |
| 91 | <td><input type="button" name="but4" class="button-primary" value="Save blocking options and country list" onclick="WFAD.saveCountryBlocking();" /></td> |
| 92 | <td style="height: 24px;"><div class="wfAjax24"></div><span class="wfSavedMsg"> Your changes have been saved!</span></td></tr> |
| 93 | </table> |
| 94 | <span style="font-size: 10px;">Note that we use an IP to country database that is 99.5% accurate to identify which country a visitor is from.</span> |
| 95 | </div> |
| 96 | </div> |
| 97 | <script type="text/javascript"> |
| 98 | jQuery(function(){ WFAD.setOwnCountry('<?php echo wfUtils::IP2Country(wfUtils::getIP()); ?>'); }); |
| 99 | <?php |
| 100 | if(wfConfig::get('cbl_countries')){ |
| 101 | ?> |
| 102 | jQuery(function(){ WFAD.loadBlockedCountries('<?php echo wfConfig::get('cbl_countries'); ?>'); }); |
| 103 | <?php |
| 104 | } |
| 105 | ?> |
| 106 | </script> |
| 107 | <script type="text/x-jquery-template" id="wfWelcomeContentCntBlk"> |
| 108 | <div> |
| 109 | <h3>Premium Feature: Block or redirect countries</h3> |
| 110 | <strong><p>Being targeted by hackers in a specific country?</p></strong> |
| 111 | <p> |
| 112 | The premium version of Wordfence offers country blocking. |
| 113 | This uses a commercial geolocation database to block hackers, spammers |
| 114 | or other malicious traffic by country with a 99.5% accuracy rate. |
| 115 | </p> |
| 116 | <p> |
| 117 | <?php |
| 118 | if(wfConfig::get('isPaid')){ |
| 119 | ?> |
| 120 | You have upgraded to the premium version of Wordfence and have full access |
| 121 | to this feature along with our other premium features and priority support. |
| 122 | <?php |
| 123 | } else { |
| 124 | ?> |
| 125 | If you would like access to this premium feature, please |
| 126 | <a href="https://www.wordfence.com/gnl1countryBlock2/wordfence-signup/" target="_blank">upgrade to our premium version</a>. |
| 127 | </p> |
| 128 | <?php |
| 129 | } |
| 130 | ?> |
| 131 | </div> |
| 132 | </script> |
| 133 |