I recently had an issue where my site was reporting You are not authorized to view this resource
when the user logged in.
It was really tricky to diagnose, because neither the site nor the back-end gave me any clues at all as to what resource it was that it was telling me I couldn't access.
There are a number of possible causes for this error. I'm aware that it is usually caused by access permissions, so I looked there first; scanning through all the articles, menus, modules, etc to find one with the wrong permissions. In the end, the cause was that the site owner had been playing in the plugins area, and had inadvertently disabled a user
plugin associated with one of the main components on the site. Re-enabling the plugin solved the problem.
But it would have saved me a good couple of hours of digging if Joomla had just told me that in the first place, or at least given me a bit of a clue.
Is there any way we could implement something that catches generic errors like this and writes a log entry with more useful details of the problem? Or even just provide an event hook for error messages so that they can be picked up by a third party logging system like LogMan?
Labels |
Added:
?
|
Category | ⇒ | Administration |
Category | Administration | ⇒ | Administration com_users |
Status | New | ⇒ | Discussion |
What about using sprintf and having a file location and line number output within it when in debug mode?
This PR #16814 could be related.
When we have an exception the by enabling debug we can already see where the exception is occuring
the problem is when some code "enqueues" and a no-access message, (see my examples above) and then it redirects, in such a case there is no easy way to find where the no-access thing has occured, especially when such code is inside a plugin
This sounds a really bad idea to me. Why? Well it might be useful when debugging a problem but it will also reveal what "security" is in place and specifically where. In addition it might be meaningful to a developer but its just useless garbage to a regular user.
@brianteeman - you mean the original idea is bad? I'm not looking to reveal anything to the end user or for anything to change for them. As you say, security messages are best left pretty generic. It is only the developer / site owner that needs this, so any additional info can be hidden behind debug mode, or something like that.
As long as its not revealed to the end user then thats fine
Status | Discussion | ⇒ | Information Required |
@Spudley is this still happening in the latest J3?
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-11 21:52:54 |
Closed_By | ⇒ | jwaisner |
Closed_By | jwaisner | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/18577
Since this cannot be reconfirmed at this time we will close this issue. However if this does appear to be a bug in current versions, please open a new item.
Yes it is annoying
When the message JERROR_ALERTNOAUTHOR is thrown by an exception,
but when, inside a plugin, the code is like this
or getting the error from the model ... inside a controller
then nothing tells you where exactly it occured, you can only estimate where