Merge branch 'master' into hendrik-search
This commit is contained in:
@@ -16,7 +16,6 @@ while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$name = $group['name'];
|
||||
$role = $group['status'];
|
||||
$description = $group['description'];
|
||||
$function = "checkCheckAll(document.getElementById('checkall'))";
|
||||
|
||||
echo("
|
||||
<tr>
|
||||
@@ -25,15 +24,14 @@ while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
class='checkbox-list'
|
||||
value='$groupID'
|
||||
form='admin-groupbatchform'
|
||||
onchange='$function'>
|
||||
onchange='checkCheckAll();'>
|
||||
</td>
|
||||
<td>$name</td>
|
||||
<td>$role</td>
|
||||
<td>$description</td>
|
||||
<td>
|
||||
<form class='admin-groupaction'
|
||||
action='API/adminChangeUser.php'
|
||||
method='post'>
|
||||
onsubmit=\"adminUpdate(this); return false;\">
|
||||
<select class='action' name='actions'>
|
||||
<option value='hidden'>Hidden</option>
|
||||
<option value='public'>Public</option>
|
||||
|
||||
@@ -5,27 +5,26 @@ if ($pagetype == "user") {
|
||||
$pages = countSomeGroupsByStatus($search, $groupstatus);
|
||||
}
|
||||
$countresults = $pages->fetchColumn();
|
||||
$mincount = min($listm, $countresults);
|
||||
$minlist = min($listn + 1, $countresults);
|
||||
|
||||
?>
|
||||
Pagina: <form class="admin-pageselector"
|
||||
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
|
||||
method="post">
|
||||
<select class="admin-pageselect"
|
||||
name="pageselect"
|
||||
onchange="this.form.submit()"
|
||||
value="">
|
||||
<?php
|
||||
for ($i=1; $i <= ceil($countresults / $perpage); $i++) {
|
||||
if ($currentpage == $i) {
|
||||
echo "<option value='$i' selected>$i</option>";
|
||||
} else {
|
||||
echo "<option value='$i'>$i</option>";
|
||||
}
|
||||
Pagina:
|
||||
<select class="admin-pageselect"
|
||||
name="currentpage"
|
||||
id="currentpage"
|
||||
form="admin-searchform"
|
||||
onchange="adminSearch();">
|
||||
<?php
|
||||
for ($i=1; $i <= ceil($countresults / $entries); $i++) {
|
||||
if ($currentpage == $i) {
|
||||
echo "<option value='$i' selected>$i</option>";
|
||||
} else {
|
||||
echo "<option value='$i'>$i</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</form>
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
echo "$minlist tot $mincount ($countresults totaal)";
|
||||
$n = min($offset + 1, $countresults);
|
||||
$m = min($offset + $entries, $countresults);
|
||||
echo " $n tot $m ($countresults totaal)";
|
||||
?>
|
||||
@@ -1,5 +1,5 @@
|
||||
<tr>
|
||||
<th><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll(this)"></th>
|
||||
<th><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll()"></th>
|
||||
<th class="table-username">Gebruikersnaam</th>
|
||||
<th class="table-status">Status</th>
|
||||
<th class="table-comment">Aantekening</th>
|
||||
@@ -14,7 +14,6 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$username = $user['username'];
|
||||
$role = $user['role'];
|
||||
$bancomment = $user['bancomment'];
|
||||
$function = "checkCheckAll(document.getElementById('checkall'))";
|
||||
|
||||
echo("
|
||||
<tr>
|
||||
@@ -24,20 +23,47 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
class='checkbox-list'
|
||||
value='$userID'
|
||||
form='admin-batchform'
|
||||
onchange='$function'>
|
||||
onchange='checkCheckAll();'>
|
||||
</td>
|
||||
<td>$username</td>
|
||||
<td>$role</td>
|
||||
<td>$bancomment</td>
|
||||
<td>
|
||||
<div class='bancomment'>$bancomment</div>
|
||||
<div class='bancommentedit'>
|
||||
<form class='bancommentform'
|
||||
id='bancommentform'
|
||||
onsubmit='editComment(this);
|
||||
return false;'>
|
||||
<input type='text'
|
||||
name='bancommenttext'
|
||||
placeholder='Schrijf een aantekening'
|
||||
value='$bancomment'>
|
||||
<input type='hidden'
|
||||
name='bancommentuserID'
|
||||
value='$userID'>
|
||||
<button type='submit'>Update</button>
|
||||
</form>
|
||||
</div>
|
||||
<button type='button' onclick='toggleBancomment(this)'>Verander</button>
|
||||
</td>
|
||||
<td>
|
||||
<form class='admin-useraction'
|
||||
action='API/adminChangeUser.php'
|
||||
method='post'>
|
||||
<select class='action' name='actions'>
|
||||
<option value='frozen'>Bevries</option>
|
||||
<option value='banned'>Ban</option>
|
||||
<option value='user'>Activeer</option>
|
||||
</select>
|
||||
onsubmit=\"adminUpdate(this); return false;\">
|
||||
<select class='action' name='actions'>");
|
||||
if (!($userinfo == 'admin'
|
||||
AND ($user['role'] == 'admin'
|
||||
OR $user['role'] == 'owner'))) {
|
||||
echo "<option value='frozen'>Bevries</option>
|
||||
<option value='banned'>Ban</option>
|
||||
<option value='user'>Activeer</option>";
|
||||
|
||||
if ($userinfo == 'owner') {
|
||||
echo "<option value='admin'>Admin</option>
|
||||
<option value='owner'>Owner</option>";
|
||||
}
|
||||
}
|
||||
|
||||
echo ("</select>
|
||||
<input type='hidden' name='userID' value='$userID'>
|
||||
<input type='submit' value='Confirm'>
|
||||
</form>
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
<!-- function test_input taken from http://www.w3schools.com/php/php_form_validation.asp -->
|
||||
<?php
|
||||
$search = "";
|
||||
$currentpage = 1;
|
||||
$perpage = 20;
|
||||
$status = array("user", "frozen", "banned", "unconfirmed", "admin", "owner");
|
||||
$groupstatus = array("hidden", "public", "membersonly");
|
||||
$pagetype = "user";
|
||||
$userinfo = getRoleByID($_SESSION['userID']);
|
||||
|
||||
if (isset($_GET["search"])) {
|
||||
$search = test_input($_GET["search"]);
|
||||
@@ -24,13 +23,6 @@ if (isset($_GET["groupstatus"])) {
|
||||
$groupstatus = $_GET["groupstatus"];
|
||||
}
|
||||
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if (isset($_POST["pageselect"])) {
|
||||
$currentpage = $_POST["pageselect"];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
@@ -39,7 +31,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
<div class="admin-options">
|
||||
<form class="admin-searchform"
|
||||
id="admin-searchform"
|
||||
action="javascript:adminSearch();"
|
||||
action="javascript:searchFromOne();"
|
||||
method="get">
|
||||
|
||||
<div class="admin-searchbar">
|
||||
@@ -120,23 +112,33 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
<div class="admin-users">
|
||||
<div class="admin-usertitle">
|
||||
<h4>Resultaat:</h4>
|
||||
<span style="float: right" id="admin-pageinfo">
|
||||
<div style="float: right" id="admin-pageinfo">
|
||||
|
||||
</span>
|
||||
<form
|
||||
id="admin-batchform"
|
||||
action="API/adminChangeUser.php"
|
||||
method="post">
|
||||
</div>
|
||||
<form id="admin-batchform"
|
||||
onsubmit="adminUpdate(this); return false;">
|
||||
|
||||
<input type="hidden" name="batchactions" id="batchinput">
|
||||
<button type="submit" name="batchactions" id="freeze" value="frozen">Bevries</button>
|
||||
<button type="submit" name="batchactions" id="ban" value="banned">Ban</button>
|
||||
<button type="submit" name="batchactions" id="restore" value="user">Activeer</button>
|
||||
<?php
|
||||
if ($userinfo == 'owner') {
|
||||
echo "<button type=\"submit\"
|
||||
name=\"batchactions\"
|
||||
id=\"admin\"
|
||||
value=\"admin\">Maak Admin</button>
|
||||
<button type=\"submit\"
|
||||
name=\"batchactions\"
|
||||
id=\"owner\"
|
||||
value=\"owner\">Maak Owner</button>";
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<form
|
||||
id="admin-groupbatchform"
|
||||
action="API/adminChangeUser.php"
|
||||
method="post">
|
||||
<form id="admin-groupbatchform"
|
||||
onsubmit="adminUpdate(this); return false;">
|
||||
|
||||
<input type="hidden" name="groupbatchactions" id="groupbatchinput">
|
||||
<button type="submit" name="batchactions" id="hide" value="hidden">Hide</button>
|
||||
<button type="submit" name="batchactions" id="ban" value="public">Public</button>
|
||||
<button type="submit" name="batchactions" id="members" value="membersonly">Members</button>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<select name="day_date" >
|
||||
<option>dag</option>
|
||||
<!--All the days-->
|
||||
<select name="day_date" autocomplete="bday-day">
|
||||
<option>Dag</option>
|
||||
<?php
|
||||
for($i=1; $i<32; $i++) {
|
||||
$i = sprintf("%02d", $i);
|
||||
@@ -9,7 +10,8 @@
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<select name="month_date">
|
||||
<!--All the months-->
|
||||
<select name="month_date" autocomplete="bday-month">
|
||||
<option>Maand</option>
|
||||
<option value="01" <?php submitselect($month_date, "01")?>>januari</option>
|
||||
<option value="02" <?php submitselect($month_date, "02")?>>februari</option>
|
||||
@@ -24,11 +26,12 @@
|
||||
<option value="11" <?php submitselect($month_date, "11")?>>november</option>
|
||||
<option value="12" <?php submitselect($month_date, "12")?>>december</option>
|
||||
</select>
|
||||
<select name="year_date">
|
||||
<!--All the year from 1900 till current year-->
|
||||
<select name="year_date" autocomplete="bday-year">
|
||||
<option>Jaar</option>
|
||||
<?php
|
||||
$year = (new DateTime)->format("Y");
|
||||
for($i=$year; $i > $year - 100; $i--) {
|
||||
for($i=$year; $i >= 1900; $i--) {
|
||||
?>
|
||||
<option value="<?= $i ?>" <?php submitselect($year_date, $i)?>><?= $i ?></option>
|
||||
<?php
|
||||
|
||||
94
website/views/facebookRegisterModal.php
Normal file
94
website/views/facebookRegisterModal.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<!-- The Modal -->
|
||||
<div id="fbModal" class="modal">
|
||||
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
|
||||
return= $correct
|
||||
method="post"
|
||||
name="fbModal">
|
||||
|
||||
<!-- Modal content -->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<span class="close">×</span>
|
||||
<h3>Voer uw gegevens in</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="login_containerfault"><span><?php echo $fbRegisterErr; ?></span></div>
|
||||
<div class="login_containerfault"><span><?php echo $fbEmailErr; ?></span></div>
|
||||
<!-- Register username -->
|
||||
<div class="login_containerregister">
|
||||
<label><b>Gebruikersnaam</b></label>
|
||||
<input type="text"
|
||||
placeholder="Voer uw gebruikersnaam in"
|
||||
name="fbUsername"
|
||||
value="<?php echo $fbUsername ?>"
|
||||
title="Moet minimaal 6 karakters bevatten"
|
||||
required>
|
||||
*<span class="error"> <?php echo $fbUsernameErr;?></span>
|
||||
<ul>
|
||||
<li>Minstens 6 karakters</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Register password -->
|
||||
<div class="login_containerregister">
|
||||
<label><b>Wachtwoord</b></label>
|
||||
<input type="password"
|
||||
placeholder="Voer uw wachtwoord in"
|
||||
name="fbPassword"
|
||||
value="<?php echo $fbPassword ?>"
|
||||
id="password"
|
||||
required>
|
||||
*<span class="error"> <?php echo $fbPasswordErr;?></span>
|
||||
<ul>
|
||||
<li>Minstens 8 karakters</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Repeat password -->
|
||||
<div class="login_containerregister">
|
||||
<label><b>Herhaal wachtwoord</b></label>
|
||||
<input type="password"
|
||||
placeholder="Herhaal wachtwoord"
|
||||
name="fbConfirmpassword"
|
||||
value="<?php echo $fbConfirmpassword ?>"
|
||||
id="confirmpassword"
|
||||
title="Herhaal wachtwoord">
|
||||
*<span class="error"> <?php echo $fbConfirmpasswordErr;?></span>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if(empty($userBday)) { ?>
|
||||
<!-- Register birthday -->
|
||||
<div class="login_containerregister">
|
||||
<label><b>Geboortedatum</b></label>
|
||||
<?php
|
||||
include("../views/fbBdayInput.php");
|
||||
?>
|
||||
*<span class="error"> <?php echo $fbBdayErr;?></span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit"
|
||||
value="fbRegister"
|
||||
name="submit"
|
||||
id="frm1_submit">
|
||||
Registreer account
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="fbName"
|
||||
value="<?php echo $fbName ?>">
|
||||
<input type="hidden"
|
||||
name="fbSurname"
|
||||
value="<?php echo $fbSurname ?>">
|
||||
<input type="hidden"
|
||||
name="fbUserID"
|
||||
value="<?php echo $fbUserID ?>">
|
||||
<input type="hidden"
|
||||
name="fbEmail"
|
||||
value="<?php echo $fbEmail ?>">
|
||||
</form>
|
||||
</div>
|
||||
40
website/views/fbBdayInput.php
Normal file
40
website/views/fbBdayInput.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<!--All the days-->
|
||||
<select name="fbDay_date" autocomplete="bday-day">
|
||||
<option>Dag</option>
|
||||
<?php
|
||||
for($i=1; $i<32; $i++) {
|
||||
$i = sprintf("%02d", $i);
|
||||
?>
|
||||
<option value="<?= $i ?>" <?php submitselect($fbDay_date, $i)?>><?= $i ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<!--All the months-->
|
||||
<select name="fbMonth_date" autocomplete="bday-month">
|
||||
<option>Maand</option>
|
||||
<option value="01" <?php submitselect($fbMonth_date, "01")?>>januari</option>
|
||||
<option value="02" <?php submitselect($fbMonth_date, "02")?>>februari</option>
|
||||
<option value="03" <?php submitselect($fbMonth_date, "03")?>>maart</option>
|
||||
<option value="04" <?php submitselect($fbMonth_date, "04")?>>april</option>
|
||||
<option value="05" <?php submitselect($fbMonth_date, "05")?>>mei</option>
|
||||
<option value="06" <?php submitselect($fbMonth_date, "06")?>>juni</option>
|
||||
<option value="07" <?php submitselect($fbMonth_date, "07")?>>juli</option>
|
||||
<option value="08" <?php submitselect($fbMonth_date, "08")?>>augustus</option>
|
||||
<option value="09" <?php submitselect($fbMonth_date, "09")?>>september</option>
|
||||
<option value="10" <?php submitselect($fbMonth_date, "10")?>>oktober</option>
|
||||
<option value="11" <?php submitselect($fbMonth_date, "11")?>>november</option>
|
||||
<option value="12" <?php submitselect($fbMonth_date, "12")?>>december</option>
|
||||
</select>
|
||||
<!--All the year from 1900 till current year-->
|
||||
<select name="fbYear_date" autocomplete="bday-year">
|
||||
<option>Jaar</option>
|
||||
<?php
|
||||
$year = (new DateTime)->format("Y");
|
||||
for($i=$year; $i >= 1900; $i--) {
|
||||
?>
|
||||
<option value="<?= $i ?>" <?php submitselect($fbYear_date, $i)?>><?= $i ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -19,7 +19,8 @@
|
||||
class="middle"
|
||||
placeholder="Voer uw email in"
|
||||
name="forgotEmail"
|
||||
title="Voer een email in">
|
||||
title="Voer een email in"
|
||||
required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="login_containerfault"><span><?php echo $resetErr; ?></span></div>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<div class="content">
|
||||
<div class="profile-box platform">
|
||||
<img class="left main-picture" src="<?= $group['picture'] ?>">
|
||||
<div class="profile-button">
|
||||
<p><img src="img/leave-group.png"> Groep verlaten</p>
|
||||
</div>
|
||||
<img class="left main-picture group-picture" src="<?= $group['picture'] ?>">
|
||||
<div class="group-button-container"></div>
|
||||
<h1 class="profile-username"><?= $group['name'] ?></h1>
|
||||
<p><?= $group['description'] ?></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="item-box-full-width platform">
|
||||
|
||||
@@ -19,9 +19,12 @@
|
||||
|
||||
require_once ("../queries/checkInput.php");
|
||||
require_once ("../queries/connect.php");
|
||||
require_once ("../queries/user.php");
|
||||
|
||||
session_start();
|
||||
|
||||
if(!isset($_SESSION["userID"])){
|
||||
header("location:login.php");
|
||||
}
|
||||
} else {
|
||||
updateLastActivity();
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ $userinfo = getHeaderInfo();
|
||||
</div>
|
||||
<?=$userinfo["fname"]?>
|
||||
</div>
|
||||
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/>
|
||||
<i id="open-notifications" class="fa fa-bars"></i>
|
||||
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/><i id="open-notifications" class="fa fa-bars"></i>
|
||||
</div>
|
||||
</header>
|
||||
<?php include("notification-center.php"); ?>
|
||||
|
||||
114
website/views/homeLoginRegister.php
Normal file
114
website/views/homeLoginRegister.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
// Facebook variables
|
||||
$appID = "353857824997532";
|
||||
$appSecret = "db47e91ffbfd355fdd11b4b65eade851";
|
||||
$fbUsername = $fbPassword = $fbConfirmpassword = "";
|
||||
$fbUsernameErr = $fbPasswordErr = $fbConfirmpasswordErr = $fbEmailErr = $fbBdayErr = "";
|
||||
$fbCorrect = true;
|
||||
$fbName = $fbSurname = $fbBday = $fbEmail = $fbUserID = "";
|
||||
$bdayExist = false;
|
||||
|
||||
// Register variables
|
||||
$name = $surname = $bday = $username = $password = $confirmpassword = $location = $housenumber = $email = $confirmEmail = $captcha = $ip = "";
|
||||
$genericErr = $nameErr = $surnameErr = $bdayErr = $usernameErr = $passwordErr = $confirmpasswordErr = $locationErr = $housenumberErr = $emailErr = $confirmEmailErr = $captchaErr = "";
|
||||
$correct = true;
|
||||
|
||||
$day_date = $month_date = $year_date = "";
|
||||
$fbDay_date = $fbMonth_date = $fbYear_date = "";
|
||||
|
||||
// Login variables
|
||||
$user = $psw = $remember ="";
|
||||
$loginErr = $resetErr = $fbRegisterErr ="";
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
// Checks for which button is pressed
|
||||
switch ($_POST["submit"]) {
|
||||
case "login":
|
||||
try {
|
||||
$user = ($_POST["user"]);
|
||||
validateLogin($_POST["user"], $_POST["psw"]);
|
||||
} catch(loginException $e) {
|
||||
$loginErr = $e->getMessage();
|
||||
}
|
||||
break;
|
||||
case "reset":
|
||||
try {
|
||||
resetEmail($_POST["forgotEmail"]);
|
||||
sendPasswordRecovery($_POST["forgotEmail"]);
|
||||
} catch (emailException $e){
|
||||
$resetErr = $e->getMessage();
|
||||
echo "<script>
|
||||
window.onload = function() {
|
||||
$('#myModal').show();
|
||||
}
|
||||
</script>";
|
||||
}
|
||||
break;
|
||||
case "register":
|
||||
include("register.php");
|
||||
break;
|
||||
case "fbRegister":
|
||||
include("fbRegister.php");
|
||||
break;
|
||||
}
|
||||
}
|
||||
$fb = new Facebook\Facebook([
|
||||
'app_id' => $appID,
|
||||
'app_secret' => $appSecret,
|
||||
'default_graph_version' => 'v2.2',
|
||||
]);
|
||||
$redirect = "https://myhyvesbookplus.nl/login.php";
|
||||
$helper = $fb->getRedirectLoginHelper();
|
||||
|
||||
try {
|
||||
// Returns a `Facebook\FacebookResponse` object
|
||||
$acces_token = $helper->getAccessToken();
|
||||
} catch(Facebook\Exceptions\FacebookResponseException $e) {
|
||||
echo 'Graph returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
} catch(Facebook\Exceptions\FacebookSDKException $e) {
|
||||
echo 'Facebook SDK returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!isset($acces_token)){
|
||||
$permission=["email", "user_birthday"];
|
||||
$loginurl=$helper->getLoginUrl($redirect,$permission);
|
||||
}else {
|
||||
$fb->setDefaultAccessToken($acces_token);
|
||||
$response = $fb->get('/me?fields=email,name,birthday');
|
||||
$usernode = $response->getGraphUser();
|
||||
|
||||
$nameSplit = explode(" ", $usernode->getName());
|
||||
$fbName = $nameSplit[0];
|
||||
$fbSurname = $nameSplit[1];
|
||||
$fbUserID = $usernode->getID();
|
||||
$fbEmail = $usernode->getProperty("email");
|
||||
// $image = 'https://graph.facebook.com/' . $usernode->getId() . '/picture?width=200';
|
||||
|
||||
if (fbLogin($fbUserID) == 1) {
|
||||
$fbID = getfbUserID($fbUserID)["userID"];
|
||||
$fbRole = getfbUserID($fbUserID)["role"];
|
||||
if($fbRole == "banned"){
|
||||
echo "<script>
|
||||
window.onload=bannedAlert();
|
||||
</script>";
|
||||
} else if($fbRole == "frozen"){
|
||||
$_SESSION["userID"] = $fbID;
|
||||
echo "<script>
|
||||
window.onload=frozenAlert();
|
||||
window.location.href= 'profile.php';
|
||||
</script>";
|
||||
} else {
|
||||
$_SESSION["userID"] = $fbID;
|
||||
header("location: profile.php");
|
||||
}
|
||||
} else {
|
||||
echo "<script>
|
||||
window.onload = function() {
|
||||
$('#fbModal').show();
|
||||
}
|
||||
</script>";
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
name="user"
|
||||
value="<?php echo $user ?>"
|
||||
title="Moet een geldige gebruiker zijn"
|
||||
>
|
||||
required>
|
||||
</div>
|
||||
|
||||
<!-- Login password -->
|
||||
@@ -31,7 +31,7 @@
|
||||
placeholder="Voer uw wachtwoord in"
|
||||
name="psw"
|
||||
title="Moet minstens 8 karakters lang zijn"
|
||||
>
|
||||
required>
|
||||
</div>
|
||||
|
||||
<!-- Error message -->
|
||||
@@ -47,58 +47,68 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="login_containerlogin">
|
||||
<label><b>Onthoud mij</b></label>
|
||||
<input type="checkbox" name="rememberMe" value=1><br>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Button for going to the register screen -->
|
||||
<!--Vieuws for the modals-->
|
||||
<div class="login_containerlogin">
|
||||
<!-- <a href="https://myhyvesbookplus.nl/register" class="button">Registreer een account</a>-->
|
||||
|
||||
<?php
|
||||
include("../views/forgotPasswordModal.php");
|
||||
include("../views/registerModal.php");
|
||||
include("../views/facebookRegisterModal.php");
|
||||
?>
|
||||
|
||||
</div>
|
||||
<!--Login with facebook button-->
|
||||
<?php
|
||||
if(!isset($acces_token)) {
|
||||
echo '<div class="login_containerlogin"><a class="fbButton" href="' . $loginurl . '">login with Facebook!</a></div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
// Get the button that opens the modal
|
||||
// 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 modal
|
||||
var registerModal = document.getElementById('registerModal');
|
||||
var registerBtn = document.getElementById("registerBtn");
|
||||
|
||||
// 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
|
||||
/**
|
||||
* When the user clicks the button, open the modal
|
||||
*/
|
||||
btn.onclick = function () {
|
||||
// modal.style.display = "block";
|
||||
modal.style.display = "block";
|
||||
window.onload=emailSent();
|
||||
|
||||
}
|
||||
|
||||
registerBtn.onclick = function () {
|
||||
registerModal.style.display = "block";
|
||||
}
|
||||
|
||||
// When the user clicks on <span> (x), close the modal
|
||||
/**
|
||||
* 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
|
||||
/**
|
||||
* When the user clicks anywhere outside of the modal, close it
|
||||
*/
|
||||
window.onclick = function (event) {
|
||||
if (event.target == modal) {
|
||||
modal.style.display = "none";
|
||||
@@ -106,5 +116,20 @@ var registerSpan = document.getElementsByClassName("close")[1];
|
||||
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>
|
||||
@@ -7,9 +7,9 @@
|
||||
include_once ("../queries/user.php");
|
||||
|
||||
// auth
|
||||
$userinfo = getRoleByID($_SESSION['userID'])->fetch(PDO::FETCH_ASSOC);
|
||||
$role = getRoleByID($_SESSION['userID']);
|
||||
|
||||
if ($userinfo['role'] == 'admin' OR $userinfo['role'] == 'owner') {
|
||||
if ($role == 'admin' OR $role == 'owner') {
|
||||
echo "<a href=\"admin.php\" data-title=\"Admin\"><i class=\"fa fa-lock\"></i></a>";
|
||||
echo "<style>@import url('styles/adminbutton.css'); </style>";
|
||||
}
|
||||
|
||||
@@ -2,29 +2,34 @@
|
||||
$postID = $_GET['postID'];
|
||||
$post = selectPostById($postID)->fetch(PDO::FETCH_ASSOC);
|
||||
$fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . ")";
|
||||
session_start();
|
||||
|
||||
echo("
|
||||
?>
|
||||
<div class='post-header header'>
|
||||
<h4>" . $post['title'] . "</h4>
|
||||
<h4><?=$post['title']?></h4>
|
||||
<?php if (checkPermissionOnPost($postID, $_SESSION["userID"])) {?>
|
||||
<button class="deleteButton"
|
||||
onclick="deletePost('<?=$postID?>')"
|
||||
type="submit">
|
||||
<i class="fa fa-trash"></i>
|
||||
<span>Verwijder post</span>
|
||||
</button><br />
|
||||
<?php } ?>
|
||||
<span class='postinfo'>
|
||||
gepost door $fullname,
|
||||
<span class='posttime' title='" . $post['creationdate'] . "'>
|
||||
" . nicetime($post['creationdate']) . "
|
||||
gepost door <?=$fullname?>,
|
||||
<span class='posttime' title='<?=$post['creationdate']?>'>
|
||||
<?=nicetime($post['creationdate'])?>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class='post-content'>
|
||||
<p>" . $post['content'] . "</p>
|
||||
<p><?=$post['content']?></p>
|
||||
</div>
|
||||
"); ?>
|
||||
|
||||
<div class='post-comments'>
|
||||
<div class="commentfield">
|
||||
<form id="newcommentform" onsubmit="return false;">
|
||||
<input type="hidden" id="newcomment-textarea" name="postID" value="<?= $postID ?>">
|
||||
<textarea id="newcomment" name="newcomment-content" placeholder="Laat een reactie achter..."></textarea> <br>
|
||||
<textarea id="newcomment" name="newcomment-content" placeholder="Laat een reactie achter..." maxlength="1000"></textarea><span></span> <br>
|
||||
<button onclick="postComment('reaction')" name="button" value="reaction">Reageer!</button>
|
||||
<button onclick="postComment('nietslecht')" name="button" value="nietslecht" class="nietslecht">
|
||||
<?php
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="content">
|
||||
<div class="user-box">
|
||||
<img class="profile-picture main-picture" src="<?= $user["profilepicture"] ?>"><br />
|
||||
<img class="profile-picture main-picture <?= $user["onlinestatus"] ?>" src="<?= $user["profilepicture"] ?>"><br />
|
||||
<div class="platform">
|
||||
<div class="status-buttons-container">
|
||||
<button disabled class="gray">
|
||||
<?= $user["onlinestatus"] ?>
|
||||
<?= $user["onlinestatus"] ?>
|
||||
</button>
|
||||
<button disabled class="gray"><?= $user["role"] ?></button>
|
||||
</div>
|
||||
@@ -29,7 +29,7 @@
|
||||
<h3>Informatie</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li>Geboren op: <?= $user["birthdate"] ?></li>
|
||||
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
|
||||
<li>Locatie: <?= $user["location"] ?></li>
|
||||
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
|
||||
</ul>
|
||||
@@ -71,6 +71,10 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="noposts platform">
|
||||
<p>Geen posts meer!</p>
|
||||
</div>
|
||||
|
||||
<div class="modal">
|
||||
<div class="modal-content platform">
|
||||
<div class="modal-close">
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
name="name"
|
||||
value="<?php echo $name ?>"
|
||||
title="Mag alleen letters bevatten"
|
||||
>
|
||||
required
|
||||
autocomplete="given-name">
|
||||
*<span class="error"><?php echo $nameErr;?></span>
|
||||
|
||||
</div>
|
||||
@@ -44,7 +45,8 @@
|
||||
name="surname"
|
||||
value="<?php echo $surname ?>"
|
||||
title="Mag alleen letters bevatten"
|
||||
>
|
||||
required
|
||||
autocomplete="family-name">
|
||||
*<span class="error"> <?php echo $surnameErr;?></span>
|
||||
</div>
|
||||
|
||||
@@ -65,7 +67,7 @@
|
||||
name="username"
|
||||
value="<?php echo $username ?>"
|
||||
title="Moet minimaal 6 karakters bevatten"
|
||||
>
|
||||
required>
|
||||
*<span class="error"> <?php echo $usernameErr;?></span>
|
||||
<ul>
|
||||
<li>Minstens 6 karakters</li>
|
||||
@@ -81,7 +83,7 @@
|
||||
name="password"
|
||||
value="<?php echo $password ?>"
|
||||
id="password"
|
||||
>
|
||||
required>
|
||||
*<span class="error"> <?php echo $passwordErr;?></span>
|
||||
<ul>
|
||||
<li>Minstens 8 karakters</li>
|
||||
@@ -96,7 +98,7 @@
|
||||
value="<?php echo $confirmpassword ?>"
|
||||
id="confirmpassword"
|
||||
title="Herhaal wachtwoord"
|
||||
>
|
||||
required>
|
||||
*<span class="error"> <?php echo $confirmpasswordErr;?></span>
|
||||
</div>
|
||||
|
||||
@@ -109,7 +111,6 @@
|
||||
value="<?php echo $location ?>"
|
||||
pattern="[A-Za-z]{1,}"
|
||||
title="Mag alleen letters bevatten">
|
||||
*<span class="error"> <?php echo $locationErr;?></span>
|
||||
</div>
|
||||
|
||||
<!-- Register email -->
|
||||
@@ -120,7 +121,8 @@
|
||||
name="email"
|
||||
value="<?php echo $email ?>"
|
||||
id="email"
|
||||
title="Voer een geldige email in">
|
||||
title="Voer een geldige email in"
|
||||
required>
|
||||
*<span class="error"> <?php echo $emailErr;?></span>
|
||||
</div>
|
||||
|
||||
@@ -132,10 +134,12 @@
|
||||
name="confirmEmail"
|
||||
value="<?php echo $confirmEmail ?>"
|
||||
id="email"
|
||||
title="Herhaal uw email">
|
||||
title="Herhaal uw email"
|
||||
required>
|
||||
*<span class="error"> <?php echo $confirmEmailErr;?></span>
|
||||
</div>
|
||||
|
||||
<!-- Captcha confirm -->
|
||||
<div class="login_containerregister">
|
||||
<div class="g-recaptcha" data-sitekey="6Lc72xIUAAAAADumlWetgENm7NGd9Npyo0c_tYYQ">
|
||||
</div>
|
||||
@@ -145,6 +149,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="login_containerfault"><span><?php echo $resetErr; ?></span></div>
|
||||
<!-- Register button -->
|
||||
<button type="submit"
|
||||
value="register"
|
||||
name="submit"
|
||||
|
||||
@@ -75,6 +75,9 @@ $settings = getSettings();
|
||||
<?=$year?>
|
||||
</option>
|
||||
<?php endfor; ?>
|
||||
<option value="680" <?=(680 == $currentbday->format("Y")) ? "selected" : ""?>>
|
||||
680
|
||||
</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
@@ -99,7 +102,8 @@ $settings = getSettings();
|
||||
rows="5"
|
||||
title="bio"
|
||||
id="bio"
|
||||
><?=$settings["bio"]?></textarea>
|
||||
maxlength="1000"
|
||||
><?=$settings["bio"]?></textarea><span></span>
|
||||
</li>
|
||||
<li>
|
||||
<label></label>
|
||||
|
||||
Reference in New Issue
Block a user