function restrict_by_ip_nodeapi in Restrict Login or Role Access by IP Address 6
Implementation of hook_nodeapi().
File
- ./
restrict_by_ip.module, line 317 - Allows the admin to select which IP Addresses a user can login from for this site. Some of the code below is taken from the cck_ipaddress_module
Code
function restrict_by_ip_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
global $user;
switch ($op) {
case 'load':
$mypath = explode("?", request_uri());
if ($mypath[1] == "restricted") {
// No, go to the error page.
drupal_goto('logout', 'destination=' . variable_get('restrict_by_ip_error_page', ''));
}
else {
/* okay */
}
break;
}
}