Fixed restrictions with registering
This commit is contained in:
@@ -47,6 +47,8 @@ function checkName($variable){
|
|||||||
throw new lettersAndSpacesException("Verplicht!");
|
throw new lettersAndSpacesException("Verplicht!");
|
||||||
} else if (!preg_match("/^[a-zA-Z ]*$/", $variable)) {
|
} else if (!preg_match("/^[a-zA-Z ]*$/", $variable)) {
|
||||||
throw new lettersAndSpacesException("Alleen letters en spaties zijn toegestaan!");
|
throw new lettersAndSpacesException("Alleen letters en spaties zijn toegestaan!");
|
||||||
|
} else if (strlen($variable) > 63){
|
||||||
|
throw new lettersAndSpacesException(("Mag maximaal 63 karakters hebben!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +83,8 @@ function username($variable){
|
|||||||
throw new usernameException("Moet minstens 6 karakters bevatten");
|
throw new usernameException("Moet minstens 6 karakters bevatten");
|
||||||
} else if (getExistingUsername() == 1) {
|
} else if (getExistingUsername() == 1) {
|
||||||
throw new usernameException("Gebruikersnaam bestaal al");
|
throw new usernameException("Gebruikersnaam bestaal al");
|
||||||
|
} else if (strlen($variable) > 50) {
|
||||||
|
throw new usernameException("Mag maximaal 50 karakters!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,6 +96,8 @@ function fbUsername($variable){
|
|||||||
throw new usernameException("Moet minstens 6 karakters bevatten");
|
throw new usernameException("Moet minstens 6 karakters bevatten");
|
||||||
} else if (getExistingFBUsername() == 1) {
|
} else if (getExistingFBUsername() == 1) {
|
||||||
throw new usernameException("Gebruikersnaam bestaal al");
|
throw new usernameException("Gebruikersnaam bestaal al");
|
||||||
|
} else if (strlen($variable) > 50) {
|
||||||
|
throw new usernameException("Mag maximaal 50 karakters!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +107,8 @@ function longerEight($variable){
|
|||||||
throw new passwordException("Verplicht!");
|
throw new passwordException("Verplicht!");
|
||||||
} else if (strlen($variable) < 8) {
|
} else if (strlen($variable) < 8) {
|
||||||
throw new passwordException("Moet minstens 8 karakters bevatten");
|
throw new passwordException("Moet minstens 8 karakters bevatten");
|
||||||
|
} else if (strlen($variable) > 50) {
|
||||||
|
throw new usernameException("Mag maximaal 50 karakters!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,9 +120,11 @@ function validateEmail($variable){
|
|||||||
throw new emailException("Geldige email invullen");
|
throw new emailException("Geldige email invullen");
|
||||||
} else if (getExistingEmail() == 1){
|
} else if (getExistingEmail() == 1){
|
||||||
throw new emailException("Email bestaal al!");
|
throw new emailException("Email bestaal al!");
|
||||||
|
} else if (strlen($variable) > 255) {
|
||||||
|
throw new emailException("Mag maximaal 50 karakters!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//255
|
||||||
/* checks if an input is a valid email. */
|
/* checks if an input is a valid email. */
|
||||||
function validateFBEmail($variable){
|
function validateFBEmail($variable){
|
||||||
if (empty($variable)) {
|
if (empty($variable)) {
|
||||||
@@ -123,6 +133,8 @@ function validateFBEmail($variable){
|
|||||||
throw new emailException("Geldige email invullen");
|
throw new emailException("Geldige email invullen");
|
||||||
} else if (getExistingFBEmail() == 1){
|
} else if (getExistingFBEmail() == 1){
|
||||||
throw new emailException("Email bestaal al!");
|
throw new emailException("Email bestaal al!");
|
||||||
|
} else if (strlen($variable) > 255) {
|
||||||
|
throw new emailException("Mag maximaal 50 karakters!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ $fbUsername = $fbPassword = $fbConfirmpassword = "";
|
|||||||
$fbUsernameErr = $fbPasswordErr = $fbConfirmpasswordErr = $fbEmailErr = $fbBdayErr = "";
|
$fbUsernameErr = $fbPasswordErr = $fbConfirmpasswordErr = $fbEmailErr = $fbBdayErr = "";
|
||||||
$fbCorrect = true;
|
$fbCorrect = true;
|
||||||
$fbName = $fbSurname = $fbBday = $fbEmail = $fbUserID = "";
|
$fbName = $fbSurname = $fbBday = $fbEmail = $fbUserID = "";
|
||||||
$bdayExist = false;
|
|
||||||
|
|
||||||
// Register variables
|
// Register variables
|
||||||
$name = $surname = $bday = $username = $password = $confirmpassword = $location = $housenumber = $email = $confirmEmail = $captcha = $ip = "";
|
$name = $surname = $bday = $username = $password = $confirmpassword = $location = $housenumber = $email = $confirmEmail = $captcha = $ip = "";
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<!--Login with facebook button-->
|
<!--Login with facebook button-->
|
||||||
<?php
|
<?php
|
||||||
if(!isset($acces_token)) {
|
if(!isset($acces_token)) {
|
||||||
echo '<div class="login_containerlogin"><a class="fbButton" href="' . $loginurl . '">login with Facebook!</a></div>';
|
echo '<div class="login_containerlogin"><a class="fbButton" href="' . $loginurl . '"><i class="fa fa-facebook-square"></i> login met Facebook!</a></div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,11 @@
|
|||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="styles/index.css">
|
href="styles/index.css">
|
||||||
|
<link rel="stylesheet"
|
||||||
|
type="text/css"
|
||||||
|
href="styles/font-awesome.css">
|
||||||
<script src="js/jquery.js"></script>
|
<script src="js/jquery.js"></script>
|
||||||
<script src="js/registerAndLogin.js"></script>
|
<script src="js/registerAndLogin.js"></script>
|
||||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user