Login as another user without a password
Posted by mustapha under Plone[4] Comments | No Trackbacks
Recently we developed an Intranet site with many custom workflows and roles that control what an user can see/do globally on the site and locally on some sections.
Users are stored in an AD server.
A problem we ran into was sometime we get a question like: I cannot do this or that thing. what's wrong?
The easiest way to answer this question is to login with the user's login name and password and see what is happening. Well, not really. We don't need the password. The login name is sufficient.
In the ZMI create a python script with this line:
Click the test tab and you are in as that user.
IMPORTANT SECURITY NOTE: Remove the script as soon as you are logged in.
Users are stored in an AD server.
A problem we ran into was sometime we get a question like: I cannot do this or that thing. what's wrong?
The easiest way to answer this question is to login with the user's login name and password and see what is happening. Well, not really. We don't need the password. The login name is sufficient.
In the ZMI create a python script with this line:
context.acl_users.session.setupSession(
the_user_login_name_i_want_to_login_as,
context.REQUEST.RESPONSE)
Click the test tab and you are in as that user.
IMPORTANT SECURITY NOTE: Remove the script as soon as you are logged in.