Problem/Motivation
When an unauthorized user (e.g. anonymous user) requests a page they don't have access to (e.g. /admin/content), Drupal redirects them to the login screen. When they successfully log in, the originally requested page is loaded.
Moderation Dashboard overrides this, and loads the dashboard on every login.
Proposed resolution
Only load the dashboard if the user logged in without requesting another page.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3005859-10.patch | 3.08 KB | bendeguz.csirmaz |
| #8 | interdiff-3005859-5-8.txt | 915 bytes | bendeguz.csirmaz |
| #8 | 3005859-8.patch | 2.94 KB | bendeguz.csirmaz |
| #5 | interdiff-3005859-2-5.txt | 1.47 KB | bendeguz.csirmaz |
| #5 | 3005859-5.patch | 2.55 KB | bendeguz.csirmaz |
Comments
Comment #2
bendeguz.csirmaz commentedComment #4
bendeguz.csirmaz commented$redirect_url = $request->server->get('REDIRECT_URL');It failed of course, the
'REDIRECT_URL'can't determine whether the user is currently logging in to the dashboard or to another page.I'll try solving this by parsing the
destinationparameter from the response object.Comment #5
bendeguz.csirmaz commentedComment #6
samuel.mortensonRedirectResponseextendsResponseso I think you should be able to get to the query with$response->query, mind looking to see if these lines can be simplified?I'd like a positive case test as well, if you don't mind.
Comment #7
samuel.mortensonComment #8
bendeguz.csirmaz commentedResponsedoesn't have a query property, onlyRequestdoes, I think this is the simplest I can do.Comment #10
bendeguz.csirmaz commentedRerolled.
Comment #11
phenaproximaThis looks great.
Comment #13
samuel.mortensonThanks all!