Hello guys !
Well, that is my scenario :
i have a multisite.
Mastersite with PROSITES & MEMBERSHIP installed.
- (Say that the roles lists are identical on mastersite and subsites, and exist.)
- [Moreover, my aim is that I want filter menu's elements, functionnalities etc with the ROLES. So, for example, on his subsite, user with "LEVEL1" doesn't see the menu/functionnality "create a poll" but a user role "LEVEL2" can see it.]
So, in short :
When a user (visitor) goes to the mastersite, he subscribes to "create a new site" via PROSITES.
Automaticly, this new (creator) user has a "LEVEL1" on the mainsite and a "LEVEL1" role on his new subsite.
OK that works.
Next, via Membership subscriptions page, the user chooses a subscription (I have associatedg each subscription with a specific role).
So, when he chooses a subscription, his role changes to "LEVEL3" for exemple.
--> But here is my problem, this role changes only on mastersite and not on his subsite.
So I only need a little code hack (or other solution?) in order to synchronize/copy (?) the role of a user on mastersite and his subsite at moment of subsciption change in MEMBERSHIP.
I try to be more clear, for example :
1) subsite creation on mastersite with PROSITES form.
2) "role1" by default is set for this user on mastersite and his new subiste.
3) the user change his subscription plan in MEMBERSHIP's form (on mastersite) where subscription level2 is associated with "role2" .
4) then in Mastersite, role for this user has been correctly changed to "role2".
5) BUT this user on his subsite always has "role1" set...
6) So, here i need that a hack or code or plugin do that : "automaticly take actual user role (for this user) on mainsite and copy to his userrole in the subsite of the concerned user".
7) In fact, I need that roles on subsites are ALWAYS identical to roles in the mainsite for a user.
Thus, as admin on mainsite, i can change rules and functionalities for roles and it will change the rights of users (by roles) on the subsites.
Sorry, it's a little bit complicated to explain.
All works, I just need this little hack.
Can someone can has an idea/example to correctly do it ?
If you need more details, don't hesitate to ask me.
In advance, 1000 thanks you !
For developpers, what code i need:
- In membership, when a user choose/click on one of subscriptions :
(At this moment, when user clicks a subscription ("Sign up"), the associated role/subscription Membership (in rules) is already automaticly set in mainsite)
- get his role in Mastersite
- copy it in the subsite that this user own.