I am attempting to make an authentication plugin. JUser::getInstance()
takes one input, and it is supposed to be the id. Is there any way to get an instance of a User using some other indentifier? such as username, email etc.
views:
59answers:
1
+1
A:
Probably there isnt any such method. But yes if you are sure that username or email are unique then you can modify your file user.php in libraries/joomla/user/ and add a method there.
getInstanceByEmail($email) {
$query = "select id from jos_users where email=".email;
// use the code to get the id;
return getInstance($id);
} // this is just a sample code of how it can be achieved,
sushil bharwani
2010-05-24 17:22:38
Thanks, I don't know why I didn't think of that >.>
Rixius
2010-05-24 17:28:46