The attached patch adds a setting to the CAS configuration page that allows administrators to define what role(s) CAS users should receive. These roles are setup upon account creation and updated upon every login.

It removes the default DRUPAL_AUTHENTICATED_RID role, but this role is automatically set for any new user.

Comments

jrbeeman’s picture

StatusFileSize
new2.53 KB

Updated patch against cas-5.x-2.1. This patch has the added benefit of reseting the user's local Drupal password upon every login for added security.

metzlerd’s picture

Status: Active » Needs work

I did some testing on this and when no CAS role is defined, I get the following warnings:

    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/adminweb/dave/modules/cas/cas.module on line 30.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/adminweb/dave/modules/cas/cas.module on line 30.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/adminweb/dave/modules/cas/cas.module on line 30.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/adminweb/dave/modules/cas/cas.module on line 30.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/adminweb/dave/modules/cas/cas.module on line 30.
    * warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/adminweb/dave/modules/cas/cas.module on line 30.

I think you can fix this by changing the default value returned by variable_get to an array type, but haven't tested the change. Could you fix this and post another patch?

Thanks,

Dave

jrbeeman’s picture

StatusFileSize
new2.59 KB

I believe I have fixed the issue. See the new attached patch.

metzlerd’s picture

Status: Needs work » Fixed

Thanks, that did it. Committed in HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

  • Commit 2c2eaf9 on 6.x-1.x, 6.x-2.x, 6.x-3.x, 7.x-1.x, master, 8.x-1.x by metzlerd:
    Adding auto-role add issue #144867