Hello, I got an issue with a user register form, I configured in onBeforeInsert event the password field as {staffpassword} = md5({staffpassword}); in order to when the admin registers a new person the password be saved as encode. In this process everything is ok.
The issue comes in the login form, everytime that I try to login with the registered user that has password encode with md5, the form show me an error message ? User/Password invalid ?. The validation code for the login form is the next, I appreciate your help to know what is the error:
$definedParameters = $_SESSION[‘ticketsettings’][‘definedparameters’];
$str_sql = “SELECT count(*) FROM staff WHERE
staffemail = ‘{email}’ and
staffpassword = ‘{password}’”;
sc_lookup(dataset,$str_sql);
if({dataset}[0][0] <= 0){
sc_error_message({lang_error_invalid_user});
}
else{
$arr_staff = LoadStaff({email});
$_SESSION[‘staff’] = $arr_staff;
$_SESSION[‘v_staffname’] = $arr_staff[‘staffname’];
$_SESSION[‘v_staffid’] = $arr_staff[‘staffid’];
$locales = explode(’;’,$arr_staff[‘stafflanguage’]);
sc_set_language($locales[0]);
sc_set_regional($locales[1]);
sc_reset_apl_status();
$str_redir = ‘’;
if(trim($arr_staff[‘adminflag’]) == ‘Y’){
enable_admin_module();
enable_staff_module();
$str_redir = ‘menu_admin’;
}
elseif(trim($arr_staff[‘adminflag’]) == ‘N’){
enable_staff_module();
$str_redir = ‘menu_staff’;
}
sc_redir($str_redir);