This is file which is use to login on joomla site.
// a super-stripped down 2-leg oauth server/client example
function getLogin($userid, $psswrd) {
$app = JFactory::getApplication();
jimport('joomla.user.authentication');
jimport('joomla.session.session');
$auth = &JAuthentication::getInstance();
$session = &JFactory::getSession();
$session->set('name', "value");
$ssn_name = $session->get('name');
$sessionDetails = array(
'State' => $session->getState(),
'Expire' => session->getExpire(),
'Token' => $session->getToken(),
'FormToken' => $session->getFormToken(),
'Name' => $session->getName(),
'Id' => $session->getId(),
'getStores' => $session->getStores(),
'isNew' => $session->isNew());
$username = $userid;
$password = $psswrd;
$credentials = array(
'username' => $username,
'password' => $password);
$options = array();
$response = $auth->authenticate($credentials, $options);
if ($response->status == JAUTHENTICATE_STATUS_SUCCESS) {
$response->status = true;
$sessionDetails['loginStatus'] = $loginStatus = $app->login($credentials, $options);
return $sessionDetails;
}
else {
$response->status = false;
return 'testFalse';
}
}
Now we are calling this using localhost by
$client = new nusoap_client("http://domain-name/site-name/nusoap/remoteLogin.php");
$error = $client->getError();
if ($error) {
echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
}
$result = $client->call("getLogin", array(
"userid" => "admin",
"password" => "test"));
After this session is created at above project and update it in database with new entry. But still not login on site. Can anyone help me.
Thanks