Theres a really irritating bug in the standard login, if you want to use the user picture in the menu.
If you login normally, then everything works fine. If you’ve logged in because you’ve ticked the remember me button and therefore have a cookie to log you in the picture doesn’t appear.
Looking into the code, you can see an error where the remember_me_init function bypasses the setup of the picture part of the validation.
You can fix it by editing the function:
- add the picture column in the sql
- copying the relevant code into this function
It should look something like this:
$sql = "SELECT
priv_admin,
active,
name,
email,
picture
FROM V2sec_users
WHERE login = “. sc_sql_injection($usr_data[‘login’]) .”
AND activation_code = ".sc_sql_injection($usr_data[‘code’]);
sc_lookup(rs, $sql);
if(count({rs}) != 0 && {rs[0][1]} == 'Y')
{
[usr_login] = $usr_data['login'];
[usr_priv_admin] = ({rs[0][0]} == 'Y') ? TRUE : FALSE;
[usr_name] = {rs[0][2]};
[usr_email] = {rs[0][3]};
//---IDMB CODE FIX for Picture----------------
// also added extra ,picture line in sql
[usr_picture] = {rs[0][4]};
/* Write image*/
if(!empty({rs[0][4]})){
$path_img = $_SESSION['scriptcase']['V2app_Login']['glo_nm_path_imag_temp'] .'/sc_img_'. [usr_login] . hash("sha512",date('YmdHis')) . '.png';
file_put_contents($this->Ini->root . $path_img, {rs[0][4]});
[usr_picture] = $path_img;
}
//---END IDMB CODE---------