Forums / Cotonti / Extensions / Flashchat Plugin Autologin

Trustmaster
#22862 2010-02-13 00:13
Passwords are still md5, the only thing you need to change is that there is no more $_SESSION['rsedition']. Use this code to get user id instead:
$site_id = 'ct' . substr(md5($cfg['mainurl']), 0, 10); // read $cfg['mainurl'] from config.php
if(!empty($_COOKIE[$site_id]) || !empty($_SESSION[$site_id]))
{
    $u = empty($_SESSION[$site_id]) ? base64_decode($_COOKIE[$site_id]) : base64_decode($_SESSION[$site_id]);
    $u = explode(':_:', $u);
    $u_id = (int) sed_import($u[0], 'D', 'INT');
    $u_passhash = sed_import($u[1], 'D', 'ALP');
    $this->user_id = $u_id;
}
This is not very correct, because the password should be checked if using cookie. I see, it's a mistake in Cotonti and user_id should be also stored in session to simplify integration with such scripts.
May the Source be with you!