Author Topic: demologin  (Read 7266 times)

Offline rmcapovilla

  • Newbie
  • *
  • Posts: 4
demologin
« 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'] = "demo@mydomain.com";

or
$rcmail_config['demo_user_account'] = "demo%s@mydomain.com";

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

Offline rosali

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

Offline rmcapovilla

  • Newbie
  • *
  • Posts: 4
demologin
« Reply #2 on: May 23, 2011, 03:31:08 PM »
Using only taskbar and demologin still the same problem

Offline rosali

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

Offline rmcapovilla

  • Newbie
  • *
  • Posts: 4
demologin
« Reply #4 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.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
demologin
« Reply #5 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 demo@yourdomain.tld. 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 demo0@yourdomain.tld 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
__________________
MyRoundcube Project (commercial)

tenantfile

  • Guest
Property Management Software
« Reply #6 on: May 24, 2011, 06:11:56 AM »
I need some directions on where should I start looking?
by Property Management Software

Offline rmcapovilla

  • Newbie
  • *
  • Posts: 4
demologin
« Reply #7 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'
  
);

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
demologin
« Reply #8 on: May 26, 2011, 10:52:47 AM »
Thanks for debugging this.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)