Added url get #197
@@ -1,123 +0,0 @@
|
|||||||
/**
|
|
||||||
* jQuery DOB Picker
|
|
||||||
* Website: https://github.com/tyea/dobpicker
|
|
||||||
* Version: 1.0
|
|
||||||
* Author: Tom Yeadon
|
|
||||||
* License: BSD 3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
jQuery.extend({
|
|
||||||
|
|
||||||
dobPicker: function(params) {
|
|
||||||
|
|
||||||
// set the defaults
|
|
||||||
if (typeof(params.dayDefault)==='undefined') params.dayDefault = 'Day';
|
|
||||||
if (typeof(params.monthDefault)==='undefined') params.monthDefault = 'Month';
|
|
||||||
if (typeof(params.yearDefault)==='undefined') params.yearDefault = 'Year';
|
|
||||||
if (typeof(params.minimumAge)==='undefined') params.minimumAge = 12;
|
|
||||||
if (typeof(params.maximumAge)==='undefined') params.maximumAge = 80;
|
|
||||||
|
|
||||||
// set the default messages
|
|
||||||
$(params.daySelector).append('<option value="">' + params.dayDefault + '</option>');
|
|
||||||
$(params.monthSelector).append('<option value="">' + params.monthDefault + '</option>');
|
|
||||||
$(params.yearSelector).append('<option value="">' + params.yearDefault + '</option>');
|
|
||||||
|
|
||||||
// populate the day select
|
|
||||||
for (i = 1; i <= 31; i++) {
|
|
||||||
if (i <= 9) {
|
|
||||||
var val = '0' + i;
|
|
||||||
} else {
|
|
||||||
var val = i;
|
|
||||||
}
|
|
||||||
$(params.daySelector).append('<option value="' + val + '">' + i + '</option>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// populate the month select
|
|
||||||
var months = [
|
|
||||||
"January",
|
|
||||||
"February",
|
|
||||||
"March",
|
|
||||||
"April",
|
|
||||||
"May",
|
|
||||||
"June",
|
|
||||||
"July",
|
|
||||||
"August",
|
|
||||||
"September",
|
|
||||||
"October",
|
|
||||||
"November",
|
|
||||||
"December"
|
|
||||||
];
|
|
||||||
|
|
||||||
for (i = 1; i <= 12; i++) {
|
|
||||||
if (i <= 9) {
|
|
||||||
var val = '0' + i;
|
|
||||||
} else {
|
|
||||||
var val = i;
|
|
||||||
}
|
|
||||||
$(params.monthSelector).append('<option value="' + val + '">' + months[i - 1] + '</option>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// populate the year select
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
var start = year - params.minimumAge;
|
|
||||||
var count = start - params.maximumAge;
|
|
||||||
|
|
||||||
for (i = start; i >= count; i--) {
|
|
||||||
$(params.yearSelector).append('<option value="' + i + '">' + i + '</option>');
|
|
||||||
}
|
|
||||||
|
|
||||||
// do the logic for the day select
|
|
||||||
$(params.daySelector).change(function() {
|
|
||||||
|
|
||||||
$(params.monthSelector)[0].selectedIndex = 0;
|
|
||||||
$(params.yearSelector)[0].selectedIndex = 0;
|
|
||||||
$(params.yearSelector + ' option').removeAttr('disabled');
|
|
||||||
|
|
||||||
if ($(params.daySelector).val() >= 1 && $(params.daySelector).val() <= 29) {
|
|
||||||
|
|
||||||
$(params.monthSelector + ' option').removeAttr('disabled');
|
|
||||||
|
|
||||||
} else if ($(params.daySelector).val() == 30) {
|
|
||||||
|
|
||||||
$(params.monthSelector + ' option').removeAttr('disabled');
|
|
||||||
$(params.monthSelector + ' option[value="02"]').attr('disabled', 'disabled');
|
|
||||||
|
|
||||||
} else if($(params.daySelector).val() == 31) {
|
|
||||||
|
|
||||||
$(params.monthSelector + ' option').removeAttr('disabled');
|
|
||||||
$(params.monthSelector + ' option[value="02"]').attr('disabled', 'disabled');
|
|
||||||
$(params.monthSelector + ' option[value="04"]').attr('disabled', 'disabled');
|
|
||||||
$(params.monthSelector + ' option[value="06"]').attr('disabled', 'disabled');
|
|
||||||
$(params.monthSelector + ' option[value="09"]').attr('disabled', 'disabled');
|
|
||||||
$(params.monthSelector + ' option[value="11"]').attr('disabled', 'disabled');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// do the logic for the month select
|
|
||||||
$(params.monthSelector).change(function() {
|
|
||||||
|
|
||||||
$(params.yearSelector)[0].selectedIndex = 0;
|
|
||||||
$(params.yearSelector + ' option').removeAttr('disabled');
|
|
||||||
|
|
||||||
if ($(params.daySelector).val() == 29 && $(params.monthSelector).val() == '02') {
|
|
||||||
|
|
||||||
$(params.yearSelector + ' option').each(function(index) {
|
|
||||||
if (index !== 0) {
|
|
||||||
var year = $(this).attr('value');
|
|
||||||
var leap = !((year % 4) || (!(year % 100) && (year % 400)));
|
|
||||||
if (leap === false) {
|
|
||||||
$(this).attr('disabled', 'disabled');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
1
website/public/js/dobPicker.min.js
vendored
1
website/public/js/dobPicker.min.js
vendored
@@ -1 +0,0 @@
|
|||||||
jQuery.extend({dobPicker:function(a){for("undefined"==typeof a.dayDefault&&(a.dayDefault="Day"),"undefined"==typeof a.monthDefault&&(a.monthDefault="Month"),"undefined"==typeof a.yearDefault&&(a.yearDefault="Year"),"undefined"==typeof a.minimumAge&&(a.minimumAge=12),"undefined"==typeof a.maximumAge&&(a.maximumAge=80),$(a.daySelector).append('<option value="">'+a.dayDefault+"</option>"),$(a.monthSelector).append('<option value="">'+a.monthDefault+"</option>"),$(a.yearSelector).append('<option value="">'+a.yearDefault+"</option>"),i=1;i<=31;i++){if(i<=9)var b="0"+i;else var b=i;$(a.daySelector).append('<option value="'+b+'">'+i+"</option>")}var c=["January","February","March","April","May","June","July","August","September","October","November","December"];for(i=1;i<=12;i++){if(i<=9)var b="0"+i;else var b=i;$(a.monthSelector).append('<option value="'+b+'">'+c[i-1]+"</option>")}var d=new Date,e=d.getFullYear(),f=e-a.minimumAge,g=f-a.maximumAge;for(i=f;i>=g;i--)$(a.yearSelector).append('<option value="'+i+'">'+i+"</option>");$(a.daySelector).change(function(){$(a.monthSelector)[0].selectedIndex=0,$(a.yearSelector)[0].selectedIndex=0,$(a.yearSelector+" option").removeAttr("disabled"),$(a.daySelector).val()>=1&&$(a.daySelector).val()<=29?$(a.monthSelector+" option").removeAttr("disabled"):30==$(a.daySelector).val()?($(a.monthSelector+" option").removeAttr("disabled"),$(a.monthSelector+' option[value="02"]').attr("disabled","disabled")):31==$(a.daySelector).val()&&($(a.monthSelector+" option").removeAttr("disabled"),$(a.monthSelector+' option[value="02"]').attr("disabled","disabled"),$(a.monthSelector+' option[value="04"]').attr("disabled","disabled"),$(a.monthSelector+' option[value="06"]').attr("disabled","disabled"),$(a.monthSelector+' option[value="09"]').attr("disabled","disabled"),$(a.monthSelector+' option[value="11"]').attr("disabled","disabled"))}),$(a.monthSelector).change(function(){$(a.yearSelector)[0].selectedIndex=0,$(a.yearSelector+" option").removeAttr("disabled"),29==$(a.daySelector).val()&&"02"==$(a.monthSelector).val()&&$(a.yearSelector+" option").each(function(a){if(0!==a){var b=$(this).attr("value"),c=!(b%4||!(b%100)&&b%400);c===!1&&$(this).attr("disabled","disabled")}})})}});
|
|
||||||
68
website/public/js/loginRegisterModals.js
Normal file
68
website/public/js/loginRegisterModals.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
|
||||||
|
// Get the modal
|
||||||
|
var modal = document.getElementById('myModal');
|
||||||
|
var registerModal = document.getElementById('registerModal');
|
||||||
|
var facebookModal = document.getElementById("fbModal");
|
||||||
|
|
||||||
|
// Get the button that opens the modal
|
||||||
|
var registerBtn = document.getElementById("registerBtn");
|
||||||
|
var btn = document.getElementById("myBtn");
|
||||||
|
|
||||||
|
|
||||||
|
// Get the <span> element that closes the modal
|
||||||
|
var span = document.getElementsByClassName("close")[0];
|
||||||
|
var registerSpan = document.getElementsByClassName("close")[1];
|
||||||
|
var facebookCLose = document.getElementsByClassName("close")[2];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When the user clicks the button, open the modal
|
||||||
|
*/
|
||||||
|
btn.onclick = function () {
|
||||||
|
modal.style.display = "block";
|
||||||
|
|
||||||
|
}
|
||||||
|
registerBtn.onclick = function () {
|
||||||
|
registerModal.style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WHen the user clicks on (X), close the modal
|
||||||
|
*/
|
||||||
|
span.onclick = function () {
|
||||||
|
modal.style.display = "none";
|
||||||
|
}
|
||||||
|
registerSpan.onclick = function () {
|
||||||
|
registerModal.style.display = "none";
|
||||||
|
}
|
||||||
|
facebookCLose.onclick = function () {
|
||||||
|
facebookModal.style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When the user clicks anywhere outside of the modal, close it
|
||||||
|
*/
|
||||||
|
window.onclick = function (event) {
|
||||||
|
if (event.target == modal) {
|
||||||
|
modal.style.display = "none";
|
||||||
|
}
|
||||||
|
if (event.target == registerModal) {
|
||||||
|
registerModal.style.display = "none";
|
||||||
|
}
|
||||||
|
if (event.target == facebookModal) {
|
||||||
|
facebookModal.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When ESC is pressed, close modal
|
||||||
|
*/
|
||||||
|
document.addEventListener('keyup', function(e) {
|
||||||
|
if (e.keyCode == 27) {
|
||||||
|
modal.style.display = "none";
|
||||||
|
registerModal.style.display = "none";
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Created by joey on 2-2-17.
|
||||||
|
*/
|
||||||
@@ -13,18 +13,12 @@
|
|||||||
?>
|
?>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
|
|
||||||
// Checks if there's an user already logged in
|
|
||||||
if(isset($_SESSION["userID"])){
|
|
||||||
echo "<script>
|
|
||||||
window.onload=checkLoggedIn();
|
|
||||||
</script>";
|
|
||||||
}
|
|
||||||
include("../views/homeLoginRegister.php");
|
include("../views/homeLoginRegister.php");
|
||||||
|
|
||||||
/* This view adds login view */
|
/* This view adds login view */
|
||||||
include("../views/login-view.php");
|
include("../views/login-view.php");
|
||||||
?>
|
?>
|
||||||
|
<script src="js/loginRegisterModals.js"></script>;
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function getUserID() {
|
|||||||
return $stmt->fetch(PDO::FETCH_ASSOC);
|
return $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateLogin($username, $password){
|
function validateLogin($username, $password, $url){
|
||||||
// Empty username or password field
|
// Empty username or password field
|
||||||
if (empty($username) || empty($password)) {
|
if (empty($username) || empty($password)) {
|
||||||
throw new loginException("Inloggegevens zijn niet ingevuld");
|
throw new loginException("Inloggegevens zijn niet ingevuld");
|
||||||
@@ -50,20 +50,35 @@ function validateLogin($username, $password){
|
|||||||
echo "<script>
|
echo "<script>
|
||||||
window.onload=bannedAlert();
|
window.onload=bannedAlert();
|
||||||
</script>";
|
</script>";
|
||||||
} else if ($role == "frozen"){
|
|
||||||
|
} else if ($role == "frozen") {
|
||||||
$_SESSION["userID"] = $userID;
|
$_SESSION["userID"] = $userID;
|
||||||
|
if (!isset($url) or $url = "") {
|
||||||
echo "<script>
|
echo "<script>
|
||||||
window.onload=frozenAlert();
|
window.onload=frozenAlert();
|
||||||
window.location.href= 'profile.php';
|
window.location.href= 'profile.php';
|
||||||
</script>";
|
</script>";
|
||||||
|
} else {
|
||||||
|
echo "<script>
|
||||||
|
window.onload=frozenAlert();
|
||||||
|
window.location.href= $url;
|
||||||
|
</script>";
|
||||||
|
}
|
||||||
|
|
||||||
} else if ($role == "unconfirmed"){
|
} else if ($role == "unconfirmed"){
|
||||||
sendConfirmEmail(getUser()["userID"]);
|
sendConfirmEmail(getUser()["userID"]);
|
||||||
echo "<script>
|
echo "<script>
|
||||||
window.onload=emailNotConfirmed();
|
window.onload=emailNotConfirmed();
|
||||||
</script>";
|
</script>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$_SESSION["userID"] = $userID;
|
$_SESSION["userID"] = $userID;
|
||||||
header("location: profile.php");
|
if(!isset($url) or $url == "") {
|
||||||
|
header("location: profile.php");
|
||||||
|
} else{
|
||||||
|
header("location: $url");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new loginException("Inloggevens zijn niet correct");
|
throw new loginException("Inloggevens zijn niet correct");
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// Checks if there's an user already logged in
|
||||||
|
if(isset($_SESSION["userID"])){
|
||||||
|
echo "<script>
|
||||||
|
window.onload=checkLoggedIn();
|
||||||
|
</script>";
|
||||||
|
}
|
||||||
|
|
||||||
// Facebook variables
|
// Facebook variables
|
||||||
$appID = "353857824997532";
|
$appID = "353857824997532";
|
||||||
@@ -20,13 +28,22 @@ $fbDay_date = $fbMonth_date = $fbYear_date = "";
|
|||||||
$user = $psw = $remember ="";
|
$user = $psw = $remember ="";
|
||||||
$loginErr = $resetErr = $fbRegisterErr ="";
|
$loginErr = $resetErr = $fbRegisterErr ="";
|
||||||
|
|
||||||
|
//if ($_SERVER["REQUEST_METHOD"] == "GET") {
|
||||||
|
// try {
|
||||||
|
// $user = ($_POST["user"]);
|
||||||
|
// validateLogin($_POST["user"], $_POST["psw"], "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
|
||||||
|
// } catch(loginException $e) {
|
||||||
|
// $loginErr = $e->getMessage();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
// Checks for which button is pressed
|
// Checks for which button is pressed
|
||||||
switch ($_POST["submit"]) {
|
switch ($_POST["submit"]) {
|
||||||
case "login":
|
case "login":
|
||||||
try {
|
try {
|
||||||
$user = ($_POST["user"]);
|
$user = ($_POST["user"]);
|
||||||
validateLogin($_POST["user"], $_POST["psw"]);
|
validateLogin($_POST["user"], $_POST["psw"], $_POST["url"]);
|
||||||
} catch(loginException $e) {
|
} catch(loginException $e) {
|
||||||
$loginErr = $e->getMessage();
|
$loginErr = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
return=$correct
|
return=$correct
|
||||||
method="post"
|
method="post"
|
||||||
name="login">
|
name="login">
|
||||||
|
<input type="hidden"
|
||||||
|
name="url"
|
||||||
|
value="<?= $_GET["url"] ?>"/>
|
||||||
|
|
||||||
<!-- Login name -->
|
<!-- Login name -->
|
||||||
<div class="login_containerlogin">
|
<div class="login_containerlogin">
|
||||||
@@ -68,75 +71,6 @@
|
|||||||
<!--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 . '"><i class="fa fa-facebook-square"></i> login met 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>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
// Get the modal
|
|
||||||
var modal = document.getElementById('myModal');
|
|
||||||
var registerModal = document.getElementById('registerModal');
|
|
||||||
var facebookModal = document.getElementById("fbModal");
|
|
||||||
|
|
||||||
// Get the button that opens the modal
|
|
||||||
var registerBtn = document.getElementById("registerBtn");
|
|
||||||
var btn = document.getElementById("myBtn");
|
|
||||||
|
|
||||||
|
|
||||||
// Get the <span> element that closes the modal
|
|
||||||
var span = document.getElementsByClassName("close")[0];
|
|
||||||
var registerSpan = document.getElementsByClassName("close")[1];
|
|
||||||
var facebookCLose = document.getElementsByClassName("close")[2];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When the user clicks the button, open the modal
|
|
||||||
*/
|
|
||||||
btn.onclick = function () {
|
|
||||||
modal.style.display = "block";
|
|
||||||
|
|
||||||
}
|
|
||||||
registerBtn.onclick = function () {
|
|
||||||
registerModal.style.display = "block";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WHen the user clicks on (X), close the modal
|
|
||||||
*/
|
|
||||||
span.onclick = function () {
|
|
||||||
modal.style.display = "none";
|
|
||||||
}
|
|
||||||
registerSpan.onclick = function () {
|
|
||||||
registerModal.style.display = "none";
|
|
||||||
}
|
|
||||||
facebookCLose.onclick = function () {
|
|
||||||
facebookModal.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When the user clicks anywhere outside of the modal, close it
|
|
||||||
*/
|
|
||||||
window.onclick = function (event) {
|
|
||||||
if (event.target == modal) {
|
|
||||||
modal.style.display = "none";
|
|
||||||
}
|
|
||||||
if (event.target == registerModal) {
|
|
||||||
registerModal.style.display = "none";
|
|
||||||
}
|
|
||||||
if (event.target == facebookModal) {
|
|
||||||
facebookModal.style.display = "none";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When ESC is pressed, close modal
|
|
||||||
*/
|
|
||||||
document.addEventListener('keyup', function(e) {
|
|
||||||
if (e.keyCode == 27) {
|
|
||||||
modal.style.display = "none";
|
|
||||||
registerModal.style.display = "none";
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user