Transfer to git
This commit is contained in:
42
includes/login_contr.inc.php
Normal file
42
includes/login_contr.inc.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
function isEmpty(array $array){
|
||||
foreach ($array as $value => $content) {
|
||||
if (empty($content)){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function does_Password_match(object $pdo, string $username, string $pwd) {
|
||||
// Get hashed password from db
|
||||
function get_hashed_password(object $pdo, string $username) {
|
||||
$stored_pwd = retrieve_hashed_pwd($pdo, $username);
|
||||
|
||||
return $stored_pwd;
|
||||
}
|
||||
|
||||
$stored_pwd = get_hashed_password($pdo, $username);
|
||||
|
||||
if (password_verify($pwd,$stored_pwd)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function does_user_exist(object $pdo, string $username){
|
||||
if (search_user($pdo, $username)){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function print_errors(){
|
||||
check_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user