authentication.php does not trigger onUserAuthorisation

The support for Joomla 2.5 ended on December 31, 2014. Possible bugs in Joomla 2.5 will not be patched anymore. This forum has been closed. Please update your website to Joomla 3.x

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
mdobrinic
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jun 20, 2012 9:35 am

authentication.php does not trigger onUserAuthorisation

Post by mdobrinic » Wed Jun 20, 2012 9:41 am

In file
libraries/joomla/user/authentication.php
the public static function authorise() does not trigger onUserAuthorisation for user,authentication plugins.
This is because the plugins are not imported correctly.

Current code:

Code: Select all

	public static function authorise($response, $options = array())
	{
		// Get plugins in case they haven't been loaded already
		JPluginHelper::getPlugin('user');
		JPluginHelper::getPlugin(‘authentication');
		$dispatcher = JDispatcher::getInstance(); 
		$results = $dispatcher->trigger('onUserAuthorisation', array($response, $options));
		return $results;
	}
New code should be JPluginHelper::importPlugin() instead of getPlugin(), so the new function should look like this:

Code: Select all

	public static function authorise($response, $options = array())
	{
		// Get plugins in case they haven't been loaded already
		JPluginHelper::importPlugin('user');
		JPluginHelper::importPlugin('authentication');
		$dispatcher = JDispatcher::getInstance(); 
		$results = $dispatcher->trigger('onUserAuthorisation', array($response, $options));
		return $results;
	}
Can you please update this in the trunk?

Thanks!

Mark Dobrinic

oc666
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 215
Joined: Wed Oct 10, 2007 9:46 am
Location: Israel, TA
Contact:

Re: authentication.php does not trigger onUserAuthorisation

Post by oc666 » Mon Nov 26, 2012 2:41 pm

Hey Mark
I've just updated the events docs: http://docs.joomla.org/Plugin/Events/User

Can you please open bug tracker and give example to your code change, for helping to test it before commit to trunk? You can do it on the bug tracker for 2.5: http://joomlacode.org/gf/project/joomla ... r_id=11410

Is it reproduce on 3.0.x also?

Thanks
http://www.embad.com - new way to insert ads to your website


Locked

Return to “Joomla! 2.5 Bug Reporting”