Hello,
I'm using RC 0.7 but i will a login script in PHP. I'm using the following code but it doesn't work:
Form:
<form name="webmail" action="http://www.mywebsite.nl/webmail/index.php" method="post">
<input name="_action" value="login" type="hidden" />
<input name="_task" value="login" type="hidden" />
<input name="_timezone" id="rcmlogintz" value="_default_" type="hidden" />
<input name="ajax" value="1" type="hidden" />
User <input name="_user" type="text" value="my@mail.com"/>
Pass <input name="_pass" type="password" value="my_password" />
<input type="submit">
</form>
And i have activate the auto_logon script in the main.inc, and this is the code of the autologon.php
:
class autologon extends rcube_plugin
{
public $task = 'login';
function init()
{
$this->add_hook('startup', array($this, 'startup'));
$this->add_hook('authenticate', array($this, 'authenticate'));
}
function startup($args)
{
$rcmail = rcmail::get_instance();
if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']))
$args['action'] = 'login';
return $args;
}
function authenticate($args)
{
if (!empty($_GET['_autologin'])) {
$args['user'] = $_GET['user'];
$args['pass'] = $_GET['pass'];
$args['valid'] = true;
$args['cookiecheck'] = false;
}
return $args;
}
}
The page give the following result: "Invalid request! No data was saved.".