Closed (outdated)
Project:
Masquerade
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2012 at 13:12 UTC
Updated:
14 Oct 2019 at 13:25 UTC
Jump to comment: Most recent
Comments
Comment #1
geaseYes, this would be great. I have some rules that set user roles at login depending on various conditions, and to check how it all works via masquerade simulating user login is needed. Obviously, hook_user('login') should be called somewhere.
Comment #2
peterx commented@enboig and @gease I am interested in your use of login and rules for possible use in http://drupal.org/node/1416136. The second login has to get all the roles assigned to the fist login. I am looking at custom code. hook_user and/or Rules might be a cleaner way to do things.
Comment #3
enboig commentedAt hook_boot() I check global $user->uid versus $_SESSION['my_old_uid']; if its different, I reload anything I need and update $_SESSION['my_old_uid'].
Comment #4
peterx commentedSounds like your code would have to run after everything else that modifies the user. For my use, it would be something like:
$old = load user $_SESSION['mymodule_old_uid']
$user->roles = array_merge($user->roles, $old->roles);
Comment #5
avpadernoI am closing this feature request, as Drupal 6 is no longer supported. Please re-open it if you would like the feature implemented in the Drupal 7 or 8 version of the module.