forgot to add utils, now it should be better
This commit is contained in:
parent
6256ca71ce
commit
d0bb2e59b2
@ -182,3 +182,21 @@ function get_user_info_from_session_id($session_id, $info)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function add_user($email, $first_name, $last_name, $clear_password)
|
||||
{
|
||||
global $PDO;
|
||||
|
||||
$password_hash = password_hash($clear_password, PASSWORD_DEFAULT);
|
||||
|
||||
$sql = "INSERT INTO accounts(email, first_name, last_name, password, public_id)
|
||||
VALUES (:email, :first_name, :last_name, :password, :public_id);";
|
||||
$query = $PDO->prepare($sql);
|
||||
$query->bindValue(":email", $email);
|
||||
$query->bindValue(":first_name", $first_name);
|
||||
$query->bindValue(":last_name", $last_name);
|
||||
$query->bindValue(":password", $password_hash);
|
||||
$query->bindValue(":public_id", generate_random_string());
|
||||
return $query->execute();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user