Author Topic: Roundcube external login  (Read 16101 times)

Offline Hermiod

  • Newbie
  • *
  • Posts: 5
Roundcube external login
« on: February 15, 2012, 03:24:03 PM »
I have a forum, I am trying to make it in such a way that users only have to login once.

There is a autologin plugin, but it does not work with the new versions of Round Cube.

Is there some kind of integration I can use or some kind of manual way I can login users?

I tried looking at the roundcube php files, but could not find how the cookies get set, if I knew that I could try to do it manually (probably not the best way, might miss some logging functions).

Online SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Roundcube external login
« Reply #1 on: February 16, 2012, 10:07:34 AM »
Take a look at the sample auto login plugin and adapted it to your needs autologon.php in trunk/plugins/autologon

Offline Hermiod

  • Newbie
  • *
  • Posts: 5
Roundcube external login
« Reply #2 on: February 16, 2012, 05:37:43 PM »
Quote from: skaero;38253
Take a look at the sample auto login plugin and adapted it to your needs autologon.php in trunk/plugins/autologon

I have activated that plugin in main.inc, how am I supposed to access that class?

I tried creating a php file in the main webmail folder, then added the start of index.php:
require_once 'program/include/iniset.php';
$RCMAIL = rcmail::get_instance();
$startup = $RCMAIL->plugins->exec_hook('startup', array('task' => $RCMAIL->task, 'action' => $RCMAIL->action));
$RCMAIL->set_task($startup['task']);
$RCMAIL->action = $startup['action'];

then created a object of the autologon.php class:
$login_attempt = new autologon();

But it fails, keeps saying:
Warning: Missing argument 1 for rcube_plugin::__construct(), called in /.../webmail/autologon.php on line 55 and defined in /.../webmail/program/include/rcube_plugin.php on line 74

After that I thought to then executed the init, startup and authenticate methods on the created object.

I did edit the autologon.php file for now to allow external access and only allow one specific account to be used(user/pw).

What am I doing wrong?
« Last Edit: February 16, 2012, 05:40:27 PM by Hermiod »

Online SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Roundcube external login
« Reply #3 on: February 16, 2012, 07:11:11 PM »
All you need to do is add "autologon" to the plugins array in the /config/main.inc.php for full details read: Doc_Plugins

Offline Hermiod

  • Newbie
  • *
  • Posts: 5
Roundcube external login
« Reply #4 on: March 01, 2012, 11:05:06 AM »
I already did that:

$rcmail_config['plugins'] = array('autologon');

Online SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Roundcube external login
« Reply #5 on: March 01, 2012, 03:36:02 PM »
What do you have in you autologon.php file?

Offline Hermiod

  • Newbie
  • *
  • Posts: 5
Roundcube external login
« Reply #6 on: March 02, 2012, 09:44:51 PM »
Quote from: skaero;38316
What do you have in you autologon.php file?

I have the default file with two modifications:
1) Manually set the username and password in function authenticate() [for testing purposes]
2) Modified the code to not check if is_localhost()
« Last Edit: March 02, 2012, 10:04:37 PM by Hermiod »

Offline teebsd

  • Newbie
  • *
  • Posts: 5
Re: Roundcube external login
« Reply #7 on: January 24, 2014, 09:03:57 PM »
I finally made that. Check it out in my gist. https://gist.github.com/TeeBSD/8610622