Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: fl0pp on April 08, 2011, 02:20:44 PM

Title: Autologin issue
Post by: fl0pp on April 08, 2011, 02:20:44 PM
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;
  }

}
?>
Title: Autologin issue
Post by: rosali on April 11, 2011, 12:02:02 AM
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)
Title: Autologin issue
Post by: rosali on April 11, 2011, 12:02:17 AM
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)