php - Log into Joomla 3 without a Password -
does have insight how accomplished?
i figure may possible mess session unless there built in function used this.
if need more information let me know, happy provide it.
thanks!
the following code snippet should load user based on id database , log them in visitor making request. not require password. being said, hope authenticating in way. (and have tested on front-end of site.)
$db = jfactory::getdbo(); $q = "select * `#__users` id = ".$id; $user = $db->setquery($q)->loadassoc(); jpluginhelper::importplugin( 'user' ); $dispatcher = jdispatcher::getinstance(); // initiate log in $options = array('action' => 'core.login.site', 'remember' => false); $results = $dispatcher->trigger('onuserlogin', array($user, $options));
Comments
Post a Comment