Autosave: 20260219-180907
This commit is contained in:
parent
a08b70fdf1
commit
eacaa0e950
@ -16,10 +16,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
header('Location: ../index.php');
|
||||
exit;
|
||||
} else {
|
||||
$error = "Invalid email or password.";
|
||||
$error = "Email ou mot de passe invalide.";
|
||||
}
|
||||
} else {
|
||||
$error = "Please fill all fields.";
|
||||
$error = "Veuillez remplir tous les champs.";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -27,7 +27,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Login | Discord Clone</title>
|
||||
<title>Connexion | Discord Clone</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../assets/css/discord.css">
|
||||
<style>
|
||||
@ -44,24 +44,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</head>
|
||||
<body>
|
||||
<div class="auth-card">
|
||||
<h3 class="text-center mb-1">Welcome back!</h3>
|
||||
<p class="text-center mb-4" style="color: #b5bac1;">We're so excited to see you again!</p>
|
||||
<h3 class="text-center mb-1">Bon retour !</h3>
|
||||
<p class="text-center mb-4" style="color: #b5bac1;">Nous sommes ravis de vous revoir !</p>
|
||||
<?php if($error): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
|
||||
<?php endif; ?>
|
||||
<form method="POST">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Email or Phone Number</label>
|
||||
<label class="form-label">Email ou numéro de téléphone</label>
|
||||
<input type="email" name="email" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
<label class="form-label">Mot de passe</label>
|
||||
<input type="password" name="password" class="form-control" required>
|
||||
</div>
|
||||
<a href="#" style="color: #00a8fc; font-size: 14px; text-decoration: none;">Forgot your password?</a>
|
||||
<button type="submit" class="btn btn-blurple">Log In</button>
|
||||
<a href="#" style="color: #00a8fc; font-size: 14px; text-decoration: none;">Mot de passe oublié ?</a>
|
||||
<button type="submit" class="btn btn-blurple">Se connecter</button>
|
||||
<div class="auth-footer">
|
||||
Need an account? <a href="register.php">Register</a>
|
||||
Besoin d'un compte ? <a href="register.php">S'inscrire</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -12,15 +12,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$server_id = 1; // Default server
|
||||
if (PRIVATE_REGISTRATION) {
|
||||
if (empty($invite_code)) {
|
||||
$error = "An invitation code is required.";
|
||||
$error = "Un code d'invitation est requis.";
|
||||
} else {
|
||||
$stmt = db()->prepare("SELECT id, invite_code_expires_at FROM servers WHERE invite_code = ?");
|
||||
$stmt->execute([$invite_code]);
|
||||
$server = $stmt->fetch();
|
||||
if (!$server) {
|
||||
$error = "Invalid invitation code.";
|
||||
$error = "Code d'invitation invalide.";
|
||||
} elseif ($server['invite_code_expires_at'] && strtotime($server['invite_code_expires_at']) < time()) {
|
||||
$error = "This invitation code has expired.";
|
||||
$error = "Ce code d'invitation a expiré.";
|
||||
} else {
|
||||
$server_id = $server['id'];
|
||||
}
|
||||
@ -42,11 +42,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
header('Location: ../index.php?server_id=' . $server_id);
|
||||
exit;
|
||||
} catch (Exception $e) {
|
||||
$error = "Registration failed: " . $e->getMessage();
|
||||
$error = "L'inscription a échoué : " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error = "Please fill all fields.";
|
||||
$error = "Veuillez remplir tous les champs.";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -54,7 +54,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Register | Discord Clone</title>
|
||||
<title>Inscription | Discord Clone</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../assets/css/discord.css">
|
||||
<style>
|
||||
@ -71,13 +71,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</head>
|
||||
<body>
|
||||
<div class="auth-card">
|
||||
<h3 class="text-center mb-4">Create an account</h3>
|
||||
<h3 class="text-center mb-4">Créer un compte</h3>
|
||||
<?php if($error): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
|
||||
<?php endif; ?>
|
||||
<form method="POST">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Username</label>
|
||||
<label class="form-label">Nom d'utilisateur</label>
|
||||
<input type="text" name="username" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
@ -85,18 +85,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<input type="email" name="email" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
<label class="form-label">Mot de passe</label>
|
||||
<input type="password" name="password" class="form-control" required>
|
||||
</div>
|
||||
<?php if (PRIVATE_REGISTRATION): ?>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Invite Code</label>
|
||||
<label class="form-label">Code d'invitation</label>
|
||||
<input type="text" name="invite_code" class="form-control" placeholder="Ex: aB1!c2D3@4" required>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button type="submit" class="btn btn-blurple">Continue</button>
|
||||
<button type="submit" class="btn btn-blurple">Continuer</button>
|
||||
<div class="auth-footer">
|
||||
Already have an account? <a href="login.php">Login</a>
|
||||
Vous avez déjà un compte ? <a href="login.php">Se connecter</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user