function cas_invoke_auth_transform in CAS 5
Same name and namespace in other branches
- 5.4 cas.module \cas_invoke_auth_transform()
- 5.3 cas.module \cas_invoke_auth_transform()
- 6.2 cas.module \cas_invoke_auth_transform()
Invokes hook_auth_transform() in every module.
Other modules may need to transform the results of phpCAS::getUser() into a Drupal username (i.e. phpCAS::getUser() is not guaranteed to return the same username that the user typed in or the Drupal username might be username@cas or something and we need to know it before we filter)
We cannot use hook_insert or any user hooks, because they fire way too late. We cannot use module_invoke_all(), because the argument needs to be passed by reference.
Parameters
$cas_user: The cas reply string to transform into a drupal username
1 call to cas_invoke_auth_transform()
- cas_login_check in ./
cas.module - Implementation of hook_init Traps a page load to see if authentication is required.
File
- ./
cas.module, line 28
Code
function cas_invoke_auth_transform(&$cas_name) {
foreach (module_list() as $module) {
$function = $module . '_auth_transform';
if (function_exists($function)) {
$function('cas', $cas_name);
}
}
}