I try to make autologin to my roundcube.
But I get "Invalid Request" when I enter https://mydomain.com/?_autologin=1&uid=dsassad&auth=jkhsdajk
Any idea why it won't login?
I use version 0.5.1
class ivologon 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();
// change action to login
if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']))
$args['action'] = 'login';
return $args;
}
function authenticate($args)
{
if (!empty($_GET['_autologin']) && !empty($_GET['uid']) && !empty($_GET['auth'])) {
$args['user'] = '
[email protected]';
$args['pass'] = '***';
}
return $args;
}
}
?>
Since Roundcube 0.5.1 you have to return ...
$args['valid'] = true;
... in the authenticate hook.
See API documentation: Plugin_Hooks ? Roundcube Webmail (http://trac.roundcube.net/wiki/Plugin_Hooks#authenticate)
Since Roundcube 0.5.1 you have to return ...
$args['valid'] = true;
... in the authenticate hook.
See API documentation: Plugin_Hooks ? Roundcube Webmail (http://trac.roundcube.net/wiki/Plugin_Hooks#authenticate)