1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 09:00:34 +02:00

Début de gestion des mails et quelques modifications

This commit is contained in:
galaxyoyo
2019-09-07 16:37:00 +02:00
parent 7266fe8e24
commit e5e197dd38
11 changed files with 109 additions and 52 deletions

View File

@ -44,13 +44,6 @@ function loadUserValues() {
}
}
function echoDate($date = NULL, $with_time = false) {
if ($date == NULL)
$date = date("yyyy-mm-dd");
return strftime("%d %B %G" . ($with_time ? " %H:%M" : ""), strtotime($date));
}
function quitTeam() {
global $DB, $URL_BASE;
@ -96,7 +89,10 @@ function quitTeam() {
unset($_SESSION["team"]);
}
function ensure($bool, $error_msg = "") {
if (!$bool)
throw new AssertionError($error_msg);
function userExists($email) {
global $DB, $YEAR;
$req = $DB->prepare("SELECT `email` FROM `users` WHERE `email` = ? AND `year` = '$YEAR';");
$req->execute([$email]);
return !$req->fetch();
}