Roundcube Community Forum

 

Autologin issue

Started by fl0pp, April 08, 2011, 02:20:44 PM

Previous topic - Next topic

fl0pp

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

<?php 

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;
  }

}
?> 

rosali

Since Roundcube 0.5.1 you have to return ...
  $args['valid'] = true;
... in the authenticate hook.

See API documentation: Plugin_Hooks ? Roundcube Webmail
Regards,
Rosali

rosali

Since Roundcube 0.5.1 you have to return ...

$args['valid'] = true;

... in the authenticate hook.

See API documentation: Plugin_Hooks ? Roundcube Webmail
Regards,
Rosali