In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0001105 [In-Portal CMS] Admin Interfaces feature request always 2011-08-20 15:58 2012-07-25 05:33
Reporter Dmitry View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Fixed in Version 5.2.0-B1
Status closed Product Version Target Version 5.2.0
Time EstimateNo estimate
Summary 0001105: Add "Login as User" button to user list in Admin
Description Add "Login As" button to user list in Admin which will help admins to see how any particular user sees the website by logging in as selected user.

Button will login that user (without admin knowing his password) in a separate popup window.
Additional Information Plan:
1. create u:OnLoginAs event, that will be called from Front-end and will login user by ID given in URL
2. in CheckPermission for u:OnLoginAs event we will get logged-in user's ID from Admin Console; if user is valid, then allow login
3. in users grid add toolbar button "Login As", that will open front-end url with u:OnLoginAs event with user id from first selected user in grid
4. when there are more then 1 record selected, then display alert message to admin, that he must select only 1 user
Tags No tags attached.
Change Log Message Add "login as user" button to user list in Admin
Estimate Points 2
Attached Files patch file icon login_as_user_1105.patch [^] (6,842 bytes) 2011-10-06 10:05 [Show Content]
patch file icon login_as_user_1105.2.patch [^] (6,972 bytes) 2011-10-11 09:30 [Show Content]
patch file icon login_as_user_1105.3.patch [^] (6,928 bytes) 2011-10-11 12:29 [Show Content]
patch file icon login_as_user_v4.patch [^] (11,565 bytes) 2011-10-12 05:56 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to 0001081closed (5.1.3)alex Logout link broken 

-  Notes
User avatar (0003914)
Dmitry (manager)
2011-09-26 08:24

We have it in Resumark for sure!
User avatar (0004007)
Dmitry (manager)
2011-10-04 20:18

Erik, please review and take from Pasttimes project.

Make sure to add new HIDE new button in Simple System preset
User avatar (0004032)
erik (manager)
2011-10-06 10:05

patch attached - needs testing
User avatar (0004035)
alex (manager)
2011-10-06 11:18
edited on: 2011-10-06 14:18

1. There is no need for getFirstSelected JavaScript method, since Grid class already has a method to get all selected IDs in grid. Grid class object can be accesed via Grids['prefix.special'] construct. I've created a "code review" (in the past) for you about another project with exactly same problem.

2. There is no need to add additional parameters to m_Link tag result, when they can be incorporated within it. Please move user_event into m_Link tag parameters. Also there is no need to use "events[u]" form for event setting (please use u_event standard way).

3. Not all phrases used in this patch have been added into language pack (english.lang file).

4. All phrases in language pack should be alphabetically sorted. I've reported this problem in another 2 tasks already.

5. Please use method of verifying admin session, used for "Browse Mode" processing (the one in kApplication::Run method for detecting if admin is logged-in or not) and not create new method, like you did with _hasAdminSession.

6. Using loginUserById method alone to login user won't properly set it's groups to session. Please look into ActivateUser tag to find a way how it should be properly done.

User avatar (0004039)
erik (manager)
2011-10-11 09:31

login_as_user_1105.2.patch attached - needs testing
User avatar (0004040)
alex (manager)
2011-10-11 10:00

1. Please don't try to create non-obvious code, where it can be obvious.
For example code
if (Grids['u.regular'].GetSelected()[1]) {

should be literally checking if there was more then 1 user selected, then why checking for 2nd array element presence, when direct check can be made (which looks more obvious to the one who don't know how it should work):

if ( Grids['u.regular'].GetSelected().length > 1 ) {

2. Don't just copy/paste code, when there could a way to do it more effieciently, e.g. by using already existing method to do the job. For example code:

$user = (int)$admin_session->RecallVar('user_id');
return ($user != 0);

could be replaced with:

return $admin_session->LoggedIn();

3. Don't create intermidiate variables, when you plan to use then only once, e.g. "$user" variable from example above.

4. If variable contains some ID in it, then it should indicate this in it's name, e.g. "$user_id" instead of "$user". You can see other parts of In-Portal code to get the idea.

5. Tabulation in OnLoginAs method is completely wrong (see attached patch to get the idea if PHP Editor you're using donesn't provide a quick way to see what's wrong).

6. Some of the phrases in the language pack doesn't belong to "Core" module. Please make sure to export only "Core" module phrases of "Admin" & "Both" types on language pack export dialog. This way you'll notice that phrase isn't exported soon enough.
User avatar (0004041)
erik (manager)
2011-10-11 12:31

login_as_user_1105.3.patch attached - needs testing
User avatar (0004045)
alex (manager)
2011-10-12 05:57

Patch "login_as_user_v4.patch" also fixes issue with all home page links to result in 404 page in mod-rewrite when "env" variable is present.
User avatar (0004046)
alex (manager)
2011-10-12 05:57

Fix committed to 5.2.x branch. Commit Message:

Fixes 0001105: Add "Login as User" button to user list in Admin
Commit on behalf of Erik
User avatar (0005113)
alex (manager)
2012-07-25 05:33

Since 5.2.0 version was released.

- Related Changesets
In-Portal CMS: 5.2.x r14663
Timestamp: 2011-10-12 05:57:57
Author: alex
Details ] Diff ]
Fixes 0001105: Add "Login as User" button to user list in Admin
Commit on behalf of Erik
mod - /in-portal/branches/5.2.x/admin/system_presets/simple/users_u.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/admin_templates/users/users_list.tpl Diff ] File ]
mod - /in-portal/branches/5.2.x/core/install/english.lang Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/managers/request_manager.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/utility/http_query.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/users/users_config.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/users/users_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/users/users_tag_processor.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-07-25 05:33 alex Note Added: 0005113
2012-07-25 05:33 alex Status resolved => closed
2011-10-22 05:27 alex Estimate Points => 2
2011-10-12 05:57 alex Changeset attached 5.2.x r14663
2011-10-12 05:57 alex Note Added: 0004046
2011-10-12 05:57 alex Status reviewed and tested => resolved
2011-10-12 05:57 alex Fixed in Version => 5.2.0-B1
2011-10-12 05:57 alex Resolution open => fixed
2011-10-12 05:57 alex Assigned To !COMMUNITY => alex
2011-10-12 05:57 alex Note Added: 0004045
2011-10-12 05:56 alex File Added: login_as_user_v4.patch
2011-10-12 04:52 alex Relationship added related to 0001081
2011-10-11 14:39 alex Assigned To alex => !COMMUNITY
2011-10-11 14:39 alex Status needs testing => reviewed and tested
2011-10-11 12:31 erik Note Added: 0004041
2011-10-11 12:31 erik Assigned To erik => alex
2011-10-11 12:31 erik Status needs work => needs testing
2011-10-11 12:29 erik File Added: login_as_user_1105.3.patch
2011-10-11 10:00 alex Note Added: 0004040
2011-10-11 10:00 alex Assigned To alex => erik
2011-10-11 10:00 alex Status needs testing => needs work
2011-10-11 09:31 erik Note Added: 0004039
2011-10-11 09:31 erik Assigned To erik => alex
2011-10-11 09:31 erik Status needs work => needs testing
2011-10-11 09:30 erik File Added: login_as_user_1105.2.patch
2011-10-06 14:18 Dmitry Note Edited: 0004035 View Revisions
2011-10-06 11:18 alex Note Added: 0004035
2011-10-06 11:18 alex Assigned To alex => erik
2011-10-06 11:18 alex Status needs testing => needs work
2011-10-06 10:05 erik Time Estimate Removed 2 =>
2011-10-06 10:05 erik Note Added: 0004032
2011-10-06 10:05 erik Assigned To erik => alex
2011-10-06 10:05 erik Developer => erik
2011-10-06 10:05 erik Status needs work => needs testing
2011-10-06 10:05 erik File Added: login_as_user_1105.patch
2011-10-04 20:18 Dmitry Note Added: 0004007
2011-10-04 20:18 Dmitry Assigned To => erik
2011-10-04 20:18 Dmitry Status active => needs work
2011-09-26 08:24 Dmitry Note Added: 0003914
2011-09-26 05:05 alex Note Deleted: 0003912
2011-09-26 05:05 alex Additional Information Updated View Revisions
2011-09-26 05:04 alex Time Estimate Added 2
2011-09-26 05:04 alex Note Added: 0003912
2011-08-20 15:58 Dmitry New Issue
2011-08-20 15:58 Dmitry Reference =>
2011-08-20 15:58 Dmitry Change Log Message => Add "login as user" button to user list in Admin

Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker