Browse Source

Revert "Added Blackcodec's password security code"

This reverts commit 7963ae9854.
pull/74/head
Kanti 11 years ago
parent
commit
7a82c6f778
2 changed files with 4 additions and 12 deletions
  1. +0
    -4
      config/users/username.ini.example
  2. +4
    -8
      system/admin/admin.php

+ 0
- 4
config/users/username.ini.example View File

@ -1,9 +1,5 @@
;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

+ 4
- 8
system/admin/admin.php View File

@ -15,20 +15,16 @@ 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) {
if (file_exists($user_file)) {
if ($pass === $user_pass) {
$_SESSION[config("site.url")]['user'] = $user;
header('location: admin');
}
else {
} else {
return $str = '<li>Your username and password mismatch.</li>';
}
}
else {
} else {
return $str = '<li>Username not found in our record.</li>';
}
}


Loading…
Cancel
Save