Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (16 sloc) 480 Bytes
<?php
// Allow only logins from specified countries (requires CloudFlare IP Geolocation)
add_action( 'wp_authenticate', 'cf_country_login', 1);
function cf_country_login()
{
if ( !isset($_SERVER["HTTP_CF_IPCOUNTRY"]) )
return;
if ( !in_array($_SERVER["HTTP_CF_IPCOUNTRY"], array('DK')) )
{
$urel = 'https://k0nsl.org';
echo 'Sorry, but you cannot login at this time.';
header("Refresh: 3; url='.$urlel.'");
exit;
}
}
?>