diff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php index 06557b3..5096bfd 100644 --- a/app/Controller/UsersController.php +++ b/app/Controller/UsersController.php @@ -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) {