Address changes.
This commit is contained in:
parent
a5949e0401
commit
635b3ddcbc
59 changed files with 7249 additions and 2745 deletions
21
login.php
21
login.php
|
@ -5,6 +5,7 @@ require_once 'vendor/autoload.php';
|
|||
use DJMixHosting\Database;
|
||||
use DJMixHosting\User;
|
||||
use DJMixHosting\SessionManager;
|
||||
use Random\RandomException;
|
||||
|
||||
// If a user is already logged in, redirect to profile.
|
||||
if (SessionManager::getUser()) {
|
||||
|
@ -14,7 +15,11 @@ if (SessionManager::getUser()) {
|
|||
|
||||
// Generate a CSRF token if one is not set
|
||||
if (!isset($_SESSION['csrf_token'])) {
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
try {
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
} catch (RandomException $e) {
|
||||
die("An error occurred. Please try again.");
|
||||
}
|
||||
}
|
||||
|
||||
$title = $locale['home'];
|
||||
|
@ -69,14 +74,14 @@ if (isset($_SESSION['error'])) {
|
|||
<div class="col-lg-5">
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body p-4">
|
||||
<h3 class="text-center mb-4">Login</h3>
|
||||
<h3 class="text-center mb-4"><?php echo $locale['login'];?></h3>
|
||||
<form action="login.php" method="post" class="needs-validation" novalidate>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<label for="email" class="form-label"><?php echo $locale['email'];?></label>
|
||||
<input type="email" class="form-control form-control-lg" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<label for="password" class="form-label"><?php echo $locale['password'];?></label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control form-control-lg" id="password" name="password" required>
|
||||
<button class="btn btn-outline-secondary px-3" type="button" id="togglePassword"
|
||||
|
@ -87,18 +92,18 @@ if (isset($_SESSION['error'])) {
|
|||
</div>
|
||||
<div class="mb-4 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="rememberMe" name="remember_me">
|
||||
<label class="form-check-label" for="rememberMe">Remember me</label>
|
||||
<label class="form-check-label" for="rememberMe"><?php echo $locale['rememberMe'];?></label>
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($_SESSION['csrf_token']); ?>">
|
||||
<button type="submit" class="btn btn-primary w-100 btn-lg mb-3">Login</button>
|
||||
<button type="submit" class="btn btn-primary w-100 btn-lg mb-3"><?php echo $locale['login'];?></button>
|
||||
<div class="text-center">
|
||||
<a href="forgot-password.php" class="text-decoration-none">Forgot password?</a>
|
||||
<a href="forgot-password.php" class="text-decoration-none"><?php echo $locale['forgotPassword'];?></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-4">
|
||||
<p class="mb-0">Don't have an account? <a href="register.php" class="text-decoration-none">Sign up</a></p>
|
||||
<p class="mb-0"><?php echo $locale['dontHaveAccount'];?> <a href="/" class="text-decoration-none"><?php echo $locale['signUp'];?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue