User tests: Successful: Unsuccessful:
404 is for non existing file.
403 is for page that need authorization.
Thanks for coding this, Naoak! Also, to add to infograf's comments, some testing instructions would be useful.
For anyone interested, here's the tracker item on JoomlaCode:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=30373
This might help you:
ofer@ofer-Latitude-E6220:~/projects/joomla3$ grep -rin "JERROR_ALERTNOAUTHOR" * | grep -v language | grep -v 403 | grep raise
administrator/components/com_config/controller.php:57: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_content/content.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_admin/views/sysinfo/view.html.php:54: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_templates/templates.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_menus/menus.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_banners/banners.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_messages/messages.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_finder/finder.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_redirect/redirect.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_checkin/checkin.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_newsfeeds/newsfeeds.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_weblinks/weblinks.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/views/debuguser/view.html.php:37: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/views/debuggroup/view.html.php:37: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controller.php:66: JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/users.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controllers/level.php:56: JError::raiseError(500, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controllers/groups.php:48: JError::raiseError(500, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controllers/groups.php:66: JError::raiseError(500, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controllers/groups.php:84: JError::raiseError(500, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controllers/groups.php:102: JError::raiseError(500, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_users/controllers/groups.php:120: JError::raiseError(500, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_contact/contact.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_installer/installer.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_tags/tags.php:16: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_plugins/plugins.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_categories/categories.php:16: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_search/search.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_modules/modules.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_cache/cache.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
administrator/components/com_joomlaupdate/joomlaupdate.php:14: return JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
templates/beez3/error.php:209: $this->error = JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
templates/system/error.php:13: $this->error = JError::raiseWarning(404, JText::('JERRORALERTNOAUTHOR'));
These should just be enqueuing messages not raising warnings. The challenge is to send the correct number to the browser.
Let me throw in a thought here please....
I'm just experimenting in our JTracker thingy with custom Exceptions for 403, 404 and 500 events that can be thrown everywhere and are processed by specialized exception handlers to perform "some actions" like sending the correct status code and giving the possibility to write custom logs for those events.
As I said, it's just a thought ;)
Please create a tracker on joomlacode and explain why you propose this change.
also, there are many other places in Joomla where JERROR_ALERTNOAUTHOR is used, sometimes with a 404 sometimes with a 403. If this change is necessary, shall we not change all?