Access denied exception using read newsletter online
- Craig
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 16
- Thank you received: 2
4 months 2 weeks ago - 4 months 2 weeks ago #1
by Craig
Access denied exception using read newsletter online was created by Craig
After moving from 3.4.3105 to 4.0.3226 I have found that use of the {link:NEWSLETTER}Read this message online{/link} requires you to be logged in before clicking the link. If you are not logged in you get a PHP exception "Access Denied". This occurs when the parameter "newsletter_list_requires_menu_item" is set.
I was a slightly concerned that in 3.4.3105 you could read the newsletter online if you were in possession of the obscure link without being logged in, so 4.0.3226 is better from a security point of view. But what would be even better is a redirect to login rather than throwing an "Access Denied" exception.
The Access Denied" exception is thrown here:
~/components/com_nspro/src/View/Newsletterview/HtmlView.php (36)
This is very low priority for me as I have removed the "read online" link from the templates we are using so the problem is avoided.
I am waiting for a few more components to be J!6 ready before I can start testing on J!6. Many thanks for all the great support.
My environment is
I was a slightly concerned that in 3.4.3105 you could read the newsletter online if you were in possession of the obscure link without being logged in, so 4.0.3226 is better from a security point of view. But what would be even better is a redirect to login rather than throwing an "Access Denied" exception.
The Access Denied" exception is thrown here:
~/components/com_nspro/src/View/Newsletterview/HtmlView.php (36)
This is very low priority for me as I have removed the "read online" link from the templates we are using so the problem is avoided.
I am waiting for a few more components to be J!6 ready before I can start testing on J!6. Many thanks for all the great support.
My environment is
- Joomla: 5.4.2
- NSPro; 4.0.3226
- PHP: 8.4.18
Last edit: 4 months 2 weeks ago by Craig.
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
4 months 2 weeks ago #2
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Access denied exception using read newsletter online
Hello Craig and thank you for posting all this information. It is very valuable.
As you correctly pointed out, this error occurs when the "newsletter_list_requires_menu_item" option is set to true.
So, I guess that what you're describing is that if this option is on, and the Newsletter list menu item is only accessible to Registered users, the View newsletter link doesn't fail gracefully.
Would you prefer it to detect if a menu item exists for logged-in users and redirect to the login page instead?
Do you want your newsletter list to only be accessible to registered users?
As you correctly pointed out, this error occurs when the "newsletter_list_requires_menu_item" option is set to true.
So, I guess that what you're describing is that if this option is on, and the Newsletter list menu item is only accessible to Registered users, the View newsletter link doesn't fail gracefully.
Would you prefer it to detect if a menu item exists for logged-in users and redirect to the login page instead?
Do you want your newsletter list to only be accessible to registered users?
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Craig
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 16
- Thank you received: 2
4 months 2 weeks ago #3
by Craig
Replied by Craig on topic Access denied exception using read newsletter online
Hi Christopher, So our use case is a fairly simple one, we just have one mailing list that we use your "User Integration" plugin to keep the subscribers in synch with all registered users. We have a menu item that can only be accessed by registered users that holds an NSPro "Newsletter list" where registered users can see all newsletters sent out. I included the "read this message online" link initially, which I think I copied from one of your templates, but on reflection I will replace this with a "Newsletter archive" link which I will point to the "Newsletter List" menu item directly and let Joomla force the login and access control.
In terms of the best approach for {link:NEWSLETTER} accessing a single newsletter, in our case forcing a registered user login would be enough, but I cannot think what would be the best approach for more complex situations with multiple mailing lists with differing access requirements. So leaving as is is ok for us, we will avoid using it.
In terms of the best approach for {link:NEWSLETTER} accessing a single newsletter, in our case forcing a registered user login would be enough, but I cannot think what would be the best approach for more complex situations with multiple mailing lists with differing access requirements. So leaving as is is ok for us, we will avoid using it.
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
4 months 1 week ago #4
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Access denied exception using read newsletter online
Thank you for clarifying, Craig.
A simple solution that I can think of would be to add a global option to select the newsletter list menu item.
That would link newsletters during sending and not try to detect the menu item upon visiting - because that's where the system fails to find the menu item now.
What do you think?
If you prefer to use the newsletter list link directly, then we can leave it as is and perhaps analyze the expected behavior if it comes up again from another person's standpoint.
Thanks again!
A simple solution that I can think of would be to add a global option to select the newsletter list menu item.
That would link newsletters during sending and not try to detect the menu item upon visiting - because that's where the system fails to find the menu item now.
What do you think?
If you prefer to use the newsletter list link directly, then we can leave it as is and perhaps analyze the expected behavior if it comes up again from another person's standpoint.
Thanks again!
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
Moderators: Christopher Mavros