In case you want replace SC’s crappy change password code with something that works, here is what I am using now.
if( (!isset({old_pswd}) || empty({old_pswd}) ) && (!isset([act_code]) || empty([act_code]) ) )
{
sc_error_message({lang_error_old_pswd});
sc_error_exit();
}
if({pswd} != {confirm_pswd})
{
sc_error_message({lang_error_pswd});
sc_error_exit();
}
$spswd = sc_sql_injection(md5({pswd}));
if (isset([act_code]) && !empty([act_code]))
{
$sold_pswd = "activation_code= ". sc_sql_injection([act_code]) . "AND pswd = ". sc_sql_injection(md5({old_pswd}));
}
else
{
$sold_pswd = " pswd = ". sc_sql_injection(md5({old_pswd}));
}
//$sold_pswd = ( isset([act_code]) && !empty([act_code]) ) ? "activation_code= ". sc_sql_injection([act_code]) : " pswd = ". sc_sql_injection(md5({old_pswd}));
if((isset({old_pswd}) || !empty({old_pswd})) && (!isset([act_code]) || empty([act_code])))
{
$sql = “SELECT count(*) FROM sec_users WHERE “. $sold_pswd .” AND login = '”. [usr_login] . “’”;
sc_lookup(rs, $sql);
if({rs} === FALSE || {rs}[0][0] == 0)
{
sc_error_message({lang_error_old_pswd});
sc_error_exit();
}
}
unset([act_code]);