class myautologin 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['_user']) && $this->is_localhost()) {
$args['user'] = $_GET['_user'];
$args['pass'] = $_GET['_pass'];
$args['valid'] = true;
return $args;
}
}
}
Where are errors?
thks