Hi guys, anyone know how to do external login on IPS 4.4 version?
Code below is working on IPS4.2 btw .. question is how to do it on newest ips version.
require_once(dirname(__FILE__).'/../forums/init.php');
$IPSLogin = new \IPS\Login\Internal;
$IPSLogin->init();
try {
$member = $IPSLogin->authenticate(array('auth' => $_POST['username'], 'password' => $_POST['password']));
if ($member) {
$expire = new \IPS\DateTime;
$expire->add( new \DateInterval( 'P7D' ) );
\IPS\Request::i()->setCookie( 'member_id', $member->member_id, $expire );
\IPS\Request::i()->setCookie( 'pass_hash', $member->member_login_key, $expire );
\IPS\Request::i()->setCookie( 'hasJS', true, $expire );
print '<html><head><meta http-equiv="refresh" content="0;URL=\''.$prev_url.'\'"></head></html>';
}
} catch (Exception $e) {
blahblah
}