CAS implemented hooks do not follow the standard hook naming convention. Need to rename the auth_filter hook to use a cas namespace. Warning the 6.x-3 and 7.x code will change here.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1059204-rename-hooks-and-add-documentation.patch | 6.22 KB | bfroehle |
| #3 | 1059204_rename_hooks_revised.patch | 1.18 KB | bfroehle |
| #2 | 1059204_rename_hooks.patch | 1.89 KB | metzlerd |
| #1 | 1059204_rename_auth_filter_hook.patch | 1.37 KB | metzlerd |
Comments
Comment #1
metzlerd commentedI also took away the 'cas' constant, as it seems to add no value.
Comment #2
metzlerd commentedOn second thought, renaming both hooks, because hook_auth_transform should go away when we remove the dependency on external authmap tables.
Comment #3
bfroehle commentedMissing an underscore.
Missing an underscore.
We never use $return, so we can get rid of that.
Revised patch attached.
Comment #4
bfroehle commentedSince we are renaming the hooks already, I suggest we choose more intuitive names.
For transforming the user names (previously
hook_auth_transform()), I suggesthook_cas_name_alter(). This then allows us to run the hook by simply callingdrupal_alter('cas_name', $cas_name).For allowing/denying access based upon user name, I suggest
hook_cas_name_allowed(). (This name I'm not too thrilled with .. hook_cas_name_filter() didn't seem much better.... definitely open to suggestions here).Also I've added a cas.api.php file which demonstrates the hooks, and added a note in the README about how the hooks were renamed.
Comment #5
metzlerd commentedI like the first, but not the auth_filter rename. Ultimately this filter is there to filter the user. As we move forward in implementation, it might be better to change this one to create a user object that we add some kind of way to say---- nope don't allow this person and wrap it up with the altering of user identitities. If we're going to get to removing authmap, we need to rethink this. Now we have at least 3 different issues that talk about refactoring hooks. I think we need to pick one and have the discussion there.
Comment #6
bfroehle commentedLet's move the discussion to #1059942: Refactor Hooks .