diff --git a/config/users/username.ini.example b/config/users/username.ini.example index befaed5..ace040f 100644 --- a/config/users/username.ini.example +++ b/config/users/username.ini.example @@ -1,5 +1,9 @@ ;Password password = yourpassword +encryption = clear +; encryption: not set, leave blank or set to clear or none to use plain text password for the user, +; else set to encryption algoritm supported by hash function of php to use the selected +; encryption ;Role -role = admin \ No newline at end of file +role = admin diff --git a/system/admin/admin.php b/system/admin/admin.php index 35777c6..6293791 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -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); } -} \ No newline at end of file +}