Role problem with multisite wordpress install
-
Hi
I am using CAS Maestro on a multisite wordpress platform, and encounter a role attribution problem when combined with the auto register functionnality: the “subscriber” role is only attributed to the user on the site he first visits on the platform, which leads to its account creation, and not every time he visits a new site of the platform.
- The user use CAS to login for the first time on the wordpress multisite platform, to site A
- CAS Maestro creates the account at the platform level, and gives it the “subscriber” role to site A
- The user tries to go visit site B, on the same platform
- Since the account already exists, no role is given to the user on site B, which leads to an infinite cycle of redirects when the user tries to access it
At the moment, I have worked around the problem by adding the following code in cas-maestro.php, line 247:
if($this->canUserRegister($username) && empty($user->roles)) { add_user_to_blog(get_current_blog_id(), $user->ID, 'subscriber'); }
Which ensures that is the user has no role on some site, we always attribute him the “subscriber” one by default if the site configuration allows for user registration.
Would it be possible to correct this problem upstream, if it is indeed a bug?
Kind regards,
Guillaume
- The topic ‘Role problem with multisite wordpress install’ is closed to new replies.