Skip to content

Commit

Permalink
Prevent user from registering if it is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrobolt committed Jun 11, 2015
1 parent f64602d commit 0c9ab97
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions handle-register.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@

$isemail = filteremail($_POST['email']);

if ($regtype == "none") {
require_once 'layout-headerlg.php';
echo "Registration is disabled. <br><br><a href='register.php'>Go Back</a>";
require_once 'layout-footerlg.php';
die(); //prevent user from registering
}
if (!$isemail) {
require_once 'layout-headerlg.php';
echo "Please enter a valid email. <br><br><a href='register.php'>Go Back</a>";
require_once 'layout-footerlg.php';
die(); //prevent user from registering
}

if ((strlen($_POST['username']) > 15) || (strlen($_POST['password']) > 25) || (strlen($_POST['email']) > 50)) {
require_once 'layout-headerlg.php';
echo "Your username must not be over 15 characters, password must be under 25 characters but over 6 characters, and email must be under 50 charcaters. <br><br><a href='register.php'>Go Back</a>";
Expand Down

0 comments on commit 0c9ab97

Please sign in to comment.