mirror of
https://github.com/appen-isen/site-interpromos.git
synced 2026-01-18 16:37:33 +01:00
remove register.php since the admin is hard-coded
This commit is contained in:
@@ -54,7 +54,6 @@ if (isset($_POST['login'])) {
|
|||||||
<input type="password" name="password" id="password" required />
|
<input type="password" name="password" id="password" required />
|
||||||
<input type="submit" name="login" value="Se connecter" />
|
<input type="submit" name="login" value="Se connecter" />
|
||||||
</form>
|
</form>
|
||||||
<a href="register.php">Créer un compte</a>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
56
register.php
56
register.php
@@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PHP version 8.1.11
|
|
||||||
*
|
|
||||||
* @author Youn Mélois <youn@melois.dev>
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'resources/config.php';
|
|
||||||
require_once 'resources/database.php';
|
|
||||||
require_once LIBRARY_PATH . '/redirect.php';
|
|
||||||
require_once LIBRARY_PATH . '/exceptions.php';
|
|
||||||
|
|
||||||
$db = new Database();
|
|
||||||
|
|
||||||
if (isset($_POST['register'])) {
|
|
||||||
$name = $_POST['name'];
|
|
||||||
$email = $_POST['email'];
|
|
||||||
$password = $_POST['password'];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$success = $db->createUser($name, $email, $password);
|
|
||||||
if ($success) {
|
|
||||||
redirect('admin.php');
|
|
||||||
}
|
|
||||||
} catch (AuthenticationException $e) {
|
|
||||||
// pass
|
|
||||||
} catch (DuplicateEmailException $e) {
|
|
||||||
// pass
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="fr">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<title>Interpromos - Inscription</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h1>Inscription</h1>
|
|
||||||
<form action="register.php" method="POST">
|
|
||||||
<label for="name">Nom</label>
|
|
||||||
<input type="text" name="name" id="name" required />
|
|
||||||
<label for="email">Email</label>
|
|
||||||
<input type="email" name="email" id="email" required />
|
|
||||||
<label for="password">Mot de passe</label>
|
|
||||||
<input type="password" name="password" id="password" required />
|
|
||||||
<input type="submit" name="register" value="S'inscrire" />
|
|
||||||
</form>
|
|
||||||
<a href="login.php">Se connecter</a>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user