function restrict_by_ip_user in Restrict Login or Role Access by IP Address 6.2
Same name and namespace in other branches
- 5 restrict_by_ip.module \restrict_by_ip_user()
- 6.3 restrict_by_ip.module \restrict_by_ip_user()
- 6 restrict_by_ip.module \restrict_by_ip_user()
Implementation of hook_user()
File
- ./
restrict_by_ip.module, line 170 - Allows the admin to select which ip addresses role or 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_user($type, &$edit, &$account, $category = NULL) {
global $user;
switch ($type) {
case 'login':
return _restrict_by_ip_login($user);
break;
case 'form':
case 'register':
return _restrict_by_ip_form($account->uid);
break;
case 'insert':
case 'update':
return _restrict_by_ip_update($account->uid, $edit);
break;
case 'submit':
//Drupal Bug: http://drupal.org/node/321787 - using for edit user will still update user data if error
return _restrict_by_ip_validate($edit, 1);
break;
case 'validate':
//Drupal Bug: http://drupal.org/node/321787 - not fired when editing user only on new user
return _restrict_by_ip_validate($edit, 2);
break;
case 'delete':
return _restrict_by_ip_delete($account->uid);
break;
}
}