I had a request to add in some customizations to the admin screen for CAS at admin/user/cas. Specifically, the request was to add a new radio option under the "Login Form Settings" fieldset and for me to create a helper module to handle the logic. I couldn't "handle" the logic in my helper module because of the logic in cas_form_alter. In line 1066, we check to see if the admin setting is CAS_NO_LINK and just break (do nothing) if it's set. If one of the other two options are selected, this if condition fails and the other two options are run by default. So when I added another option in my helper module, I was unable to handle that case because the module didn't account for other options (it just ran through the other 2 cases "CAS_ADD_LINK" and "CAS_MAKE_DEFAULT"). The solution I came up with was to wrap each of these 3 options in if conditions (testing for the value of the variables) so that I could write my own handler.
Basically if(CAS_NO_LINK) don't do anything
if(CAS_ADD_LINK || CAS_MAKE_DEFAULT) do the rest of the logic.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 810164_rework_form_alter.patch | 4.08 KB | metzlerd |
| patch1.patch | 3.42 KB | jaydubb181 |
Comments
Comment #1
metzlerd commentedchanging revision and working on a slightly modified version of the patch. No need to test on don't allow and then break, just change the code to do the if then.
Comment #2
metzlerd commentedTested thoroughly, so going ahead with the commit here.