Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: rmcapovilla on May 23, 2011, 03:01:55 PM

Title: demologin
Post by: rmcapovilla on May 23, 2011, 03:01:55 PM
Hi guys,

I'm trying to make the demologin work but I can't figure out why it is not working.

It just reloads the login screen and nothing happens, nothing in the roundcube error log or in the maillog (both are in the same machine), every other plugin seems to be working.

Any ideas how to debug this?

I've tryed to set

$rcmail_config['demo_user_account'] = "[email protected]";

or
$rcmail_config['demo_user_account'] = "demo%[email protected]";

It doesn't try to login on the imap, it just reloads the login screen.

And thats my plugin array:

// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('dovecot_impersonate','virtuser_file','automatic_addressbook','google_contacts','managesieve','password','show_additional_headers','drag_upload','taskbar','forgot_password','jqueryui','markasjunk2','calendar','globaladdressbook','demologin','sticky_notes');
Title: demologin
Post by: rosali on May 23, 2011, 03:18:24 PM
I'm quite sure that's a problem in conjunction with 'virtuser_file' plugin. I have coded the plugin but never tested it with a virtual user mapping.
Title: demologin
Post by: rmcapovilla on May 23, 2011, 03:31:08 PM
Using only taskbar and demologin still the same problem
Title: demologin
Post by: rosali on May 23, 2011, 03:37:06 PM
Sorry about that. I have coded the plugin to do the job on my Roundcube Demo Site and I just share the code.

It works well there. Regard the code as a starting point. I won't spend time to adjust the plugin for others.
Title: demologin
Post by: rmcapovilla on May 23, 2011, 03:41:12 PM
I understand, no problem but coud you just give me some directions on where should I start looking?

I think i can fix it, should be something with the virtualmin user style on my server, i had to modify the password plugin because of that too.
Title: demologin
Post by: rosali on May 23, 2011, 03:55:51 PM
I think there are enough comments in the code. I would start to debug it in the 'authenticate' method. Maybe it is a simple problem. Check if you have mapped the demo accounts correctly.

It will fire a login request for [email protected]. Then it checks if someone has already logged in into this demo account by a query to Roundcube's session database table. If so, it tries to login to [email protected] and so on.

The check if a the account is occupied could be the problem on your setup if the real username is different due to virtual user mapping.
Title: Property Management Software
Post by: tenantfile on May 24, 2011, 06:11:56 AM
I need some directions on where should I start looking?
by Property Management Software (http://www.tenantfile.com)
Title: demologin
Post by: rmcapovilla on May 26, 2011, 10:21:29 AM
Just for documentation pourposes I found the problem... it was in the taskbar plugin not in the demologin itself

plugins/taskbar/config/config.inc.php


$rcmail_config['login_taskbar_def'][] = array(
  'plugin' => 'demologin',
  'href' => '#',
  'target' => '_self',
  // notice: remember_me plugin is active
  'onclick' => 'try{document.forms.form._user.value = rcmail.env.demo_user;document.forms.form._rememberme.checked=\'\';document.forms.form.submit()}catch(e){document.location.href=\'./\'}',
  // notice: remember_me plugin is inactive
  //'onclick' => 'try{document.forms.form._user.value = rcmail.env.demo_user;document.forms.form.submit()}catch(e){}',
  'class' => 'demo',
  'innerHTML_locale' => 'demo',
  'innerHTML' => '%s',
  'img' => 'mail.png',
  'title_locale' => 'demologin'
  );



to this:

$rcmail_config['login_taskbar_def'][] = array(
  'plugin' => 'demologin',
  'href' => '#',
  'target' => '_self',
  // notice: remember_me plugin is active
  //'onclick' => 'try{document.forms.form._user.value = rcmail.env.demo_user;document.forms.form._rememberme.checked=\'\';document.forms.form.submit()}catch(e){document.location.href=\'./\'}',
  // notice: remember_me plugin is inactive
  'onclick' => 'try{document.forms.form._user.value = rcmail.env.demo_user;document.forms.form.submit()}catch(e){}',
  'class' => 'demo',
  'innerHTML_locale' => 'demo',
  'innerHTML' => '%s',
  'img' => 'mail.png',
  'title_locale' => 'demologin'
  );
Title: demologin
Post by: rosali on May 26, 2011, 10:52:47 AM
Thanks for debugging this.