mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 21:46:22 +05:30
Added encryption
Added encryption support to user password
This commit is contained in:
parent
711d9e1fa5
commit
fd5fa4733a
1 changed files with 3 additions and 1 deletions
|
|
@ -15,7 +15,9 @@ function user($key, $user=null) {
|
|||
// Create a session
|
||||
function session($user, $pass, $str = null) {
|
||||
$user_file = 'config/users/' . $user . '.ini';
|
||||
$user_enc = user('encryption', $user);
|
||||
$user_pass = user('password', $user);
|
||||
$password = (strlen($user_enc) > 0 && $user_enc !== 'clear' && $user_enc !== 'none')?hash($user_enc,$pass):$pass;
|
||||
|
||||
if(file_exists($user_file)) {
|
||||
if($pass === $user_pass) {
|
||||
|
|
@ -545,4 +547,4 @@ function clear_page_cache($url) {
|
|||
if (file_exists($p)) {
|
||||
unlink($p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue