Compare commits
23 Commits
revert-50e
...
marijn-gro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d5de98c1d | ||
|
|
ac2ce3d07b | ||
|
|
c69b5d8ed3 | ||
|
|
5de3a84683 | ||
|
|
b8d6136a9d | ||
|
|
1862369013 | ||
|
|
8d70804155 | ||
|
|
0ac12f5110 | ||
|
|
5e8fa6791f | ||
|
|
28e9269b52 | ||
|
|
fe190975d5 | ||
|
|
87b0ab5892 | ||
|
|
c8dbdfe70e | ||
|
|
8949d14a5e | ||
|
|
02349dbe28 | ||
|
|
da01729b61 | ||
|
|
6d739a4480 | ||
|
|
ab21226925 | ||
|
|
7e4107ac8b | ||
|
|
e9468b0ec8 | ||
|
|
b206d243b9 | ||
|
|
4f731e12fe | ||
|
|
f8c9454b85 |
@@ -3,9 +3,9 @@ session_start();
|
|||||||
|
|
||||||
require_once "../../queries/post.php";
|
require_once "../../queries/post.php";
|
||||||
require_once "../../queries/user.php";
|
require_once "../../queries/user.php";
|
||||||
|
if (!isset($_SESSION["userID"])) {
|
||||||
if (isset($_SESSION["userID"]) and
|
echo "logged out";
|
||||||
getRoleByID($_SESSION["userID"]) != 'frozen' and
|
} else if (getRoleByID($_SESSION["userID"]) != 'frozen' and
|
||||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||||
|
|
||||||
if (empty($_POST["postID"]) or empty($_SESSION["userID"])) {
|
if (empty($_POST["postID"]) or empty($_SESSION["userID"])) {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ require_once("../../queries/connect.php");
|
|||||||
require_once("../../queries/checkInput.php");
|
require_once("../../queries/checkInput.php");
|
||||||
require_once("../../queries/user.php");
|
require_once("../../queries/user.php");
|
||||||
|
|
||||||
|
if (!isset($_SESSION["userID"])) {
|
||||||
if (isset($_SESSION["userID"]) &&
|
echo "logged out";
|
||||||
getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
} else if (getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
||||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||||
if ($_POST['button'] == 'reaction') {
|
if ($_POST['button'] == 'reaction') {
|
||||||
if (empty($_POST['newcomment-content'])) {
|
if (empty($_POST['newcomment-content'])) {
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ require_once("../../queries/connect.php");
|
|||||||
require_once("../../queries/checkInput.php");
|
require_once("../../queries/checkInput.php");
|
||||||
require_once("../../queries/user.php");
|
require_once("../../queries/user.php");
|
||||||
|
|
||||||
if (isset($_SESSION["userID"]) &&
|
if (!isset($_SESSION["userID"])) {
|
||||||
getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
echo "logged out";
|
||||||
|
} else if (getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
||||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||||
|
|
||||||
if (empty($_SESSION["userID"])) {
|
if (empty($_SESSION["userID"])) {
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ require_once("../../queries/checkInput.php");
|
|||||||
require_once("../../queries/user.php");
|
require_once("../../queries/user.php");
|
||||||
|
|
||||||
// Check if the user is allowed to send a message.
|
// Check if the user is allowed to send a message.
|
||||||
if (isset($_SESSION["userID"]) &&
|
if (!isset($_SESSION["userID"])) {
|
||||||
getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
echo "logged out";
|
||||||
|
} else if (getRoleByID($_SESSION["userID"]) != 'frozen' &&
|
||||||
getRoleByID($_SESSION["userID"]) != 'banned') {
|
getRoleByID($_SESSION["userID"]) != 'banned') {
|
||||||
if (!empty(test_input($_POST["destination"])) &&
|
if (!empty(test_input($_POST["destination"])) &&
|
||||||
!empty(test_input($_POST["content"]))
|
!empty(test_input($_POST["content"]))
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ require_once "../queries/alerts.php";
|
|||||||
include("../views/main.php");
|
include("../views/main.php");
|
||||||
$alertClass;
|
$alertClass;
|
||||||
$alertMessage;
|
$alertMessage;
|
||||||
|
|
||||||
|
// Select which button has been pressed.
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
try {
|
try {
|
||||||
switch ($_POST["form"]) {
|
switch ($_POST["form"]) {
|
||||||
@@ -44,6 +46,15 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
}
|
}
|
||||||
upgradeUser($_POST["groupID"], $_POST["userID"], "admin");
|
upgradeUser($_POST["groupID"], $_POST["userID"], "admin");
|
||||||
break;
|
break;
|
||||||
|
case "deadmin":
|
||||||
|
if (!array_key_exists("userID", $_POST)) {
|
||||||
|
throw new AngryAlert("Geen gebruiker geselecteerd.");
|
||||||
|
}
|
||||||
|
upgradeUser($_POST["groupID"], $_POST["userID"], "member");
|
||||||
|
break;
|
||||||
|
case "delete":
|
||||||
|
deleteGroup();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} catch (AlertMessage $w) {
|
} catch (AlertMessage $w) {
|
||||||
$alertClass = $w->getClass();
|
$alertClass = $w->getClass();
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ function sendMessage() {
|
|||||||
).done(function(response) {
|
).done(function(response) {
|
||||||
if (response == "frozen") {
|
if (response == "frozen") {
|
||||||
alert("Je account is bevroren, dus je kan niet chat berichten versturen. Contacteer een admin als je denkt dat dit onjuist is.");
|
alert("Je account is bevroren, dus je kan niet chat berichten versturen. Contacteer een admin als je denkt dat dit onjuist is.");
|
||||||
|
} else if (response == "logged out") {
|
||||||
|
window.location.href = "login.php?url=" + window.location.pathname;
|
||||||
}
|
}
|
||||||
// Load messages if the message has been send, so it shows in the chat.
|
// Load messages if the message has been send, so it shows in the chat.
|
||||||
loadMessages();
|
loadMessages();
|
||||||
|
|||||||
@@ -19,24 +19,24 @@ function placeFriendButtons() {
|
|||||||
case "0":
|
case "0":
|
||||||
value1 = "request";
|
value1 = "request";
|
||||||
class1 = "green";
|
class1 = "green";
|
||||||
text1 = "Bevriend";
|
text1 = "Word vrienden";
|
||||||
icon1 = "fa-handshake-o";
|
icon1 = "fa-user-plus";
|
||||||
break;
|
break;
|
||||||
case "1":
|
case "1":
|
||||||
value1 = userID;
|
value1 = userID;
|
||||||
class1 = "green";
|
class1 = "green";
|
||||||
text1 = "Chat";
|
text1 = "Chat";
|
||||||
icon1 = "fa-comment-o";
|
icon1 = "fa-comment";
|
||||||
value2 = "delete";
|
value2 = "delete";
|
||||||
class2 = "red";
|
class2 = "red";
|
||||||
text2 = "Verwijder";
|
text2 = "Ontvriend";
|
||||||
icon2 = "fa-times";
|
icon2 = "fa-user-times";
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
value1 = "delete";
|
value1 = "delete";
|
||||||
class1 = "red";
|
class1 = "red";
|
||||||
text1 = "Trek verzoek in";
|
text1 = "Trek verzoek in";
|
||||||
icon1 = "fa-cross";
|
icon1 = "fa-times";
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
value1 = "accept";
|
value1 = "accept";
|
||||||
@@ -51,16 +51,18 @@ function placeFriendButtons() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$buttonContainer.append(
|
$buttonContainer.append(
|
||||||
"<button class='"+ class1 +" friend-button' value='"+ value1 +"'>" +
|
"<div><button class='"+ class1 +" fancy-button friend-button' value='"+ value1 +"'>" +
|
||||||
"<i class='fa "+ icon1 +"'></i> " + text1 +
|
"<span>"+ text1 +"</span>" +
|
||||||
"</button>");
|
"<i class='fa fa-fw "+ icon1 +"'></i> " +
|
||||||
|
"</button></div>");
|
||||||
$buttonContainer.append(
|
$buttonContainer.append(
|
||||||
"<button class='"+ class2 +" friend-button' value='"+ value2 +"'>" +
|
"<div><button class='"+ class2 +" fancy-button friend-button' value='"+ value2 +"'>" +
|
||||||
"<i class='fa "+ icon2 +"'></i> " + text2 +
|
"<span>"+ text2 +"</span>" +
|
||||||
"</button>");
|
"<i class='fa fa-fw "+ icon2 +"'></i> " +
|
||||||
|
"</button></div>");
|
||||||
|
|
||||||
|
|
||||||
$buttonContainer.children().click(function() {
|
$buttonContainer.find("button").click(function() {
|
||||||
if (isNaN(this.value))
|
if (isNaN(this.value))
|
||||||
editFriendship(userID, this.value);
|
editFriendship(userID, this.value);
|
||||||
else if (this.value != "")
|
else if (this.value != "")
|
||||||
|
|||||||
@@ -5,23 +5,23 @@ function placeGroupButtons() {
|
|||||||
|
|
||||||
if (data == 'none') {
|
if (data == 'none') {
|
||||||
$buttonContainer.append(
|
$buttonContainer.append(
|
||||||
"<button class='green group-button group-button-fixed' value='request'>" +
|
"<button class='green group-button fancy-button' value='request'>" +
|
||||||
"<i class='fa fa-plus'></i> Voeg toe" +
|
"<span>Treed toe</span><i class='fa fa-plus'></i>" +
|
||||||
"</button>");
|
"</button>");
|
||||||
} else if (data == 'request') {
|
} else if (data == 'request') {
|
||||||
$buttonContainer.append(
|
$buttonContainer.append(
|
||||||
"<button class='red group-button group-button-fixed' value='none'>" +
|
"<button class='red group-button fancy-button' value='none'>" +
|
||||||
"<i class='fa fa-times'></i> Trek verzoek in" +
|
"<span>Trek verzoek in</span><i class='fa fa-times'></i>" +
|
||||||
"</button>");
|
"</button>");
|
||||||
} else if (data == 'admin') {
|
} else if (data == 'admin') {
|
||||||
$buttonContainer.append(
|
$buttonContainer.append(
|
||||||
"<button class='group-button group-button-fancy' value='admin'>" +
|
"<button class='group-button fancy-button' value='admin'>" +
|
||||||
"<span>Instellingen</span><i class='fa fa-cogs'></i>" +
|
"<span>Instellingen</span><i class='fa fa-cogs'></i>" +
|
||||||
"</button>"
|
"</button>"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$buttonContainer.append(
|
$buttonContainer.append(
|
||||||
"<button class='red group-button group-button-fancy' value='none'>" +
|
"<button class='red group-button fancy-button' value='none'>" +
|
||||||
"<span>Verlaat groep</span><i class='fa fa-sign-out'></i>" +
|
"<span>Verlaat groep</span><i class='fa fa-sign-out'></i>" +
|
||||||
"</button>");
|
"</button>");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ var months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "a
|
|||||||
|
|
||||||
function fancyText(text) {
|
function fancyText(text) {
|
||||||
// Add links, images, gifs and (youtube) video's.
|
// Add links, images, gifs and (youtube) video's.
|
||||||
var regex = /(https?:\/\/.[^ <>"]*)/ig;
|
text = text.replace(/(https?:\/\/.[^ \n<>"]*)/ig, function(link) {
|
||||||
text = text.replace(regex, function(link) {
|
|
||||||
// Add images
|
// Add images
|
||||||
if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) {
|
if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) {
|
||||||
return "<img alt='" + link + "' src='" + link + "' />";
|
return "<img alt='" + link + "' src='" + link + "' />";
|
||||||
@@ -39,7 +38,7 @@ function fancyText(text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This function gets the value of a cookie when given a key.
|
// This function gets the value of a cookie when given a key.
|
||||||
// If didn´t find any compatible cookie, it returns false.
|
// If it didn´t find any compatible cookie, it returns false.
|
||||||
function getCookie(key) {
|
function getCookie(key) {
|
||||||
cookies = document.cookie.split("; ");
|
cookies = document.cookie.split("; ");
|
||||||
for (var i in cookies) {
|
for (var i in cookies) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function requestPost(postID) {
|
|||||||
function postPost() {
|
function postPost() {
|
||||||
title = $("input.newpost[name='title']").val();
|
title = $("input.newpost[name='title']").val();
|
||||||
content = $("textarea.newpost[name='content']").val();
|
content = $("textarea.newpost[name='content']").val();
|
||||||
|
console.log(masonryMode);
|
||||||
if (masonryMode == 2) {
|
if (masonryMode == 2) {
|
||||||
$.post("API/postPost.php", { title: title,
|
$.post("API/postPost.php", { title: title,
|
||||||
content : content,
|
content : content,
|
||||||
@@ -36,6 +36,10 @@ function postPost() {
|
|||||||
$('#alertbox').show();
|
$('#alertbox').show();
|
||||||
$('#alerttext').html("Geen titel of inhoud; vul a.u.b. in.");
|
$('#alerttext').html("Geen titel of inhoud; vul a.u.b. in.");
|
||||||
window.scrollTo(0,0);
|
window.scrollTo(0,0);
|
||||||
|
} else if (data == "logged out") {
|
||||||
|
window.location.href = "login.php?url=" + window.location.pathname;
|
||||||
|
} else if (data == "frozen") {
|
||||||
|
alert("Je account is bevroren, dus je kan geen posts plaatsen. Contacteer een admin als je denkt dat dit onjuist is.");
|
||||||
} else {
|
} else {
|
||||||
$('#alertbox').hide();
|
$('#alertbox').hide();
|
||||||
masonry(masonryMode);
|
masonry(masonryMode);
|
||||||
@@ -49,6 +53,10 @@ function postPost() {
|
|||||||
$('#alertbox').show();
|
$('#alertbox').show();
|
||||||
$('#alerttext').html("Geen titel of inhoud; vul a.u.b. in.");
|
$('#alerttext').html("Geen titel of inhoud; vul a.u.b. in.");
|
||||||
window.scrollTo(0,0);
|
window.scrollTo(0,0);
|
||||||
|
} else if (data == "logged out") {
|
||||||
|
window.location.href = "login.php?url=" + window.location.pathname;
|
||||||
|
} else if (data == "frozen") {
|
||||||
|
alert("Je account is bevroren, dus je kan geen posts plaatsen. Contacteer een admin als je denkt dat dit onjuist is.");
|
||||||
} else {
|
} else {
|
||||||
$('#alertbox').hide();
|
$('#alertbox').hide();
|
||||||
masonry(masonryMode);
|
masonry(masonryMode);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ function postComment(buttonValue) {
|
|||||||
).done(function (response) {
|
).done(function (response) {
|
||||||
if (response == "frozen") {
|
if (response == "frozen") {
|
||||||
alert("Je account is bevroren, dus je kan geen comments plaatsen of \"niet slechten\". Contacteer een admin als je denkt dat dit onjuist is.");
|
alert("Je account is bevroren, dus je kan geen comments plaatsen of \"niet slechten\". Contacteer een admin als je denkt dat dit onjuist is.");
|
||||||
|
} else if (response == "logged out") {
|
||||||
|
window.location.href = "login.php?url=" + window.location.pathname;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -30,6 +32,8 @@ function deletePost(postID) {
|
|||||||
).done(function (response) {
|
).done(function (response) {
|
||||||
if (response == "frozen") {
|
if (response == "frozen") {
|
||||||
alert("Je account is bevroren, dus je kan geen posts verwijderen. Contacteer een admin als je denkt dat dit onjuist is.");
|
alert("Je account is bevroren, dus je kan geen posts verwijderen. Contacteer een admin als je denkt dat dit onjuist is.");
|
||||||
|
} else if (response == "logged out") {
|
||||||
|
window.location.href = "login.php?url=" + window.location.pathname;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
closeModal();
|
closeModal();
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$alertClass;
|
$alertClass;
|
||||||
$alertMessage;
|
$alertMessage;
|
||||||
|
|
||||||
|
// Select which button has been pressed.
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
try {
|
try {
|
||||||
switch ($_POST["form"]) {
|
switch ($_POST["form"]) {
|
||||||
@@ -29,7 +31,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
case "picture":
|
case "picture":
|
||||||
updateAvatar();
|
updateAvatar();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (AlertMessage $w) {
|
} catch (AlertMessage $w) {
|
||||||
$alertClass = $w->getClass();
|
$alertClass = $w->getClass();
|
||||||
|
|||||||
@@ -256,8 +256,6 @@ div[data-title]:hover:after {
|
|||||||
top: 150%;
|
top: 150%;
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
-moz-border-radius: 3px;
|
|
||||||
-webkit-border-radius: 3px;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
|
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
|
|||||||
@@ -91,16 +91,5 @@
|
|||||||
|
|
||||||
.deleteButton {
|
.deleteButton {
|
||||||
background-color: firebrick;
|
background-color: firebrick;
|
||||||
}
|
float: right;
|
||||||
|
|
||||||
.deleteButton i {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deleteButton:hover span {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deleteButton span {
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
@@ -27,16 +27,21 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.friend-button-container div, .status-buttons-container div {
|
||||||
|
width: 200px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.friend-button-container button, .status-buttons-container button, .group-button-container button {
|
.friend-button-container button, .status-buttons-container button, .group-button-container button {
|
||||||
display: block;
|
display: block;
|
||||||
|
float: right;
|
||||||
|
|
||||||
margin: 7px 0;
|
margin: 7px 0;
|
||||||
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
.status-buttons-container button {
|
||||||
.friend-button-container button, .status-buttons-container button, .group-button-fixed {
|
float: left;
|
||||||
width: 200px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-button-container button {
|
.group-button-container button {
|
||||||
@@ -74,22 +79,21 @@
|
|||||||
|
|
||||||
.group-picture {
|
.group-picture {
|
||||||
border: none;
|
border: none;
|
||||||
margin-right: 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-button-fancy span {
|
.fancy-button span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-button-fancy:hover {
|
.fancy-button:hover {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-button-fancy i {
|
.fancy-button i {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-button-fancy:hover span {
|
.fancy-button:hover span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ function checkInputChoice($variable, $option){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for only letters and spaces. */
|
/**
|
||||||
|
* Checks for only letters and spaces.
|
||||||
|
* @param $variable
|
||||||
|
* @throws lettersAndSpacesException
|
||||||
|
*/
|
||||||
function checkName($variable){
|
function checkName($variable){
|
||||||
if (empty($variable)) {
|
if (empty($variable)) {
|
||||||
throw new lettersAndSpacesException("Verplicht!");
|
throw new lettersAndSpacesException("Verplicht!");
|
||||||
@@ -52,7 +56,11 @@ function checkName($variable){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for bday */
|
/**
|
||||||
|
* Checks for bday
|
||||||
|
* @param $variable
|
||||||
|
* @throws bdayException
|
||||||
|
*/
|
||||||
function validateBday($variable){
|
function validateBday($variable){
|
||||||
if (empty($variable)) {
|
if (empty($variable)) {
|
||||||
throw new bdayException("Verplicht!");
|
throw new bdayException("Verplicht!");
|
||||||
@@ -219,6 +227,9 @@ function test_input($data) {
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class lettersAndSpacesException
|
||||||
|
*/
|
||||||
class lettersAndSpacesException extends Exception
|
class lettersAndSpacesException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -227,7 +238,9 @@ class lettersAndSpacesException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class bdayException
|
||||||
|
*/
|
||||||
class bdayException extends Exception
|
class bdayException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -236,6 +249,9 @@ class bdayException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class usernameException
|
||||||
|
*/
|
||||||
class usernameException extends Exception
|
class usernameException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -244,6 +260,9 @@ class usernameException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class passwordException
|
||||||
|
*/
|
||||||
class passwordException extends Exception
|
class passwordException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -252,6 +271,9 @@ class passwordException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class confirmPasswordException
|
||||||
|
*/
|
||||||
class confirmPasswordException extends Exception
|
class confirmPasswordException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -260,6 +282,9 @@ class confirmPasswordException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class fbConfirmPasswordException
|
||||||
|
*/
|
||||||
class fbConfirmPasswordException extends Exception
|
class fbConfirmPasswordException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -268,6 +293,9 @@ class fbConfirmPasswordException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class emailException
|
||||||
|
*/
|
||||||
class emailException extends Exception
|
class emailException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -276,6 +304,9 @@ class emailException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class confirmEmailException
|
||||||
|
*/
|
||||||
class confirmEmailException extends Exception
|
class confirmEmailException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -284,6 +315,9 @@ class confirmEmailException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class captchaException
|
||||||
|
*/
|
||||||
class captchaException extends Exception
|
class captchaException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
@@ -292,6 +326,9 @@ class captchaException extends Exception
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class registerException
|
||||||
|
*/
|
||||||
class registerException extends Exception
|
class registerException extends Exception
|
||||||
{
|
{
|
||||||
public function __construct($message = "", $code = 0, Exception $previous = null)
|
public function __construct($message = "", $code = 0, Exception $previous = null)
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ else {
|
|||||||
or die('Error connecting to mysql server');
|
or die('Error connecting to mysql server');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helperfunction to create a database query.
|
||||||
|
* @param string $query
|
||||||
|
* @return PDOStatement
|
||||||
|
*/
|
||||||
function prepareQuery(string $query) : PDOStatement {
|
function prepareQuery(string $query) : PDOStatement {
|
||||||
return $GLOBALS["db"]->prepare($query);
|
return $GLOBALS["db"]->prepare($query);
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,13 @@
|
|||||||
require_once "../queries/checkInput.php";
|
require_once "../queries/checkInput.php";
|
||||||
require_once "../queries/picture.php";
|
require_once "../queries/picture.php";
|
||||||
require_once "../queries/alerts.php";
|
require_once "../queries/alerts.php";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a group.
|
||||||
|
*/
|
||||||
function createGroup()
|
function createGroup()
|
||||||
{
|
{
|
||||||
|
// Creates the group.
|
||||||
$createGroup = prepareQuery("
|
$createGroup = prepareQuery("
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
`group_page` (`name`, `description`)
|
`group_page` (`name`, `description`)
|
||||||
@@ -13,6 +18,7 @@ function createGroup()
|
|||||||
$createGroup->bindValue(':description', test_input($_POST["bio"]));
|
$createGroup->bindValue(':description', test_input($_POST["bio"]));
|
||||||
$createGroup->execute();
|
$createGroup->execute();
|
||||||
|
|
||||||
|
// Gets the groupID just created.
|
||||||
$getGroupID = prepareQuery("
|
$getGroupID = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
`groupID`
|
`groupID`
|
||||||
@@ -24,6 +30,7 @@ function createGroup()
|
|||||||
$getGroupID->execute();
|
$getGroupID->execute();
|
||||||
$groupID = $getGroupID->fetch()["groupID"];
|
$groupID = $getGroupID->fetch()["groupID"];
|
||||||
|
|
||||||
|
// Adds the user as an admin.
|
||||||
$makeUserAdmin = prepareQuery("
|
$makeUserAdmin = prepareQuery("
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
`group_member` (userID, groupID, role)
|
`group_member` (userID, groupID, role)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Sends a confirm email if you know the username.
|
||||||
|
* @param string $username
|
||||||
|
*/
|
||||||
function sendConfirmEmailUsername(string $username) {
|
function sendConfirmEmailUsername(string $username) {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
@@ -15,6 +18,10 @@ function sendConfirmEmailUsername(string $username) {
|
|||||||
sendConfirmEmail($userID);
|
sendConfirmEmail($userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a confirm email if you know the userID.
|
||||||
|
* @param int $userID
|
||||||
|
*/
|
||||||
function sendConfirmEmail(int $userID) {
|
function sendConfirmEmail(int $userID) {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Gets the current settings for a group.
|
||||||
|
* @param int $groupID
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
function getGroupSettings(int $groupID) {
|
function getGroupSettings(int $groupID) {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
@@ -15,6 +20,12 @@ function getGroupSettings(int $groupID) {
|
|||||||
return $stmt->fetch();
|
return $stmt->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the settings for a group.
|
||||||
|
* @param int $groupID
|
||||||
|
* @throws AngryAlert
|
||||||
|
* @throws HappyAlert
|
||||||
|
*/
|
||||||
function updateGroupSettings(int $groupID)
|
function updateGroupSettings(int $groupID)
|
||||||
{
|
{
|
||||||
if (!checkGroupAdmin($groupID, $_SESSION["userID"])) {
|
if (!checkGroupAdmin($groupID, $_SESSION["userID"])) {
|
||||||
@@ -40,6 +51,12 @@ function updateGroupSettings(int $groupID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if an user is an admin for a page.
|
||||||
|
* @param int $groupID
|
||||||
|
* @param int $userID
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function checkGroupAdmin(int $groupID, int $userID) : bool {
|
function checkGroupAdmin(int $groupID, int $userID) : bool {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
@@ -60,7 +77,40 @@ function checkGroupAdmin(int $groupID, int $userID) : bool {
|
|||||||
return ($role == "admin");
|
return ($role == "admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAllGroupMembers(int $groupID) {
|
/**
|
||||||
|
* Returns all normal members for a group.
|
||||||
|
* @param int $groupID
|
||||||
|
* @return array|bool
|
||||||
|
*/
|
||||||
|
function getAllGroupUsers(int $groupID) {
|
||||||
|
return getAllGroupMembers($groupID, 'member');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all admin for a group.
|
||||||
|
* @param int $groupID
|
||||||
|
* @return array|bool
|
||||||
|
*/
|
||||||
|
function getAllGroupAdmins(int $groupID) {
|
||||||
|
return getAllGroupMembers($groupID, 'admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all Moderators for a group.
|
||||||
|
* @param int $groupID
|
||||||
|
* @return array|bool
|
||||||
|
*/
|
||||||
|
function getAllGroupMods(int $groupID) {
|
||||||
|
return getAllGroupMembers($groupID, 'mod');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all members for a group specified by a string.
|
||||||
|
* @param int $groupID
|
||||||
|
* @param string $role
|
||||||
|
* @return array|bool
|
||||||
|
*/
|
||||||
|
function getAllGroupMembers(int $groupID, string $role) {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
`username`,
|
`username`,
|
||||||
@@ -74,16 +124,25 @@ function getAllGroupMembers(int $groupID) {
|
|||||||
ON
|
ON
|
||||||
`group_member`.`userID` = `user`.`userID`
|
`group_member`.`userID` = `user`.`userID`
|
||||||
WHERE
|
WHERE
|
||||||
`groupID` = :groupID AND `group_member`.`role` = 'member'
|
`groupID` = :groupID AND `group_member`.`role` = :role
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(':groupID', $groupID);
|
$stmt->bindParam(':groupID', $groupID);
|
||||||
|
$stmt->bindParam(":role", $role);
|
||||||
if (!$stmt->execute()) {
|
if (!$stmt->execute()) {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
return $stmt->fetchAll();
|
return $stmt->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upgrades or downgrades a groupmember to a different role.
|
||||||
|
* @param int $groupID
|
||||||
|
* @param int $userID
|
||||||
|
* @param string $role
|
||||||
|
* @throws AngryAlert
|
||||||
|
* @throws HappyAlert
|
||||||
|
*/
|
||||||
function upgradeUser(int $groupID, int $userID, string $role) {
|
function upgradeUser(int $groupID, int $userID, string $role) {
|
||||||
if (!checkGroupAdmin($groupID, $_SESSION["userID"])) {
|
if (!checkGroupAdmin($groupID, $_SESSION["userID"])) {
|
||||||
throw new AngryAlert("Geen toestemming om te wijzigen");
|
throw new AngryAlert("Geen toestemming om te wijzigen");
|
||||||
@@ -107,3 +166,27 @@ function upgradeUser(int $groupID, int $userID, string $role) {
|
|||||||
throw new AngryAlert("Er is iets mis gegaan");
|
throw new AngryAlert("Er is iets mis gegaan");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a group form the database.
|
||||||
|
* @throws AngryAlert
|
||||||
|
* @throws HappyAlert
|
||||||
|
*/
|
||||||
|
function deleteGroup() {
|
||||||
|
if (!checkGroupAdmin($_POST["groupID"], $_SESSION["userID"])) {
|
||||||
|
throw new AngryAlert("Geen toestemming om de groep te verwijderen!");
|
||||||
|
}
|
||||||
|
$stmt = prepareQuery("
|
||||||
|
DELETE FROM
|
||||||
|
`group_page`
|
||||||
|
WHERE
|
||||||
|
`groupID` = :groupID
|
||||||
|
");
|
||||||
|
$stmt->bindValue(":groupID", $_POST["groupID"]);
|
||||||
|
$stmt->execute();
|
||||||
|
if ($stmt->rowCount()) {
|
||||||
|
throw new HappyAlert("Group verwijderd!");
|
||||||
|
} else {
|
||||||
|
throw new AngryAlert("Er is iets mis gegaan");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
//Find matching password with the inputted username/emailadress.
|
/**
|
||||||
|
* Find matching password with the inputted username/emailadress.
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
function getUser() {
|
function getUser() {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -281,6 +281,12 @@ function checkPermissionOnPost(int $postID, int $userID) : bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns role of an user.
|
||||||
|
* @param int $userID
|
||||||
|
* @param int $groupID
|
||||||
|
* @return mixed role of an user.
|
||||||
|
*/
|
||||||
function getRoleInGroup(int $userID, int $groupID) {
|
function getRoleInGroup(int $userID, int $groupID) {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ function getOldChatMessages($user2ID) {
|
|||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
|
FROM
|
||||||
|
(SELECT
|
||||||
|
*
|
||||||
FROM
|
FROM
|
||||||
`private_message`
|
`private_message`
|
||||||
WHERE
|
WHERE
|
||||||
@@ -15,9 +18,11 @@ function getOldChatMessages($user2ID) {
|
|||||||
`origin` = :user2 AND
|
`origin` = :user2 AND
|
||||||
`destination` = :user1
|
`destination` = :user1
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`creationdate` ASC
|
`messageID` DESC
|
||||||
LIMIT
|
LIMIT
|
||||||
100
|
100) sub
|
||||||
|
ORDER BY
|
||||||
|
`messageID` ASC
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(":user1", $user1ID);
|
$stmt->bindParam(":user1", $user1ID);
|
||||||
@@ -76,7 +81,7 @@ function getNewChatMessages($lastID, $destination) {
|
|||||||
`destination` = :user1) AND
|
`destination` = :user1) AND
|
||||||
`messageID` > :lastID
|
`messageID` > :lastID
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`creationdate` ASC
|
`messageID` ASC
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(':user1', $_SESSION["userID"]);
|
$stmt->bindParam(':user1', $_SESSION["userID"]);
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ function getSettings() {
|
|||||||
`location`,
|
`location`,
|
||||||
`birthdate`,
|
`birthdate`,
|
||||||
`bio`,
|
`bio`,
|
||||||
|
IFNULL(
|
||||||
`profilepicture`,
|
`profilepicture`,
|
||||||
|
'../img/avatar-standard.png'
|
||||||
|
) AS profilepicture,
|
||||||
`showBday`,
|
`showBday`,
|
||||||
`showEmail`,
|
`showEmail`,
|
||||||
`showProfile`
|
`showProfile`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="user-box">
|
<div class="user-box">
|
||||||
<img class="group-picture main-picture" src="<?= $group["picture"] ?>"><br />
|
<img alt="<?= $group["name"] ?>" class="group-picture main-picture" src="<?= $group["picture"] ?>"><br />
|
||||||
<div class="platform">
|
<div class="platform">
|
||||||
<div class="status-buttons-container">
|
<div class="status-buttons-container">
|
||||||
<button disabled class="gray"><?= $group["status"] ?></button>
|
<button disabled class="gray"><?= $group["status"] ?></button>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
|
|||||||
<li>
|
<li>
|
||||||
<label></label>
|
<label></label>
|
||||||
<a href="group.php?groupname=<?=$groupinfo["name"]?>">
|
<a href="group.php?groupname=<?=$groupinfo["name"]?>">
|
||||||
<button class="fa fa-chevron-left"> Terug naar de groep</button>
|
<button><i class="fa fa-chevron-left"></i> Terug naar de groep</button>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -51,8 +51,7 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
|
|||||||
<button type="submit"
|
<button type="submit"
|
||||||
name="form"
|
name="form"
|
||||||
value="group"
|
value="group"
|
||||||
class="fa fa-save"
|
><i class="fa fa-save"></i> Opslaan</button>
|
||||||
> Opslaan</button>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
@@ -80,8 +79,7 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
|
|||||||
<button type="submit"
|
<button type="submit"
|
||||||
name="form"
|
name="form"
|
||||||
value="picture"
|
value="picture"
|
||||||
class="fa fa-picture-o"
|
><i class="fa fa-picture-o"></i> Verander profielfoto</button>
|
||||||
> Verander profielfoto</button>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
@@ -94,7 +92,7 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
|
|||||||
<select name="userID">
|
<select name="userID">
|
||||||
<option disabled selected>Geen gebruiker geselecteerd:</option>
|
<option disabled selected>Geen gebruiker geselecteerd:</option>
|
||||||
<?php
|
<?php
|
||||||
$groupMembers = getAllGroupMembers($_GET["groupID"]);
|
$groupMembers = getAllGroupUsers($_GET["groupID"]);
|
||||||
foreach ($groupMembers as $groupMember) {?>
|
foreach ($groupMembers as $groupMember) {?>
|
||||||
<option value="<?=$groupMember["userID"]?>">
|
<option value="<?=$groupMember["userID"]?>">
|
||||||
<?=$groupMember["fullname"]?> (<?=$groupMember["username"]?>)
|
<?=$groupMember["fullname"]?> (<?=$groupMember["username"]?>)
|
||||||
@@ -114,11 +112,55 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
|
|||||||
</il>
|
</il>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
|
<form class="platform" method="post">
|
||||||
|
<h5>Verwijder een admin/mod</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
|
||||||
|
$groupAdmins = getAllGroupAdmins($_GET["groupID"]);
|
||||||
|
foreach ($groupAdmins as $groupAdmin) {?>
|
||||||
|
<option value="<?=$groupAdmin["userID"]?>">
|
||||||
|
<?=$groupAdmin["fullname"]?> (<?=$groupAdmin["username"]?>) (<?=$groupAdmin["role"]?>)
|
||||||
|
</option>
|
||||||
|
<?php } ?>
|
||||||
|
<?php
|
||||||
|
$groupMods = getAllGroupMods($_GET["groupID"]);
|
||||||
|
foreach ($groupMods as $groupMod) {?>
|
||||||
|
<option value="<?=$groupMod["userID"]?>">
|
||||||
|
<?=$groupMod["fullname"]?> (<?=$groupMod["username"]?>) (<?=$groupMod["role"]?>)
|
||||||
|
</option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
<button name="form"
|
||||||
|
value="deadmin"
|
||||||
|
>
|
||||||
|
Verwijder
|
||||||
|
</button>
|
||||||
|
</il>
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
|
<form class="platform" method="post">
|
||||||
|
<ul>
|
||||||
|
<h5>Verwijder groep</h5>
|
||||||
|
<li>
|
||||||
|
<label></label>
|
||||||
|
<input name="groupID" value="<?=$_GET["groupID"]?>" type="hidden">
|
||||||
|
<button class="red"
|
||||||
|
name="form"
|
||||||
|
value="delete"
|
||||||
|
><i class="fa fa-trash"></i> Verwijder groep</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
<div class="platform">
|
<div class="platform">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label></label>
|
<label></label>
|
||||||
<a href="group.php?groupname=<?=$groupinfo["name"]?>"><button class="fa fa-chevron-left"> Terug naar de groep</button></a>
|
<a href="group.php?groupname=<?=$groupinfo["name"]?>"><button><i class="fa fa-chevron-left"></i> Terug naar de groep</button></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="description" content="MyHyvesbook+ is het sociaal media voor alle coole mensen.">
|
<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="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
|
||||||
<meta name="author" content="MyHyvesbookplus corporation">
|
<meta name="author" content="MyHyvesbookplus corporation">
|
||||||
<title>MyHyvesbook+</title>
|
<title>MyHyvesbook+</title>
|
||||||
@@ -26,8 +26,8 @@ require_once ("../queries/user.php");
|
|||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if(!isset($_SESSION["userID"])){
|
if(!isset($_SESSION["userID"])) {
|
||||||
header("location:login.php");
|
header("location:login.php?url=" . "$_SERVER[REQUEST_URI]");
|
||||||
} else {
|
} else {
|
||||||
updateLastActivity();
|
updateLastActivity();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ $userinfo = getHeaderInfo();
|
|||||||
<div id="hello-loop">
|
<div id="hello-loop">
|
||||||
Hallo
|
Hallo
|
||||||
</div>
|
</div>
|
||||||
<?=$userinfo["fname"]?>
|
<?= $userinfo["fname"] ?>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<?php include("notification-center.php"); ?>
|
<?php include("notification-center.php"); ?>
|
||||||
|
|||||||
@@ -29,13 +29,12 @@ $user = $psw = $remember ="";
|
|||||||
$loginErr = $resetErr = $fbRegisterErr ="";
|
$loginErr = $resetErr = $fbRegisterErr ="";
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||||
$url = $_POST["url"];
|
|
||||||
// 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"], $url);
|
validateLogin($_POST["user"], $_POST["psw"], $_POST["url"]);
|
||||||
} catch(loginException $e) {
|
} catch(loginException $e) {
|
||||||
$loginErr = $e->getMessage();
|
$loginErr = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="description" content="MyHyvesbook+ is het sociaal media voor alle coole mensen.">
|
<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="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
|
||||||
<meta name="author" content="MyHyvesbookplus corporation">
|
<meta name="author" content="MyHyvesbookplus corporation">
|
||||||
<title>MyHyvesbook+</title>
|
<title>MyHyvesbook+</title>
|
||||||
|
|||||||
@@ -5,14 +5,6 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
|
|||||||
?>
|
?>
|
||||||
<div class='post-header header'>
|
<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'>
|
<span class='postinfo'>
|
||||||
gepost door <?=$fullname?>,
|
gepost door <?=$fullname?>,
|
||||||
<span class='posttime' title='<?=$post['creationdate']?>'>
|
<span class='posttime' title='<?=$post['creationdate']?>'>
|
||||||
@@ -20,7 +12,14 @@ $fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . "
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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'>
|
<div class='post-content'>
|
||||||
<p><?=$post['content']?></p>
|
<p><?=$post['content']?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,13 +4,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="user-box">
|
<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="platform">
|
||||||
<div class="status-buttons-container">
|
<div class="status-buttons-container">
|
||||||
|
<div>
|
||||||
<button disabled class="gray">
|
<button disabled class="gray">
|
||||||
<?= $user["onlinestatus"] ?>
|
<?= $user["onlinestatus"] ?>
|
||||||
</button>
|
</button>
|
||||||
<button disabled class="gray"><?= $user["role"] ?></button>
|
</div>
|
||||||
|
<div>
|
||||||
|
<button disabled class="gray">
|
||||||
|
<?= $user["role"] ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="friend-button-container">
|
<div class="friend-button-container">
|
||||||
<p>:)</p>
|
<p>:)</p>
|
||||||
@@ -33,7 +39,6 @@
|
|||||||
<?php if($showProfile) { ?>
|
<?php if($showProfile) { ?>
|
||||||
<div class="item-box platform">
|
<div class="item-box platform">
|
||||||
<h3>Informatie</h3>
|
<h3>Informatie</h3>
|
||||||
<p>
|
|
||||||
<ul>
|
<ul>
|
||||||
<?php if ($user["showBday"]) { ?>
|
<?php if ($user["showBday"]) { ?>
|
||||||
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
|
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
|
||||||
@@ -44,7 +49,6 @@
|
|||||||
<li>Locatie: <?= $user["location"] ?></li>
|
<li>Locatie: <?= $user["location"] ?></li>
|
||||||
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
|
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-box platform">
|
<div class="item-box platform">
|
||||||
@@ -52,7 +56,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
while($friend = $profile_friends->fetch()) {
|
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>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ $settings = getSettings();
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<?php $currentbday = new DateTime($settings["birthdate"]); ?>
|
<?php $currentbday = new DateTime($settings["birthdate"]); ?>
|
||||||
<label for="bday">Geboortedatum</label>
|
<label>Geboortedatum</label>
|
||||||
<select name='day' id="bday">
|
<select name='day'>
|
||||||
<?php for ($day = 1; $day <= 31; $day++): ?>
|
<?php for ($day = 1; $day <= 31; $day++): ?>
|
||||||
<option value='<?=$day?>'
|
<option value='<?=$day?>'
|
||||||
<?=($day == $currentbday->format("d")) ? "selected" : ""?>
|
<?=($day == $currentbday->format("d")) ? "selected" : ""?>
|
||||||
@@ -55,7 +55,7 @@ $settings = getSettings();
|
|||||||
</option>
|
</option>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</select>
|
</select>
|
||||||
<select name='month' id="bday">
|
<select name='month'>
|
||||||
<?php
|
<?php
|
||||||
$months = array ("januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus",
|
$months = array ("januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus",
|
||||||
"september", "oktober", "november", "december");
|
"september", "oktober", "november", "december");
|
||||||
@@ -68,7 +68,7 @@ $settings = getSettings();
|
|||||||
</option>
|
</option>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</select>
|
</select>
|
||||||
<select name='year' id="bday">
|
<select name='year'>
|
||||||
<?php
|
<?php
|
||||||
$now = (new DateTime)->format("Y");
|
$now = (new DateTime)->format("Y");
|
||||||
for ($year = $now; $year >= 1900; $year--): ?>
|
for ($year = $now; $year >= 1900; $year--): ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user