Address changes.
This commit is contained in:
parent
a5949e0401
commit
635b3ddcbc
59 changed files with 7249 additions and 2745 deletions
22
register.php
22
register.php
|
@ -26,21 +26,21 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||
// Basic validation
|
||||
$errors = [];
|
||||
if (empty($username) || empty($email) || empty($password) || empty($confirm_password) || empty($first_name) || empty($last_name)) {
|
||||
$errors[] = "All fields are required.";
|
||||
$errors[] = $locale['allFieldsRequired'];
|
||||
}
|
||||
if ($password !== $confirm_password) {
|
||||
$errors[] = "Passwords do not match.";
|
||||
$errors[] = $locale['passwordDoNotMatch'];
|
||||
}
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$errors[] = "Invalid email format.";
|
||||
$errors[] = $locale['invalidEmail'];
|
||||
}
|
||||
if (!preg_match('/^[a-zA-Z0-9_]{3,25}$/', $username)) {
|
||||
$errors[] = "Invalid username format.";
|
||||
$errors[] = $locale['invalidUsername'];
|
||||
}
|
||||
|
||||
if (!empty($errors)) {
|
||||
$_SESSION['error'] = implode(" ", $errors);
|
||||
header("Location: register.php");
|
||||
header("Location: /register");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||
$user_id = $user->newUser($username, $password, $email, $first_name, $last_name);
|
||||
} catch (\Exception $e) {
|
||||
$_SESSION['error'] = $e->getMessage();
|
||||
header("Location: register.php");
|
||||
header("Location: /register");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -84,11 +84,13 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||
]);
|
||||
$sender_email = $config['aws']['ses']['sender_email'];
|
||||
$recipient_email = $email;
|
||||
$subject = "Verify Your Email Address";
|
||||
$subject = $locale['verifyEmailAddress'];
|
||||
$verification_link = $config['app']['url'] . "/verify_email.php?code={$verification_code}";
|
||||
$body_text = "Thank you for registering at " . $config['app']['name'] . ".\n\n";
|
||||
$body_text .= "Please verify your email address by clicking the link below or by entering the verification code in your profile:\n\n";
|
||||
$body_text .= "{$verification_link}\n\nYour verification code is: {$verification_code}\nThis code will expire in 15 minutes.";
|
||||
$body_text = $locale['registerThankYou'] . $config['app']['name'] . ".\n\n";
|
||||
$body_text .= $locale['registerVerifyEmail'] . "\n\n";
|
||||
$body_text .= $verification_link . "\n\n";
|
||||
$body_text .= $locale['registerVerifyCodeIs'] . $verification_code . "\n";
|
||||
$body_text .= $locale['registerVerifyTimeout'];
|
||||
|
||||
try {
|
||||
$sesClient->sendEmail([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue