Hi all,
I'm trying to make the following php code to work but it keeps me giving the same error: " Fatal error: Call to a member function isAuthenticated() on null in /web/htdocs/mysite.net/home/ow_core/auth.php on line 88"
Here's the code:
<?php
define('_OW_', true);
define('DS', DIRECTORY_SEPARATOR);
define('OW_DIR_ROOT', dirname(__FILE__) . DS);
require_once(OW_DIR_ROOT . 'ow_includes' . DS . 'init.php');
require_once(OW_DIR_ROOT . 'ow_system_plugins' . DS . 'base/classes/standard_auth.php');
require_once(OW_DIR_ROOT . 'ow_core' . DS . 'session.php');
require_once(OW_DIR_ROOT . 'ow_core' . DS . 'user.php');
OW::getSession()->start();
$username = 'test'; //forced username for test
$password = 'test'; //forced password for test
$result = OW::getUser()->authenticate(new BASE_CLASS_StandardAuth($username, $password));
if ( $result->isValid() )
{
if ( isset($data['remember']) )
{
$loginCookie = $this->userService->saveLoginCookie(OW::getUser()->getId());
setcookie('ow_login', $loginCookie->getCookie(), (time() + 86400 * 7), '/', null, null, true);
}
}
session_regenerate_id();
header('Location:https://mysite.net/')
?>
Thanks in advace.