denied content force login and redirect to the original page

Moderators: mandville, General Support Moderators

Locked
User avatar
dschafer
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Tue Jul 19, 2011 5:42 pm

denied content force login and redirect to the original page

Post by dschafer » Thu Sep 24, 2015 5:47 pm

I feel like I'm missing something.

I've read about restricting content via the ACL but I haven't seen word one about the recommended approach for reacting to denied content.

I have content that is denied to the public and sure enough, a non-logged in user is denied access. Unfortunately the user will just see a blank page.

What I'd like to have happen is the user presented with a login, then after the login the return to the originally requested page. I know I must be missing something. If someone could point me to the best approach to resolve this, I'd greatly appreciate it.

Thx.

User avatar
dschafer
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Tue Jul 19, 2011 5:42 pm

Re: denied content force login and redirect to the original

Post by dschafer » Fri Sep 25, 2015 9:41 pm

I've implemented a redirect to the login page in the com_content articles view. I used the return= technique to let the login page know where to go after logging in.

I understand why and how these mechanisms work. Given the elaborate apparatus Joomla has for ACL/Usergroups it still seems like hacking the core code wouldn't be the best choice. Does anyone have a more graceful approach?

User avatar
rcarey
Joomla! Explorer
Joomla! Explorer
Posts: 471
Joined: Sat Apr 25, 2009 9:20 pm
Location: Minnesota (USA)
Contact:

Re: denied content force login and redirect to the original

Post by rcarey » Tue Sep 29, 2015 2:52 pm

If you implemented your redirection in the view's template file, then that is not hacking the core.

Keep in mind the user's experience. If the user is taken immediately to a login page, that user might be confused as to why they see a login and not the content. If the user sees the blank content area except for a message that he/she needs to login to view this content, and then have a link to the login page, that might be a better user experience.

You might have accounted for this. Keep in mind that if it is possible that a user can be logged in yet still not have credential to access to the content, the code ought to distinguish between this scenario and the non-logged-in scenario - and produce the appropriate user experience for each scenario.
Randy Carey -- as of 2023 I'm mostly retired in web development, but still engaged with a few Joomla projects through
Careytech Studios http://careytech.com custom development for tailored or value-added web solutions


Locked

Return to “Access Control List (ACL) in Joomla! 2.5”