Merge branch 'master' into joey-testing

This commit is contained in:
Joey Lai
2017-02-03 10:48:14 +01:00
54 changed files with 944 additions and 239 deletions

View File

@@ -1,8 +1,8 @@
<tr>
<th><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll(this)"></th>
<th class="table-username">Gebruikersnaam</th>
<th class="table-username">Groepsnaam</th>
<th class="table-status">Status</th>
<th class="table-comment">Aantekening</th>
<th class="table-comment">Beschrijving</th>
<th class="table-action">Actie</th>
</tr>
@@ -33,9 +33,9 @@ while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
<form class='admin-groupaction'
onsubmit=\"adminUpdate(this); return false;\">
<select class='action' name='actions'>
<option value='hidden'>Hidden</option>
<option value='public'>Public</option>
<option value='membersonly'>Members</option>
<option value='hidden'>Verborgen</option>
<option value='public'>Publiek</option>
<option value='membersonly'>Alleen Leden</option>
</select>
<input type='hidden' name='groupID' value='$groupID'>
<input type='submit' value='Confirm'>

View File

@@ -55,7 +55,8 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
OR $user['role'] == 'owner'))) {
echo "<option value='frozen'>Bevries</option>
<option value='banned'>Ban</option>
<option value='user'>Activeer</option>";
<option value='user'>Activeer</option>
<option value='unconfirmed'>Ongevalideerd</option>";
if ($userinfo == 'owner') {
echo "<option value='admin'>Admin</option>

View File

@@ -67,13 +67,13 @@ if (isset($_GET["groupstatus"])) {
id="frozen"
value="frozen"
<?php if (in_array("frozen", $status)) echo "checked";?>>
<label for="frozen">Gefrozen</label><br>
<label for="frozen">Bevroren</label><br>
<input type="checkbox"
name="status[]"
id="banned"
value="banned"
<?php if (in_array("banned", $status)) echo "checked";?>>
<label for="banned">Gebant</label><br>
<label for="banned">Verbannen</label><br>
<input type="checkbox"
name="status[]"
id="admin"
@@ -91,7 +91,7 @@ if (isset($_GET["groupstatus"])) {
id="owner"
value="owner"
<?php if (in_array("owner", $status)) echo "checked";?>>
<label for="owner">Owner</label>
<label for="owner">Eigenaar</label>
</div>
<div id="admin-groupfilter">
@@ -122,6 +122,7 @@ if (isset($_GET["groupstatus"])) {
<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>
<button type="submit" name="batchactions" id="unconfirm" value="unconfirmed">Maak Ongevalideerd</button>
<?php
if ($userinfo == 'owner') {
echo "<button type=\"submit\"
@@ -131,7 +132,7 @@ if (isset($_GET["groupstatus"])) {
<button type=\"submit\"
name=\"batchactions\"
id=\"owner\"
value=\"owner\">Maak Owner</button>";
value=\"owner\">Maak Eigenaar</button>";
}
?>
</form>
@@ -139,9 +140,9 @@ if (isset($_GET["groupstatus"])) {
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>
<button type="submit" name="batchactions" id="hide" value="hidden">Verborgen</button>
<button type="submit" name="batchactions" id="ban" value="public">Publiek</button>
<button type="submit" name="batchactions" id="members" value="membersonly">Alleen Leden</button>
</form>
</div>

View File

@@ -0,0 +1,42 @@
<?php
?>
<div class="content">
<div class="createGroup">
<form class="platform settings" method="post" action="createGroup.php" enctype="multipart/form-data">
<h5>Maak een groep!</h5>
<ul>
<li>
<label for="groupName">Groepsnaam</label>
<input type="text"
name="groupName"
id="groupName"
maxlength="63"
placeholder="Groepsnaam"
>
</li>
<li>
<label for="bio">Bio</label>
<textarea name="bio"
rows="5"
title="bio"
id="bio"
maxlength="1000"
></textarea>
</li>
<li>
<label>Selecteer foto</label>
<input type="file"
name="pp"
accept="image/*"
size="4000000"
>
</li>
<li>
<label></label>
<button type="submit">Maak Groep</button>
</li>
</ul>
</form>
</div>
</div>

View File

@@ -1,12 +1,17 @@
<div class="content">
<div class="profile-box platform">
<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 class="user-box">
<img alt="<?= $group["name"] ?>" class="group-picture main-picture" src="<?= $group["picture"] ?>"><br />
<div class="platform">
<div class="status-buttons-container">
<button disabled class="gray"><?= $group["status"] ?></button>
</div>
<div class="group-button-container"></div>
<div class="profile-info">
<h2><?= $group["name"]?></h2>
<?= $group["description"] ?>
</div>
</div>
</div>
<div class="item-box-full-width platform">
<h2>Leden (<?= $group['members'] ?>)</h2>
<p>
@@ -22,6 +27,10 @@
</div>
<div class="noposts platform">
<p>Geen posts meer!</p>
</div>
<div class="modal">
<div class="modal-content platform">
<div class="modal-close">

View File

@@ -0,0 +1,126 @@
<?php
require_once "../queries/connect.php";
require_once "../queries/groupAdmin.php";
require_once "../queries/checkInput.php";
$groupinfo = getGroupSettings($_GET["groupID"]);
?>
<div class="content">
<div class="settings">
<?php if ($_SERVER["REQUEST_METHOD"] == "POST"): ?>
<div class='platform settings-message <?=$alertClass?>'>
<?=$alertMessage?>
</div>
<?php endif; ?>
<div class="platform">
<ul>
<li>
<label></label>
<a href="group.php?groupname=<?=$groupinfo["name"]?>">
<button class="fa fa-chevron-left"> Terug naar de groep</button>
</a>
</li>
</ul>
</div>
<form class="platform" method="post">
<h5>Groep Instellingen</h5>
<input type="hidden" name="groupID" value="<?=$_GET["groupID"]?>">
<ul>
<li>
<label for="name">Groepsnaam</label>
<input type="text"
name="name"
id="name"
maxlength="63"
placeholder="Groepsnaam"
title="Groepsnaam"
value="<?=$groupinfo["name"]?>"
>
</li>
<li>
<label for="bio">Bio</label>
<textarea name="bio"
rows="5"
title="bio"
id="bio"
maxlength="1000"
><?=$groupinfo["description"]?></textarea>
<label></label>
</li>
<li>
<label></label>
<button type="submit"
name="form"
value="group"
class="fa fa-save"
> Opslaan</button>
</li>
</ul>
</form>
<form class="platform" method="post" enctype="multipart/form-data">
<h5>Verander groepsafbeelding.</h5>
<input type="hidden" name="groupID" value="<?=$_GET["groupID"]?>">
<ul>
<li>
<label>Huidige profielfoto</label>
<img src="<?=$groupinfo["picture"]?>"
class="group-picture"
>
</li>
<li>
<label>Selecteer foto</label>
<input type="file"
name="pp"
accept="image/*"
size="4000000"
required
>
</li>
<li>
<label></label>
<button type="submit"
name="form"
value="picture"
class="fa fa-picture-o"
> Verander profielfoto</button>
</li>
</ul>
</form>
<form class="platform" method="post">
<h5>Voeg een admin/mod toe</h5>
<ul>
<il>
<input name="groupID" value="<?=$_GET["groupID"]?>" type="hidden">
<label>Selecteer gebruiker</label>
<select name="userID">
<option disabled selected>Geen gebruiker geselecteerd:</option>
<?php
$groupMembers = getAllGroupMembers($_GET["groupID"]);
foreach ($groupMembers as $groupMember) {?>
<option value="<?=$groupMember["userID"]?>">
<?=$groupMember["fullname"]?> (<?=$groupMember["username"]?>)
</option>
<?php } ?>
</select>
<button name="form"
value="admin"
>
Maak Admin
</button>
<button name="form"
value="mod"
>
Maak Moderator
</button>
</il>
</ul>
</form>
<div class="platform">
<ul>
<li>
<label></label>
<a href="group.php?groupname=<?=$groupinfo["name"]?>"><button class="fa fa-chevron-left"> Terug naar de groep</button></a>
</li>
</ul>
</div>
</div>
</div>

View File

@@ -1,4 +1,7 @@
<meta charset="utf-8">
<meta charset="UTF-8">
<meta name="description" content="MyHyvesbook+ is het sociaal medium voor alle coole mensen. Stap nu over van facebook op het gloednieuwe en betere sociaal medium.">
<meta name="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
<meta name="author" content="MyHyvesbookplus corporation">
<title>MyHyvesbook+</title>
<!-- Add your javascript files here. -->
<script src="js/jquery.js"></script>
@@ -23,8 +26,8 @@ require_once ("../queries/user.php");
session_start();
if(!isset($_SESSION["userID"])){
header("location:login.php");
if(!isset($_SESSION["userID"])) {
header("location:login.php?url=" . "$_SERVER[REQUEST_URI]");
} else {
updateLastActivity();
}

View File

@@ -23,9 +23,9 @@ $userinfo = getHeaderInfo();
<div id="hello-loop">
Hallo
</div>
<?=$userinfo["fname"]?>
<?= $userinfo["fname"] ?>
</div>
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/><i id="open-notifications" class="fa fa-bars"></i>
<img alt="<?= $userinfo["lname"] ?>" 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"); ?>

View File

@@ -35,6 +35,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
try {
$user = ($_POST["user"]);
validateLogin($_POST["user"], $_POST["psw"], $_POST["url"]);
} catch(loginException $e) {
$loginErr = $e->getMessage();
}

View File

@@ -1,5 +1,8 @@
<head>
<meta charset="utf-8">
<meta charset="UTF-8">
<meta name="description" content="MyHyvesbook+ is het sociaal medium voor alle coole mensen. Stap nu over van facebook op het gloednieuwe en betere sociaal medium.">
<meta name="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
<meta name="author" content="MyHyvesbookplus corporation">
<title>MyHyvesbook+</title>
<link rel="stylesheet"
type="text/css"

View File

@@ -12,9 +12,11 @@
</h4>
<ul id="menu-groups-list" class="nav-list">
</ul>
</section>
<section>
<ul class="nav-list">
<li>
<a href="#">
<a href="createGroup.php">
Maak een groep aan
</a>
</li>

View File

@@ -14,7 +14,7 @@
echo "<style>@import url('styles/adminbutton.css'); </style>";
}
?>
<a href="logout.php" data-title="Admin"><i class="fa fa-sign-out"></i></a>
<a href="logout.php" data-title="Uitloggen"><i class="fa fa-sign-out"></i></a>
</section>
<section id="friend-request-section">
<h4>

View File

@@ -5,14 +5,6 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
?>
<div class='post-header header'>
<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']?>'>
@@ -20,7 +12,14 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
</span>
</span>
</div>
<?php if (checkPermissionOnPost($postID, $_SESSION["userID"])) {?>
<button class="deleteButton fancy-button"
onclick="deletePost('<?=$postID?>')"
type="submit">
<span>Verwijder post</span>
<i class="fa fa-trash"></i>
</button><br />
<?php } ?>
<div class='post-content'>
<p><?=$post['content']?></p>
</div>
@@ -30,7 +29,7 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
<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..." maxlength="1000"></textarea><span></span> <br>
<button onclick="postComment('reaction')" name="button" value="reaction">Reageer!</button>
<button onclick="postComment('reaction')" name="button" value="reaction" class="green"><i class="fa fa-comment"></i> Reageer!</button>
<button onclick="postComment('nietslecht')" name="button" value="nietslecht" class="nietslecht">
<?php
if (checkNietSlecht($postID, $_SESSION["userID"])) {

View File

@@ -1,12 +1,22 @@
<div class="content">
<div class='platform alertbox' id="alertbox">
<span class="alerttext" id="alerttext"></span>
</div>
<div class="user-box">
<img class="profile-picture main-picture <?= $user["onlinestatus"] ?>" src="<?= $user["profilepicture"] ?>"><br />
<img alt="<?= $user["fname"] ?>" 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"] ?>
</button>
<button disabled class="gray"><?= $user["role"] ?></button>
<div>
<button disabled class="gray">
<?= $user["onlinestatus"] ?>
</button>
</div>
<div>
<button disabled class="gray">
<?= $user["role"] ?>
</button>
</div>
</div>
<div class="friend-button-container">
<p>:)</p>
@@ -15,25 +25,30 @@
<div class="profile-info">
<h2><?= $user["fname"]?> <?=$user["lname"]?></h2>
<h5><?=$user["username"]?></h5>
<?php if (strlen($user["bio"]) <= 50) {
<?php
if (strlen($user["bio"]) <= 50 and $showProfile) {
echo "<p>" . $user["bio"] . "</p>";
} ?>
</div>
</div>
</div>
<?php if (strlen($user["bio"]) > 50) {
<?php if (strlen($user["bio"]) > 50 and $showProfile) {
echo "<div class='platform'><h3>Bio:</h3><p>" . $user["bio"] . "</p></div>";
} ?>
<?php if($showProfile) { ?>
<div class="item-box platform">
<h3>Informatie</h3>
<p>
<ul>
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
<li>Locatie: <?= $user["location"] ?></li>
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
</ul>
</p>
<ul>
<?php if ($user["showBday"]) { ?>
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
<?php } ?>
<?php if ($user["showEmail"]) { ?>
<li>Email: <?= $user["email"] ?></li>
<?php } ?>
<li>Locatie: <?= $user["location"] ?></li>
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
</ul>
</div>
<div class="item-box platform">
@@ -41,7 +56,7 @@
<p>
<?php
while($friend = $profile_friends->fetch()) {
echo "<a href='profile.php?username=${friend["username"]}' data-title='${friend["username"]}'><img class='profile-picture' src='${friend["profilepicture"]}' alt='${friend["username"]}'s profielfoto></a>";
echo "<a href='profile.php?username=${friend["username"]}' data-title='${friend["username"]}'><img class='profile-picture' height='42' width='42' src='${friend["profilepicture"]}' alt='${friend["username"]}' /></a>";
}
@@ -85,4 +100,5 @@
</div>
</div>
</div>
<?php } ?>
</div>

View File

@@ -48,7 +48,12 @@ $group_n = ($group_currentpage - 1) * $group_perpage;
<label for="filter">
Filter:
</label>
<select name="filter" id="search-filter">
<select name="filter"
id="search-filter"
onchange="$('#user-pagenumber, #group-pagenumber').prop('value', 1);
searchUsers();
searchGroups();
pageNumber();">
<option value="personal"
<?php if ($filter == "personal") echo "selected";?>>
Persoonlijk</option>

View File

@@ -17,6 +17,7 @@ $settings = getSettings();
<input type="text"
name="fname"
id="fname"
maxlength="63"
placeholder="Voornaam"
title="Voornaam"
value="<?=$settings["fname"]?>"
@@ -27,6 +28,7 @@ $settings = getSettings();
<input type="text"
name="lname"
id="lname"
maxlength="63"
placeholder="Achternaam"
value="<?=$settings["lname"]?>"
>
@@ -36,14 +38,15 @@ $settings = getSettings();
<input type="text"
name="location"
id="location"
maxlength="50"
placeholder="Locatie"
value="<?=$settings["location"]?>"
>
</li>
<li>
<?php $currentbday = new DateTime($settings["birthdate"]); ?>
<label for="bday">Geboortedatum</label>
<select name='day' id="bday">
<label>Geboortedatum</label>
<select name='day'>
<?php for ($day = 1; $day <= 31; $day++): ?>
<option value='<?=$day?>'
<?=($day == $currentbday->format("d")) ? "selected" : ""?>
@@ -52,7 +55,7 @@ $settings = getSettings();
</option>
<?php endfor; ?>
</select>
<select name='month' id="bday">
<select name='month'>
<?php
$months = array ("januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus",
"september", "oktober", "november", "december");
@@ -65,7 +68,7 @@ $settings = getSettings();
</option>
<?php endfor; ?>
</select>
<select name='year' id="bday">
<select name='year'>
<?php
$now = (new DateTime)->format("Y");
for ($year = $now; $year >= 1900; $year--): ?>
@@ -194,6 +197,7 @@ $settings = getSettings();
<label for="email-old">Huidig Email </label>
<input type="email"
id="email-old"
maxlength="255"
value="<?=$settings["email"]?>"
disabled
>
@@ -202,6 +206,7 @@ $settings = getSettings();
<label for="email">Nieuw Email</label>
<input type="email"
name="email"
maxlength="255"
id="email"
placeholder="Nieuw Email"
>
@@ -211,14 +216,16 @@ $settings = getSettings();
<input type="email"
name="email-confirm"
id="email-confirm"
maxlength="255"
placeholder="Bevestig Email"
>
</li>
<li>
<button type="submit"
name="form"
value="email"
>Verander Email</button>
value="email">
Verander Email
</button>
</li>
</ul>
</form>