Spotted this one on the features request topic, and knew I had it here..
courtesy of ihackstuff on the old forums
in login.php
find
// 2004-12-09 PFM: ADODB support.
and add below
$check = $HTTP_COOKIE_VARS["check"];
$password = $HTTP_COOKIE_VARS["iamhim"];
$username = $HTTP_COOKIE_VARS["username"];
if ($_POST['check'] == "true")
{
setcookie("check", "true", time()+60*60*24*30);
if ($_POST['username'] != "")
setcookie("username", $_POST['username'], time()+60*60*24*30);
if ($_POST['iamhim'] != "")
setcookie("iamhim", $_POST['iamhim'], time()+60*60*24*30);
}
further down find
// Check for user
if(!empty($user) && !empty($iamhim))
and add above
if(empty($user) && empty($iamhim) && !empty($username) && !empty($password))
{
$user = strtolower($username);
$iamhim = addslashes($password);
}
next find
<td align="right">Username: </td>
<td><input type="text" name="username" value="" size="15" style="font-family:verdana,helvetica,sans-serif; font-size:9px; color:#000;" /></td>
and replace with
<td align="right">Username: </td>
<td><input type="text" name="username" value="<?PHP if ($cfg['rememberme'] == "true") echo $username; ?>" size="15" style="font-family:verdana,helvetica,sans-serif; font-size:9px; color:#000;" /></td>
and a couple lines down replace
<td align="right">Password:</td>
<td><input type="password" name="iamhim" value="" size="15" style="font-family:verdana,helvetica,sans-serif; font-size:9px; color:#000" /></td>
</tr>
with
<td align="right">Password:</td>
<td><input type="password" name="iamhim" value="<?PHP if ($cfg['rememberme'] == "true") echo $password; ?>" size="15" style="font-family:verdana,helvetica,sans-serif; font-size:9px; color:#000" /></td>
</tr>
<?php
if ($cfg['rememberme'] == "true")
{
echo '
<tr>
<td align="right">Remember me:</td>
<td><input type="checkbox" name="check" value="true"'; if ($check == "true") echo " checked "; echo'size="15" style="font-family:verdana,helvetica,sans-serif; font-size:9px; color:#000" /></td>
</tr>';
}
?>
then in logout.php change
// do the SQL
$result = $db->Execute($sql);
showError($db, $sql);
}
to
// do the SQL
$result = $db->Execute($sql);
showError($db, $sql);
setcookie("check", "", 0);
setcookie("username", "", 0);
setcookie("iamhim", "", 0);
}