mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 20:29:58 +03:00
- simplify calculation of auto login key (no need to concatenate 2 hashes)
git-svn-id: http://piwigo.org/svn/trunk@11826 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
19f0fb73d9
commit
86bc4d1143
1 changed files with 2 additions and 5 deletions
|
@ -1032,11 +1032,8 @@ WHERE '.$conf['user_fields']['id'].' = '.$user_id;
|
||||||
{
|
{
|
||||||
$row = pwg_db_fetch_assoc($result);
|
$row = pwg_db_fetch_assoc($result);
|
||||||
$username = stripslashes($row['username']);
|
$username = stripslashes($row['username']);
|
||||||
$data = $time.stripslashes($row['username']).$row['password'];
|
$data = $time.$user_id.$username;
|
||||||
$key = base64_encode(
|
$key = base64_encode( hash_hmac('sha1', $data, $conf['secret_key'].$row['password'],true) );
|
||||||
pack('H*', sha1($data))
|
|
||||||
.hash_hmac('md5', $data, $conf['secret_key'],true)
|
|
||||||
);
|
|
||||||
return $key;
|
return $key;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue