Author Topic: Autologin issue  (Read 5295 times)

Offline fl0pp

  • Newbie
  • *
  • Posts: 1
Autologin issue
« 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

<?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'] = 'e@mail.com';
          
$args['pass'] = '***';
        }
    return 
$args;
  }

}
?> 

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Autologin issue
« Reply #1 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
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Autologin issue
« Reply #2 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
Regards,
Rosali
__________________
MyRoundcube Project (commercial)