From f5e972c030675f46cda543e13da1b787457e070b Mon Sep 17 00:00:00 2001
From: cflip <36554078+cflip@users.noreply.github.com>
Date: Wed, 23 Jun 2021 15:21:12 -0600
Subject: Add the rest of the changes
---
register.php | 157 +++++++++++++++++++++++++++++------------------------------
1 file changed, 78 insertions(+), 79 deletions(-)
mode change 100644 => 100755 register.php
(limited to 'register.php')
diff --git a/register.php b/register.php
old mode 100644
new mode 100755
index 9eb3347..5128f10
--- a/register.php
+++ b/register.php
@@ -1,79 +1,78 @@
-
-
-
-
- Register an account - cflip.net forum
-
-
-
-
-Register an account
-
-
-
- 30) {
- $errors[] = "Your username must be 30 characters or less.";
- }
-
- if (username_exists($user_name) !== false) {
- $errors[] = "The username '" . $user_name . "' has already been taken by another user.";
- }
- }
-
- if (empty($_POST['user_pass'])) {
- $errors[] = "You must provide a password.";
- } else {
- $user_pass = $_POST['user_pass'];
- $pass_check = $_POST['user_pass_check'];
-
- if (preg_match("/^[a-zA-Z0-9\W]*$/", $user_pass) === false) {
- $errors[] = "Password contains invalid characters!";
- }
-
- if ($user_pass !== $pass_check) {
- $errors[] = "The two passwords do not match.";
- }
- }
-
- if (!empty($errors)) {
- $errstr = 'Please check the following problems: ';
- foreach ($errors as $err) {
- $errstr .= '- ' . $err . '
';
- }
- $errstr .= '
';
- trigger_error($errstr);
- } else {
- $pass_hash = password_hash($user_pass, PASSWORD_DEFAULT);
- User::register($user_name, $pass_hash);
- echo 'Account successfully registered! You can now sign in
';
- }
-}
-?>
-
-
+
+
+
+
+ Register an account - cflip.net forum
+
+
+
+
+ Register an account
+
+
+ 30) {
+ $errors[] = "Your username must be 30 characters or less.";
+ }
+
+ if (username_exists($user_name) !== false) {
+ $errors[] = "The username '" . $user_name . "' has already been taken by another user.";
+ }
+ }
+
+ if (empty($_POST['user_pass'])) {
+ $errors[] = "You must provide a password.";
+ } else {
+ $user_pass = $_POST['user_pass'];
+ $pass_check = $_POST['user_pass_check'];
+
+ if (preg_match("/^[a-zA-Z0-9\W]*$/", $user_pass) === false) {
+ $errors[] = "Password contains invalid characters!";
+ }
+
+ if ($user_pass !== $pass_check) {
+ $errors[] = "The two passwords do not match.";
+ }
+ }
+
+ if (!empty($errors)) {
+ $errstr = 'Please check the following problems: ';
+ foreach ($errors as $err) {
+ $errstr .= '- ' . $err . '
';
+ }
+ $errstr .= '
';
+ trigger_error($errstr);
+ } else {
+ $pass_hash = password_hash($user_pass, PASSWORD_DEFAULT);
+ User::register($user_name, $pass_hash);
+ echo 'Account successfully registered! You can now sign in
';
+ }
+}
+?>
+
+
--
cgit v1.2.3