PPL

People and Tasks lists on dashboard ajax-loads sign in page if user logged out

Bug #722326 reported by Christopher Adams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PPL
In Progress
High
Brad Phillips

Bug Description

If a user is signed out and clicks a link they are now unauthorized to see, they should be redirected to the sign-up page.

However, currently, the People search list on the dashboard will accidentally load the sign-in page INTO the target div on the dashboard.

Example:

Step 1) Open two browser windows to your dashboard. In one browser tab sign out from PPL.

Step 2) In the other, click the name of the contact. The sign-in page is loaded into the profile container on the dashboard.

OR

Repeat step 1

Step 3) Enter a search term then delete it. The sign-up page is loaded into the People List widget.

Changed in ppl:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → 0.3
Revision history for this message
Christopher Adams (christopheradams) wrote :

This also affects the Task list

summary: - People list on dashboard ajax-loads sign in page if user logged out
+ People and Tasks lists on dashboard ajax-loads sign in page if user
+ logged out
Changed in ppl:
assignee: nobody → Brad Phillips (brad-bradphillips)
Revision history for this message
Christopher Adams (christopheradams) wrote :

You knows, dozens of widgets have this in the Content:

(#(header:Location: [root]/users/sign_in|false|301)#)

Really though I feel like this should only exist on pages with specific URLs.

I think what to do is that if the user session times out, then just automatically reload the sign in screen. Don't wait for users to click something and find out they are no longer logged in!

Then remove these redirects from sub-widgets.

Revision history for this message
Christopher Adams (christopheradams) wrote :

On a few widgets (like People list) I've been removing the redirect because now that People can sign in they need to see it too (more exactly a different version).

The original reason for including the redirect was to force the use to sign back in if they are interacting with the widget. But that was never a good solution to begin with.

Again - if the user session expires, he should just be logged out. He shouldn't have to attempt to interact with the interface before he discovers this.

Simply removing the redirects from lower level ajax widgets and finding a better solution to the entire problem (user session has expired) would fix this bug.

Revision history for this message
Christopher Adams (christopheradams) wrote :

The tasks list still has this problem. If you are logged out and click Start on one of the tasks, the sign-in page is loaded into the profile_container div.

Revision history for this message
Christopher Adams (christopheradams) wrote :

Where is the session length set? It's way to short for PPL, by a factor of 100 to 1000.

Revision history for this message
Bassel Safadi (bassel) wrote :

it's set in config.php
$config["session_timeout"] = 7200;
this value is in milliseconds you can change it to much higher number

Revision history for this message
Christopher Adams (christopheradams) wrote :

What about forcing a sign out after the timeout is reached, redirect to the sign in page?

Revision history for this message
Christopher Adams (christopheradams) wrote :

Brad we should take a look at some lower level widgets and ask, does this really need a redirect rule or is no output sufficient if the session has expired.

Changed in ppl:
importance: Critical → High
Revision history for this message
Christopher Adams (christopheradams) wrote :

Another current behavior of the Dashboard people list:

1) An owner is logged in and viewing the dashboard. The People list displays his or her contacts.

2) The owner's session expires.

3) The owner tries to paginate the People list using the Next or Previous buttons.

WHAT ACTUALLY HAPPENS:

* The People list will load the publicly available contents of the People list which is a list of Public Profiles.

WHAT SHOULD HAPPEN

* The Owner should be redirected to the sign-in page.

Changed in ppl:
status: Confirmed → In Progress
Revision history for this message
Brad Phillips (brad-bradphillips) wrote :

I have no idea how to fix this. It seems that the globalajaxify stuff that makes the links inside the dashboard more attractive by refreshing widgets is also preventing the outermost dashboard_container widget from recognizing that a link has been clicked by a user that isn't authorized.

As a temporary fix, I've tried to fight jquery with jquery by adding some rules to the sign-in widget that check to see if the widget has been loaded within a dashboard element (either the 'view-details' 2nd column or the 'dummy_search_results_container' in the first column). Depending on which widget it has been loaded in, it will remove all of the dashboard elements that and add classes that style it in the same way as the sign_in page.

The result is basically the /dashboard page changing to appear as the /users/sign_in page, if a user's session has timed out & they try interacting on the page.

So, the scenarios that are now fixed include:

1. Clicking on a task item or a contact after a session has expired
2. Clicking the pagination links below the people-list after a session has expired.

The new javascript doesn't affect the regular users/sign-in page because of the conditionals that are in place. Please try this & let me know what you all think.

Revision history for this message
Brad Phillips (brad-bradphillips) wrote :

Actually, the 3rd scenario where user's try & perform a contact search & delete the search is fixed as well. As soon as a query is deleted, the jquery kicks in & turns the /dashboard into the sign-in page.

Revision history for this message
Christopher Adams (christopheradams) wrote :

This kind of works, but there's as yet to style to the sign-up page which appears on the dashboard. Also, since the endpoint is no longer users/sign_in, it would seem the browser doesn't pre-fill your username or remember your password (at least on my system).

Ideally we still want to redirect to users/sign_in.

Does anyone else have proposals?

Revision history for this message
Brad Phillips (brad-bradphillips) wrote :

Right, so I was thinking about this some more, and my jquery instruction that checks to see if the sign_in widget is loaded within other widgets is a good start. Instead of removing other elements on the page, why don't I just refresh the page?

So, the code has been cut by 75% by replacing all the .remove() & .addClass() instructions with one instance of:

location.reload();

Refreshing the page causes the dashboard_container widget to send the user back to the /users/sign_in page, so it's no longer faking the page.

Christopher, can you confirm & mark this as fixed, if you think the solution is enough?

Changed in ppl:
milestone: 0.3 → 0.35
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.