Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Update UsersController.php #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions app/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,21 @@ protected function _check_password($hash,$pass) {
return false;
}
} elseif ($hash_type == 'sha') {
// TODO: Not yet implimented
return false;
// This has not be tested
$test_hash = '{SHA}' . base64_encode(sha1( $pass, TRUE ));
if (strcmp($hash,$test_hash) == 0) {
return true;
} else {
return false;
}
} elseif ($hash_type == 'md5') {
// TODO: Not yet implimented
return false;
// This has not be tested
$test_hash = '{MD5}' . base64_encode(md5( $pass,TRUE));
if (strcmp($hash,$test_hash) == 0) {
return true;
} else {
return false;
}
} else {
// Plaintext?
if ($pass == $hash) {
Expand Down