Author Topic: How to set remember_me plugin to be unchecked by default  (Read 10300 times)

Offline mattfox27

  • Jr. Member
  • **
  • Posts: 53
How to set remember_me plugin to be unchecked by default
« on: September 21, 2010, 01:44:05 AM »
I have the remember me plugin and i would like it to be unchecked by default.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
How to set remember_me plugin to be unchecked by default
« Reply #1 on: September 21, 2010, 06:24:17 AM »
It is unchecked by default.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline mattfox27

  • Jr. Member
  • **
  • Posts: 53
How to set remember_me plugin to be unchecked by default
« Reply #2 on: September 21, 2010, 07:01:26 PM »
I downloaded it from the RC plugins page...its just the PHP file at the bottom Right?
 
I put it in its directory but everytime i go to it its checked
 
Is there a newer one? Or a better place to get it? I just reinstalled it fresh and it comes up checked.
 
Heres part of the code i have and it says checked=checked value=1...If that means anything. I tried putting "checked=unchecked" and that did not work...wierd
 
Code: [Select]
function rememberme_loginform($before)
{
$b = $before['content'];
$b = str_ireplace ('</tbody>',
'<td class=&quot;title[B]&quot;><label for=&quot;rcmloginpwd&quot;>Remember me</label></td><td><input name=&quot;_rememberme&quot; value=&quot;1&quot; checked=&quot;checked&quot; type=&quot;checkbox&quot;/></td>[/B]
</tbody>',$b);
$before['content']=$b;;
return ($before);

Heres the whole code that I have...Is this wrong?   ---> Remember_me.php

Code: [Select]
class remember_me extends rcube_plugin
{
private $key = 'Some random data';
function init()
{
$this->add_hook('template_object_loginform', array($this,'rememberme_loginform'));
$this->add_hook('startup', array($this, 'startup'));
$this->add_hook('authenticate', array($this, 'authenticate'));
$this->add_hook('login_after', array($this, 'login_after'));
$this->add_hook('login_failed', array($this, 'login_failed'));
}
function rememberme_loginform($before)
{
$b = $before['content'];
$b = str_ireplace ('',
'
',$b);
$before['content']=$b;;
return ($before);
}
function startup($args)
{
if ($args['task'] == 'mail' && empty($args['action']) && empty($_SESSION['user_id'])
&& !empty($_COOKIE['rememberme_user']) && !empty($_COOKIE['rememberme_pass']) )
$args['action'] = 'login';
 
if (($args['task'] == 'mail') && ($args['action'] == 'logout')) {$this->login_failed();};
return $args;
}
function authenticate($args)
{
if ( !empty($_COOKIE['rememberme_user']) && !empty($_COOKIE['rememberme_pass']))
{
$args['user']= $this->decode($_COOKIE['rememberme_user']);
$args['pass']= $this->decode($_COOKIE['rememberme_pass']);
#Update cookie time
setcookie ('rememberme_user',$this->encode($args['_user']),time()+60*60*24*356);
setcookie ('rememberme_pass',$this->encode($args['_pass']),time()+60*60*24*356);
};
return $args;
}
 
function login_after($args)
{
if (($_POST['_rememberme'] == 1) && !empty($_POST['_user']) && !empty($_POST['_pass']) )
{
setcookie ('rememberme_user',$this->encode($_POST['_user']),time()+60*60*24*356);
setcookie ('rememberme_pass',$this->encode($_POST['_pass']),time()+60*60*24*356);
};
}
function login_failed($args)
{
setcookie ('rememberme_user','',time()-3600);
setcookie ('rememberme_pass','',time()-3600);
}
private function encode ($a)
{
return base64_encode (mcrypt_encrypt (MCRYPT_DES,$this->key,$a,MCRYPT_MODE_ECB));
}
private function decode ($a)
{
return trim (mcrypt_decrypt (MCRYPT_DES,$this->key,base64_decode($a),MCRYPT_MODE_ECB),"\0");
}
 
};
 
 
« Last Edit: September 21, 2010, 07:32:15 PM by mattfox27 »

Offline mattfox27

  • Jr. Member
  • **
  • Posts: 53
How to set remember_me plugin to be unchecked by default
« Reply #3 on: September 21, 2010, 08:13:26 PM »
Ok i got the remember_me plugin to work...Im very sorry im new to RC and i did not know that there was a another repository you download that has those plugins included i was just downloading off the RC webpage.  I get it now.  

The plugin repository is a little confusing if your new.  Thank You

Offline K9Marc

  • Newbie
  • *
  • Posts: 7
How to set remember_me plugin to be unchecked by default
« Reply #4 on: September 21, 2010, 08:50:34 PM »
Rosali,

Quick question, on your website with the RC login, does your site use all the plugins in your pack?

You have a nice looking set up and I would like to make mine look like what you have.

Thanks

Marc

Offline mattfox27

  • Jr. Member
  • **
  • Posts: 53
How to set remember_me plugin to be unchecked by default
« Reply #5 on: September 21, 2010, 10:04:31 PM »
So i got it setup but i had a question...When i login and do not select to remember me, when i log out it asks me if i want to save the cookie.  Should it do that if i do not select remember me when i log in?  Is it possible to change it so when you do not select remember me on log in, when you log off it just goes back to the login page.

Thanks

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
How to set remember_me plugin to be unchecked by default
« Reply #6 on: September 22, 2010, 01:38:52 AM »
@ Marc: yes, I use all bundled plugins (some of them require hmailserver)

@mattfox27: This box is only shown if a cookie is present. Maybe in your case there is own from a prior session.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline mattfox27

  • Jr. Member
  • **
  • Posts: 53
How to set remember_me plugin to be unchecked by default
« Reply #7 on: September 22, 2010, 06:19:24 PM »
Ya its wierd even if i clear my cookies the remember me still presents me with a delete cookie upon exit.  Also when you press delete cookie is it supposed to redirect you to login page?   If not is there a way to do that?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
How to set remember_me plugin to be unchecked by default
« Reply #8 on: September 23, 2010, 01:32:14 AM »
Yes it is supposed to redirect to login page. Could you give me remote access to your server? PM'me details. Otherwise I can't help you because it works for me.
« Last Edit: September 26, 2010, 07:52:18 AM by rosali »
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline mattfox27

  • Jr. Member
  • **
  • Posts: 53
How to set remember_me plugin to be unchecked by default
« Reply #9 on: September 24, 2010, 04:43:36 PM »
I got it to work...it was a cookie problem on my end.  I started by using the wrong code and it put a bad cookie in my browser...Thank you for the help...Very much appreciated

Offline sunnydt

  • Jr. Member
  • **
  • Posts: 56
remember me plugin
« Reply #10 on: January 14, 2011, 10:01:37 AM »
Hi, I had the remember me plugin working a while back and now it isnt working anymore for some reason. I cannot figure it out. Can someone help me please?

It is installed and I have this:

// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('password', 'settings', 'sendmessage', 'checked_identities', 'http_authentication', 'markasjunk', 'markasjunk2', 'savepassword', 'accounts', 'remember_me', 'sound_notifier');
« Last Edit: January 14, 2011, 10:04:03 AM by sunnydt »

Offline Vlad

  • Jr. Member
  • **
  • Posts: 12
How to set remember_me plugin to be unchecked by default
« Reply #11 on: January 14, 2011, 10:43:51 AM »
Quote from: sunnydt;32431
Hi, I had the remember me plugin working a while back and now it isnt working anymore for some reason. I cannot figure it out. Can someone help me please?

It is installed and I have this:

// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('password', 'settings', 'sendmessage', 'checked_identities', 'http_authentication', 'markasjunk', 'markasjunk2', 'savepassword', 'accounts', 'remember_me', 'sound_notifier');


What are your timezone settings in PHP? I had similar problem with remember_me stopped working, due to a bug with UTC+0 timezone. It was fixed in the latest release today.

Offline sunnydt

  • Jr. Member
  • **
  • Posts: 56
How to set remember_me plugin to be unchecked by default
« Reply #12 on: January 14, 2011, 11:31:46 AM »
Timezone Database    internal
Default timezone    America/Denver
where is the new release please?

Offline sunnydt

  • Jr. Member
  • **
  • Posts: 56
How to set remember_me plugin to be unchecked by default
« Reply #13 on: January 14, 2011, 12:52:08 PM »
It seems to be working now. I updated the remember_me plugin. But I have a new issue now. I have installed the groupvise skin and everything is working except for folders. I get a 5101 error when I click the folders option. It says the service is currently unavailable. Is there a fix for this?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
How to set remember_me plugin to be unchecked by default
« Reply #14 on: January 15, 2011, 12:51:46 AM »
Which Roundcube version? Which plugin version?

Did you update to Roundcube 5.0 stable? Maybe it is related to a Roundcube bug:

#1487686 (Logging in redirects to login form) ? Roundcube Webmail
Regards,
Rosali
__________________
MyRoundcube Project (commercial)