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
function rememberme_loginform($before)
{
$b = $before['content'];
$b = str_ireplace ('</tbody>',
'<td class="title[B]"><label for="rcmloginpwd">Remember me</label></td><td><input name="_rememberme" value="1" checked="checked" type="checkbox"/></td>[/B]
</tbody>',$b);
$before['content']=$b;;
return ($before);
Heres the whole code that I have...Is this wrong? ---> Remember_me.php
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");
}
};