Hi Fanno,
The onUserAuthticate method is used as an event that triggers any installed plugins that use that event. What I believe you are seeing is that the User plugins enabled in your Joomla installation differ in what they are returning, if anything. You should see different results by disabling some of them and then authenticating with the site.
I can't tell you why some are returning something, and I don't believe what is returned is ever used. But, if you do see that core plugins are doing this, it would be good to investigate if they can be normalized.
Hope that helps.
Best,
Matt Thomas
@betweenbrain
http://matt-thomas.me/
http://betweenbrain.com/
https://github.com/betweenbrain
Sent from mobile. Please pardon any typos or brevity.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Fanno,
The onUserAuthticate method is used as an event that triggers any installed plugins that use that event. What I believe you are seeing is that the User plugins enabled in your Joomla installation differ in what they are returning, if anything. You should see different results by disabling some of them and then authenticating with the site.
I can't tell you why some are returning something, and I don't believe what is returned is ever used. But, if you do see that core plugins are doing this, it would be good to investigate if they can be normalized.
Hope that helps.
Best,
Matt Thomas
@betweenbrain
http://matt-thomas.me/
http://betweenbrain.com/
https://github.com/betweenbrainSent from mobile. Please pardon any typos or brevity.
On Jan 25, 2014 5:03 PM, "fanno" <fan...@gmail.com> wrote:
Hi everyone--What is correct? The onUserAuthenticate function is returning nothing .. then true ... then false and empty return;phpstorm is complaining, i realize it may not be an actual error. but as far as i can tell/understand returns are never used. so why is it used and why is it not consistent if it is to be used.(i am developer on a open source project where we have a auth plugin, where i am working on implementing the two factor login..)-Thanks
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
Thanks for the links, they helps allot. To answer your question as to why it isn't consistent, I would imagine that it has to do with the fact that different people have contributed code to that file over time and no one has corrected the inconsistencies that you have noticed.
In my opinion, I would prefer to return false, rather than void, as it is more clearly written code and easier for others to understand the intent.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsubscribe@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Joomla! General Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/joomla-dev-general/08MfD2V11Bc/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to joomla-dev-gene...@googlegroups.com.
regardless of how you look at it. i think that the phpDOC on onUserAuthenticate should match what is going on.
It may be that these are called from 3rd party extensions and there it may matter ;)
Am Montag, 27. Januar 2014 16:37:32 UTC+1 schrieb Sergio Manzi:On 2014-01-26 16:17, Bakual wrote:
> This is where the call is made:
> https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/user/authentication.php#L286
>
> As you see, the return value isn't processed. The only thing that
> matters is the "$response" object.
> So you can return whatever you want, it doesn't matter at all :-)
... then, if I'm not mistaken, all the code from line 178 to line 193 is
useless and could be replaced with a simple "return;"...
--
You received this message because you are subscribed to a topic in the Google Groups "Joomla! General Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/joomla-dev-general/08MfD2V11Bc/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to joomla-dev-general+unsub...@googlegroups.com.
To unsubscribe from this group and all of its topics, send an email to joomla-dev-gene...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Sergio,
That is a great idea. I think it would be very helpful if 3PD were to document their usage like this. Would adding a Docblock help here?
Best,
Matt Thomas
@betweenbrain
http://matt-thomas.me/
http://betweenbrain.com/
https://github.com/betweenbrain
Sent from mobile. Please pardon any typos or brevity.
Out of curiosity, do we know which 3d party extension uses this non-standard return codes? Also (and I *really* hope nobody will take this as a personal attack) I must say that I'm a bit surprised that a piece of code needed solely by a 3d party extension has its home in the Joomla! core.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
If this is the case this should be documented or one day someone could try to be smart and just say "pew!", replace it with a "return;" and cause a regression in some 3d party extension...
I mean, if this is really the case, it should be up to the 3d party extension developer who relies on this code to put at least a small comment in it or (even better) amend the docs so that they reflect the state of things, don't you agree?
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
Hi Sergio,
Thanks. I'd be happy to open an issue for you (and, yes, I too think this code is broken). Would you mind doing me the favor of writing a one or two line summary of it?
Best,
Matt Thomas
203.632.9322
http://betweenbrain.com/
Sent from mobile. Please pardon any typos or brevity.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
Not a problem. I'll open an issue and post the link here.
Best,
Matt Thomas
203.632.9322
http://betweenbrain.com/
Sent from mobile. Please pardon any typos or brevity.
As a personal note I would add that:
Sergio
P.S.: I'm also sending this in Bcc: to you and to Nicholas
// If authentication is successful break out of the loopif ($response->status === self::STATUS_SUCCESS){$app = JFactory::getApplication();$app->triggerEvent('onUserAfterAuthenticate', array($credentials, $options, &$response));...............if (empty($response->type)){$response->type = isset($plugin->_name) ? $plugin->_name : $plugin->name;}break;}Tho i guess it is poosible that this can cause other issue i am not thinking about at this point in time. issue could possible be that $credentials may not hold info that can be used inside onUserAfterAuthenticate to get the joomla use and that $response->email may properly be better way inside two factor onUserAfterAuthenticate to read the.-Thanks
Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.