Posted by joe.bearden on September 23, 2010 at 6:20pm
I'm using Masquerade to allow people to use multiple accounts on our site.
I'd like to be able to use Rules when the secondary account is logged in to check the primary account for a role and take an action on the secondary account based on the answer.
Anyone know if/how this can be done?
Comments
Seems dangerous
The Masquerade module is, as far as I know, intended for developing purposes and letting developers/themers temporarily view the site through another user's eyes. Letting 'people' use the module sounds scary.
Anyway.
I don't think there are any variables exposed to Rules that can be used. It is possible (but not adviceable) that you can write some PHP code to fetch the UID for the primary user account, load it into Rules and then treat it as any other loaded user object.
Another approach, which doesn't involve Masquerade, is that you let users create completely separate accounts and use flags (or something) to connect them. (You could also use node or user references on profile nodes, if you use Content Profile.) If you have a more standard connection between two users it will probably be easier to load the related user data inside Rules.
Good luck!
//Johan Falk, NodeOne, Sweden
Thanks so much for the reply!
Thanks so much for the reply! It's great to get help and support from the community here, and it's what really makes Drupal practical.
Masquerade lets you set up particular accounts that normal users can Masquerade as, so there's no issue with them logging into an account they're not supposed to. It's just simpler for them than logging out of their primary account, logging in to their secondary account, logging out again, and back into their primary.
What you're describing is pretty much what I'd like to do, but lack the skill to implement.
It's really step two that's beyond me, as I'm not really a PHP guy, and I don't really understand how to write a comparison within the Rules interface. Can you help?
Thanks!
Masquerade
Finaly i had found the option to enable the masquerade in the web page.
I gone: admin->structure->context->os_public->edit blocks->chech masquerade and then insert in footer bottom.