Everything previously under www/src now are under www/ Moved style.CSS under www/ressources, to allow blocking http requests to www/lib completly Moved <head> and <header> generation under lib/PHP/output/sections.php to reduce redundancy within files. Also implemented a system to allow them to generate relatif paht for href to ressources depending on their deepness within www/ hierarchy.
25 lines
607 B
PHP
25 lines
607 B
PHP
<?php
|
|
|
|
function register_new_user_in_db(
|
|
PDO $db,
|
|
string $email,
|
|
string $pw_hash,
|
|
string $displayname,
|
|
string $username ): bool
|
|
{
|
|
$sql = <<<_SQL
|
|
INSERT INTO accounts.users
|
|
(email, username, displayname, password, permissions)
|
|
VALUES (?, ?, ?, ?, 'lurker')
|
|
_SQL;
|
|
$statement = $db->prepare($sql);
|
|
if($statement === false)
|
|
{
|
|
return false;
|
|
}
|
|
$statement->bindValue(1, $email, PDO::PARAM_STR);
|
|
$statement->bindValue(2, $username, PDO::PARAM_STR);
|
|
$statement->bindValue(3, $displayname, PDO::PARAM_STR);
|
|
$statement->bindValue(4, $pw_hash, PDO::PARAM_STR);
|
|
return $statement->execute();
|
|
}
|