Roundcube Community Forum

 

demologin

Started by rmcapovilla, May 23, 2011, 03:01:55 PM

Previous topic - Next topic

rmcapovilla

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');

rosali

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.
Regards,
Rosali

rmcapovilla

Using only taskbar and demologin still the same problem

rosali

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.
Regards,
Rosali

rmcapovilla

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.

rosali

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.
Regards,
Rosali

tenantfile

I need some directions on where should I start looking?
by Property Management Software

rmcapovilla

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'
  
);

rosali

Thanks for debugging this.
Regards,
Rosali