Diff
14 years ago
.htaccess
14 years ago
Diff.php
14 years ago
GeoIP.dat
13 years ago
IPTraf.php
13 years ago
diffResult.php
14 years ago
email_genericAlert.php
14 years ago
email_newIssues.php
14 years ago
email_unlockRequest.php
14 years ago
menu_activity.php
13 years ago
menu_blockedIPs.php
13 years ago
menu_countryBlocking.php
13 years ago
menu_options.php
13 years ago
menu_scan.php
13 years ago
menu_scanSchedule.php
13 years ago
schedWeekEntry.php
13 years ago
sysinfo.php
14 years ago
unknownFiles.php
13 years ago
viewFullActivityLog.php
13 years ago
wf503.php
13 years ago
wfAPI.php
13 years ago
wfAction.php
14 years ago
wfArray.php
13 years ago
wfBrowscap.php
14 years ago
wfBrowscapCache.php
14 years ago
wfBulkCountries.php
13 years ago
wfConfig.php
13 years ago
wfCountryMap.php
13 years ago
wfCrawl.php
13 years ago
wfDB.php
13 years ago
wfDict.php
14 years ago
wfGeoIP.php
13 years ago
wfIssues.php
13 years ago
wfLockedOut.php
14 years ago
wfLog.php
13 years ago
wfModTracker.php
14 years ago
wfRate.php
14 years ago
wfScanEngine.php
13 years ago
wfSchema.php
13 years ago
wfUnlockMsg.php
14 years ago
wfUtils.php
13 years ago
wfViewResult.php
14 years ago
wordfenceClass.php
13 years ago
wordfenceConstants.php
13 years ago
wordfenceHash.php
13 years ago
wordfenceScanner.php
13 years ago
wordfenceURLHoover.php
13 years ago
menu_countryBlocking.php
91 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 | <div class="wordfence-lock-icon wordfence-icon32"><br /></div><h2 id="wfHeading">Block specific countries from accessing your site</h2> |
| 10 | <div class="wordfenceWrap" style="margin: 20px 20px 20px 30px;"> |
| 11 | <table class="wfConfigForm"> |
| 12 | <tr><td colspan="2"><h2>Country Blocking Options</h2></td></tr> |
| 13 | <tr><th>What to do when we block someone:</th><td> |
| 14 | <select id="wfBlockAction"> |
| 15 | <option value="block"<?php if(wfConfig::get('cbl_action') == 'block'){ echo ' selected'; } ?>>Show the standard Wordfence blocked message</option> |
| 16 | <option value="redir"<?php if(wfConfig::get('cbl_action') == 'redir'){ echo ' selected'; } ?>>Redirect to the URL below</option> |
| 17 | </select> |
| 18 | </td></tr> |
| 19 | <tr><th>URL to redirect blocked users to:</th><td><input type="text" id="wfRedirURL" value="<?php if(wfConfig::get('cbl_redirURL')){ echo htmlspecialchars(wfConfig::get('cbl_redirURL')); } ?>" /></td></tr> |
| 20 | <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> |
| 21 | <tr><th>Block access to the login form too:</th><td><input type="checkbox" id="wfLoginFormBlocked" value="1" <?php if(wfConfig::get('cbl_loginFormBlocked')){ echo 'checked'; } ?> /></td></tr> |
| 22 | </table> |
| 23 | <h2>Select which countries to block</h2> |
| 24 | <div id="wfBulkBlockingContainer" style="margin-bottom: 10px;"> |
| 25 | <a href="#" onclick="jQuery('.wfCountryCheckbox').prop('checked', true); return false;">Select All</a> |
| 26 | <a href="#" onclick="jQuery('.wfCountryCheckbox').prop('checked', false); return false;">Deselect All</a> |
| 27 | <table border="0" cellpadding="0" cellspacing="0"> |
| 28 | <tr> |
| 29 | <?php |
| 30 | $counter = 0; |
| 31 | asort($wfBulkCountries); |
| 32 | foreach($wfBulkCountries as $code => $name){ |
| 33 | echo '<td style=""><input class="wfCountryCheckbox" id="wfCountryCheckbox_' . $code . '" type="checkbox" value="' . $code . '" /> ' . $name . ' </td>'; |
| 34 | $counter++; |
| 35 | if($counter % 5 == 0){ |
| 36 | echo "</tr><tr>\n"; |
| 37 | } |
| 38 | } |
| 39 | ?> |
| 40 | </tr> |
| 41 | </table> |
| 42 | </div> |
| 43 | <table border="0" cellpadding="0" cellspacing="0"><tr> |
| 44 | <td><input type="button" name="but4" class="button-primary" value="Save blocking options and country list" onclick="WFAD.saveCountryBlocking();" /></td> |
| 45 | <td style="height: 24px;"><div class="wfAjax24"></div><span class="wfSavedMsg"> Your changes have been saved!</span></td></tr> |
| 46 | </table> |
| 47 | <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> |
| 48 | </div> |
| 49 | </div> |
| 50 | <script type="text/javascript"> |
| 51 | jQuery(function(){ WFAD.setOwnCountry('<?php echo wfUtils::IP2Country(wfUtils::getIP()); ?>'); }); |
| 52 | <?php |
| 53 | if(wfConfig::get('cbl_countries')){ |
| 54 | ?> |
| 55 | jQuery(function(){ WFAD.loadBlockedCountries('<?php echo wfConfig::get('cbl_countries'); ?>'); }); |
| 56 | <?php |
| 57 | } |
| 58 | ?> |
| 59 | <?php |
| 60 | if( (! wfConfig::get('isPaid')) && (wfConfig::get('tourClosed', 0) == '1') ){ |
| 61 | echo 'WFAD.paidUsersOnly("Country blocking is only available to paid members because we have licensed a commercial geolocation database to provide this feature.");'; |
| 62 | } |
| 63 | ?> |
| 64 | </script> |
| 65 | <script type="text/x-jquery-template" id="wfWelcomeContentCntBlk"> |
| 66 | <div> |
| 67 | <h3>Premium Feature: Block or redirect countries</h3> |
| 68 | <strong><p>Being targeted by hackers in a specific country?</p></strong> |
| 69 | <p> |
| 70 | The premium version of Wordfence offers country blocking. |
| 71 | This uses a commercial geolocation database to block hackers, spammers |
| 72 | or other malicious traffic by country with a 99.5% accuracy rate. |
| 73 | </p> |
| 74 | <p> |
| 75 | <?php |
| 76 | if(wfConfig::get('isPaid')){ |
| 77 | ?> |
| 78 | You have upgraded to the premium version of Wordfence and have full access |
| 79 | to this feature along with our other premium features and priority support. |
| 80 | <?php |
| 81 | } else { |
| 82 | ?> |
| 83 | If you would like access to this premium feature, please |
| 84 | <a href="https://www.wordfence.com/choose-a-wordfence-membership-type/?s2-ssl=yes" target="_blank">upgrade to our premium version</a>. |
| 85 | </p> |
| 86 | <?php |
| 87 | } |
| 88 | ?> |
| 89 | </div> |
| 90 | </script> |
| 91 |