Author Topic: autologin problem  (Read 5919 times)

Offline acarlomagno

  • Jr. Member
  • **
  • Posts: 10
autologin problem
« on: January 26, 2010, 06:44:37 AM »
Hi all,

I have tried and simplified the autologon plugin... but I have this problem.

When RC starts ... tried to open the inbox ... but after few seconds .. I received the cookie browser error.

If I use RC without the plugin .. and enter the user+pass+host manually ... work fine.

Where I wrong ?

This is the browser error:

This page is not redirecting properly
Firefox has detected that the server is redirecting the request for this page so that it can never be completed.
* This problem is often caused by the blocking or rejection of cookies.



this is the autologon code:

class autologon extends rcube_plugin
{

  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

      $args['action'] = 'login';
     
     
    return $args;
  }

  function authenticate($args)
  {
 
      $args['user'] = 'myusername';
      $args['pass'] = 'mypassword';
      $args['host'] = 'hostname';

 
    return $args;
  }

}

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
autologin problem
« Reply #1 on: January 26, 2010, 07:07:50 AM »
looks like you simplified the autologin plugin a little to much. the startup hook is called everytime roundcube loads (that is every time a page loads etc) and everytime you are overriding the action and setting it to login. you need to put at least this back in your startup function:
Code: [Select]
if (empty($args['action']) && empty($_SESSION['user_id']))
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline acarlomagno

  • Jr. Member
  • **
  • Posts: 10
autologin problem
« Reply #2 on: January 26, 2010, 08:12:01 AM »
great!, thanks...

 I commented that line. :D

Antonello