Compare commits
22 Commits
joey-testi
...
marijn-fav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3f4fa0b3c | ||
|
|
16f83d93ce | ||
|
|
306fd3090f | ||
|
|
771567660c | ||
|
|
4eae09dfc7 | ||
|
|
53e1d7fef3 | ||
|
|
c29be662bc | ||
|
|
000d1f4072 | ||
|
|
d260bf04bc | ||
|
|
a0ef234b79 | ||
|
|
da061de226 | ||
|
|
f18088d8d2 | ||
|
|
c69b5d8ed3 | ||
|
|
5de3a84683 | ||
|
|
b8d6136a9d | ||
|
|
1862369013 | ||
|
|
5e8fa6791f | ||
|
|
28e9269b52 | ||
|
|
bb352c7a7a | ||
|
|
0f202088a1 | ||
|
|
fde736b8c5 | ||
|
|
afb45d6709 |
BIN
website/public/apple-touch-icon-114x114-precomposed.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
website/public/apple-touch-icon-120x120-precomposed.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
website/public/apple-touch-icon-144x144-precomposed.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
website/public/apple-touch-icon-152x152-precomposed.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
website/public/apple-touch-icon-180x180-precomposed.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
website/public/apple-touch-icon-57x57-precomposed.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
website/public/apple-touch-icon-60x60-precomposed.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
website/public/apple-touch-icon-72x72-precomposed.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
website/public/apple-touch-icon-76x76-precomposed.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
website/public/apple-touch-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
12
website/public/browserconfig.xml
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<browserconfig>
|
||||||
|
<msapplication>
|
||||||
|
<tile>
|
||||||
|
<square70x70logo src="tiny.png"/>
|
||||||
|
<square150x150logo src="square.jpg"/>
|
||||||
|
<wide310x150logo src="wide.jpg"/>
|
||||||
|
<square310x310logo src="large.jpg"/>
|
||||||
|
<TileColor>#000000</TileColor>
|
||||||
|
</tile>
|
||||||
|
</msapplication>
|
||||||
|
</browserconfig>
|
||||||
BIN
website/public/favicon-1.png
Normal file
|
After Width: | Height: | Size: 492 B |
BIN
website/public/favicon-2.png
Normal file
|
After Width: | Height: | Size: 782 B |
BIN
website/public/favicon-3.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
website/public/favicon-4.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
website/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 97 KiB |
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
include_once("../queries/group_page.php");
|
include_once("../queries/group_page.php");
|
||||||
|
|
||||||
if(!$group = selectGroupByName($_GET["groupname"])) {
|
if(isset($_SESSION["userID"]) and !$group = selectGroupByName($_GET["groupname"])) {
|
||||||
header("HTTP/1.0 404 Not Found");
|
header("HTTP/1.0 404 Not Found");
|
||||||
header("Location: error/404.php");
|
header("Location: error/404.php");
|
||||||
die();
|
die();
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -24,12 +24,14 @@ $(window).on("load", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Toggles all checkboxes based on one.
|
||||||
function checkAll() {
|
function checkAll() {
|
||||||
$('.checkbox-list').each(function () {
|
$('.checkbox-list').each(function () {
|
||||||
$(this).prop('checked', $('#checkall').prop('checked'));
|
$(this).prop('checked', $('#checkall').prop('checked'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Simple function that checks if checkall should stay checked.
|
||||||
function checkCheckAll() {
|
function checkCheckAll() {
|
||||||
var checked = true;
|
var checked = true;
|
||||||
|
|
||||||
@@ -43,6 +45,7 @@ function checkCheckAll() {
|
|||||||
$('#checkall').prop('checked', checked);
|
$('#checkall').prop('checked', checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Toggle of filter options.
|
||||||
function changeFilter() {
|
function changeFilter() {
|
||||||
if ($('#pagetype').find(":selected").val() == "group") {
|
if ($('#pagetype').find(":selected").val() == "group") {
|
||||||
document.getElementById('admin-filter').style.display = 'none';
|
document.getElementById('admin-filter').style.display = 'none';
|
||||||
@@ -59,11 +62,13 @@ function changeFilter() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sets the search page to one, relevant when changing filter or search.
|
||||||
function searchFromOne() {
|
function searchFromOne() {
|
||||||
$('#currentpage').prop('value', 1);
|
$('#currentpage').prop('value', 1);
|
||||||
adminSearch();
|
adminSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AJAX live search.
|
||||||
function adminSearch() {
|
function adminSearch() {
|
||||||
$.post(
|
$.post(
|
||||||
"API/adminSearchUsers.php",
|
"API/adminSearchUsers.php",
|
||||||
@@ -74,6 +79,7 @@ function adminSearch() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AJAX live update.
|
||||||
function adminUpdate(form) {
|
function adminUpdate(form) {
|
||||||
$.post(
|
$.post(
|
||||||
"API/adminChangeUser.php",
|
"API/adminChangeUser.php",
|
||||||
@@ -83,6 +89,7 @@ function adminUpdate(form) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AJAX pagenumber functionality.
|
||||||
function updatePageN() {
|
function updatePageN() {
|
||||||
$.post(
|
$.post(
|
||||||
"API/adminPageNumber.php",
|
"API/adminPageNumber.php",
|
||||||
@@ -92,11 +99,13 @@ function updatePageN() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Intended for the edit button to show a form.
|
||||||
function toggleBancomment(button) {
|
function toggleBancomment(button) {
|
||||||
$(button).siblings("div").toggle();
|
$(button).siblings("div").toggle();
|
||||||
$(button).toggle();
|
$(button).toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AJAX value editing.
|
||||||
function editComment(form) {
|
function editComment(form) {
|
||||||
$.post(
|
$.post(
|
||||||
"API/adminChangeUser.php",
|
"API/adminChangeUser.php",
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ function sendMessage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#newContent").val("");
|
$("#newContent").val("");
|
||||||
|
$("#newContent").focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add messages to the chat.
|
// Add messages to the chat.
|
||||||
|
|||||||
@@ -91,6 +91,21 @@ $(window).on("load", function() {
|
|||||||
loadMorePosts(userID, groupID, postAmount, postLimit);
|
loadMorePosts(userID, groupID, postAmount, postLimit);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$(document).keyup(function(e) {
|
||||||
|
if (e.keyCode == 27) {
|
||||||
|
closeModal();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.modal').click(function() {
|
||||||
|
closeModal();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.modal-content').click(function(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function closeModal() {
|
function closeModal() {
|
||||||
|
|||||||
BIN
website/public/large.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
website/public/launcher-icon-0-75x.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
website/public/launcher-icon-1-5x.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
website/public/launcher-icon-1x.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
website/public/launcher-icon-2x.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
website/public/launcher-icon-3x.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
website/public/launcher-icon-4x.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
44
website/public/manifest.json
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"name": "Web Application Manifest Sample",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "launcher-icon-0-75x.png",
|
||||||
|
"sizes": "36x36",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "0.75"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "launcher-icon-1x.png",
|
||||||
|
"sizes": "48x48",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "launcher-icon-1-5x.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "1.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "launcher-icon-2x.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "2.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "launcher-icon-3x.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "3.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "launcher-icon-4x.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "4.0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": "index.html",
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "portrait"
|
||||||
|
}
|
||||||
@@ -25,7 +25,8 @@ if(empty($_GET["username"])) {
|
|||||||
$userID = getUserID($_GET["username"]);
|
$userID = getUserID($_GET["username"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$user = selectUser($_SESSION["userID"], $userID)) {
|
|
||||||
|
if (isset($_SESSION["userID"]) and !$user = selectUser($_SESSION["userID"], $userID)) {
|
||||||
header("HTTP/1.0 404 Not Found");
|
header("HTTP/1.0 404 Not Found");
|
||||||
header("Location: error/404.php");
|
header("Location: error/404.php");
|
||||||
die();
|
die();
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
BIN
website/public/square.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
@@ -1,13 +1,15 @@
|
|||||||
.admin-panel {
|
|
||||||
min-width: 800px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-panel input[type="radio"], input[type="checkbox"] {
|
.admin-panel input[type="radio"], input[type="checkbox"] {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
|
width: 28px;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table-checkbox {
|
||||||
|
width: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
.admin-searchform {
|
.admin-searchform {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -34,13 +36,15 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.usertable .table-username {width: 150px}
|
.table-checkbox {width: 20px}
|
||||||
.usertable .table-status {width: 100px}
|
.table-username {width: 150px}
|
||||||
.usertable .table-action {width: 200px}
|
.table-status {width: 100px}
|
||||||
|
.table-action {width: 200px}
|
||||||
|
|
||||||
.usertable th, td {
|
.usertable th, td {
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.usertable th, tr {
|
.usertable th, tr {
|
||||||
@@ -51,6 +55,10 @@
|
|||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bancomment {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
.bancommentedit {
|
.bancommentedit {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
website/public/tiny.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
website/public/wide.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@@ -216,6 +216,7 @@ function test_input($data) {
|
|||||||
$data = trim($data);
|
$data = trim($data);
|
||||||
$data = stripslashes($data);
|
$data = stripslashes($data);
|
||||||
$data = htmlspecialchars($data);
|
$data = htmlspecialchars($data);
|
||||||
|
$data = trim($data);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,6 +2,10 @@
|
|||||||
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()
|
||||||
{
|
{
|
||||||
$createGroup = prepareQuery("
|
$createGroup = prepareQuery("
|
||||||
|
|||||||
@@ -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");
|
||||||
@@ -106,4 +165,28 @@ function upgradeUser(int $groupID, int $userID, string $role) {
|
|||||||
} else {
|
} else {
|
||||||
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,10 @@ function getSettings() {
|
|||||||
`location`,
|
`location`,
|
||||||
`birthdate`,
|
`birthdate`,
|
||||||
`bio`,
|
`bio`,
|
||||||
`profilepicture`,
|
IFNULL(
|
||||||
|
`profilepicture`,
|
||||||
|
'../img/avatar-standard.png'
|
||||||
|
) AS profilepicture,
|
||||||
`showBday`,
|
`showBday`,
|
||||||
`showEmail`,
|
`showEmail`,
|
||||||
`showProfile`
|
`showProfile`
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<th class="table-username">Groepsnaam</th>
|
<th class="table-username">Groepsnaam</th>
|
||||||
<th class="table-status">Status</th>
|
<th class="table-status">Status</th>
|
||||||
<th class="table-comment">Beschrijving</th>
|
<th class="table-comment">Beschrijving</th>
|
||||||
<th class="table-action">Actie</th>
|
<th class="table-action">Zichtbaarheid</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll()"></th>
|
<th class="table-checkbox"><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll()"></th>
|
||||||
<th class="table-username">Gebruikersnaam</th>
|
<th class="table-username">Gebruikersnaam</th>
|
||||||
<th class="table-status">Status</th>
|
<th class="table-status">Status</th>
|
||||||
<th class="table-comment">Aantekening</th>
|
<th class="table-comment">Aantekening</th>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
<!-- Form value holding. -->
|
||||||
<!-- function test_input taken from http://www.w3schools.com/php/php_form_validation.asp -->
|
|
||||||
<?php
|
<?php
|
||||||
$search = "";
|
$search = "";
|
||||||
$status = array("user", "frozen", "banned", "unconfirmed", "admin", "owner");
|
$status = array("user", "frozen", "banned", "unconfirmed", "admin", "owner");
|
||||||
@@ -127,11 +126,11 @@ if (isset($_GET["groupstatus"])) {
|
|||||||
if ($userinfo == 'owner') {
|
if ($userinfo == 'owner') {
|
||||||
echo "<button type=\"submit\"
|
echo "<button type=\"submit\"
|
||||||
name=\"batchactions\"
|
name=\"batchactions\"
|
||||||
id=\"admin\"
|
id=\"batch-admin\"
|
||||||
value=\"admin\">Maak Admin</button>
|
value=\"admin\">Maak Admin</button>
|
||||||
<button type=\"submit\"
|
<button type=\"submit\"
|
||||||
name=\"batchactions\"
|
name=\"batchactions\"
|
||||||
id=\"owner\"
|
id=\"batch-owner\"
|
||||||
value=\"owner\">Maak Eigenaar</button>";
|
value=\"owner\">Maak Eigenaar</button>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -140,9 +139,9 @@ if (isset($_GET["groupstatus"])) {
|
|||||||
onsubmit="adminUpdate(this); return false;">
|
onsubmit="adminUpdate(this); return false;">
|
||||||
|
|
||||||
<input type="hidden" name="groupbatchactions" id="groupbatchinput">
|
<input type="hidden" name="groupbatchactions" id="groupbatchinput">
|
||||||
<button type="submit" name="batchactions" id="hide" value="hidden">Verborgen</button>
|
<button type="submit" name="batchactions" id="batch-hide" value="hidden">Verborgen</button>
|
||||||
<button type="submit" name="batchactions" id="ban" value="public">Publiek</button>
|
<button type="submit" name="batchactions" id="batch-public" value="public">Publiek</button>
|
||||||
<button type="submit" name="batchactions" id="members" value="membersonly">Alleen Leden</button>
|
<button type="submit" name="batchactions" id="batch-members" value="membersonly">Alleen Leden</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -152,5 +151,3 @@ if (isset($_GET["groupstatus"])) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -2,6 +2,40 @@
|
|||||||
<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="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">
|
||||||
|
<!--Favicon-->
|
||||||
|
<!-- Desktop Browsers -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||||
|
|
||||||
|
<!-- Android: Chrome M39 and up-->
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
<!-- Android: Chrome M31 and up, ignored if manifest is present-->
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<link rel="icon" sizes="192x192" href="icon-192x192.png">
|
||||||
|
<!-- iOS -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="My Awesome Web App">
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180-precomposed.png">
|
||||||
|
<link href="apple-touch-icon-152x152-precomposed.png" sizes="152x152" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-144x144-precomposed.png" sizes="144x144" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-120x120-precomposed.png" sizes="120x120" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-114x114-precomposed.png" sizes="114x114" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-76x76-precomposed.png" sizes="76x76" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-72x72-precomposed.png" sizes="72x72" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-60x60-precomposed.png" sizes="60x60" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-57x57-precomposed.png" sizes="57x57" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-precomposed.png" rel="apple-touch-icon">
|
||||||
|
|
||||||
|
<!-- Windows 8 and IE 11 -->
|
||||||
|
<meta name="msapplication-config" content="browserconfig.xml" />
|
||||||
|
|
||||||
|
<!-- Windows -->
|
||||||
|
<meta name="application-name" content="My Awesome Web App" />
|
||||||
|
<meta name="msapplication-tooltip" content="Get the latest updates!" />
|
||||||
|
<meta name="msapplication-window" content="width=1024;height=768" />
|
||||||
|
<meta name="msapplication-navbutton-color" content="#FF3300" />
|
||||||
|
<meta name="msapplication-starturl" content="./" />
|
||||||
|
|
||||||
<title>MyHyvesbook+</title>
|
<title>MyHyvesbook+</title>
|
||||||
<!-- Add your javascript files here. -->
|
<!-- Add your javascript files here. -->
|
||||||
<script src="js/jquery.js"></script>
|
<script src="js/jquery.js"></script>
|
||||||
|
|||||||
@@ -3,6 +3,40 @@
|
|||||||
<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="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">
|
||||||
|
<!-- Favicon-->
|
||||||
|
<!-- Desktop Browsers -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||||
|
|
||||||
|
<!-- Android: Chrome M39 and up-->
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
<!-- Android: Chrome M31 and up, ignored if manifest is present-->
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<link rel="icon" sizes="192x192" href="icon-192x192.png">
|
||||||
|
<!-- iOS -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="My Awesome Web App">
|
||||||
|
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180-precomposed.png">
|
||||||
|
<link href="apple-touch-icon-152x152-precomposed.png" sizes="152x152" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-144x144-precomposed.png" sizes="144x144" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-120x120-precomposed.png" sizes="120x120" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-114x114-precomposed.png" sizes="114x114" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-76x76-precomposed.png" sizes="76x76" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-72x72-precomposed.png" sizes="72x72" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-60x60-precomposed.png" sizes="60x60" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-57x57-precomposed.png" sizes="57x57" rel="apple-touch-icon">
|
||||||
|
<link href="apple-touch-icon-precomposed.png" rel="apple-touch-icon">
|
||||||
|
|
||||||
|
<!-- Windows 8 and IE 11 -->
|
||||||
|
<meta name="msapplication-config" content="browserconfig.xml" />
|
||||||
|
|
||||||
|
<!-- Windows -->
|
||||||
|
<meta name="application-name" content="My Awesome Web App" />
|
||||||
|
<meta name="msapplication-tooltip" content="Get the latest updates!" />
|
||||||
|
<meta name="msapplication-window" content="width=1024;height=768" />
|
||||||
|
<meta name="msapplication-navbutton-color" content="#FF3300" />
|
||||||
|
<meta name="msapplication-starturl" content="./" />
|
||||||
|
|
||||||
<title>MyHyvesbook+</title>
|
<title>MyHyvesbook+</title>
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
|
|||||||
@@ -55,10 +55,17 @@
|
|||||||
<h3>Vrienden</h3>
|
<h3>Vrienden</h3>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
while($friend = $profile_friends->fetch()) {
|
$friendcount = $profile_friends->rowCount();
|
||||||
|
$frienddif = $friendcount - 7;
|
||||||
|
|
||||||
|
for ($i = 0; $i < min($friendcount, 7); $i += 1) {
|
||||||
|
$friend = $profile_friends->fetch();
|
||||||
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>";
|
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>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($frienddif > 0) {
|
||||||
|
echo $frienddif === 1 ? "en nog 1 andere." : "...en nog $frienddif anderen.";
|
||||||
|
}
|
||||||
|
|
||||||
if($profile_friends->rowCount() === 0) {
|
if($profile_friends->rowCount() === 0) {
|
||||||
echo "<p>Deze gebruiker heeft nog geen vrienden gemaakt.</p>";
|
echo "<p>Deze gebruiker heeft nog geen vrienden gemaakt.</p>";
|
||||||
@@ -71,10 +78,18 @@
|
|||||||
<h3>Groepen</h3>
|
<h3>Groepen</h3>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
while($group = $profile_groups->fetch()) {
|
$groupcount = $profile_groups->rowCount();
|
||||||
|
$groupdif = $groupcount - 7;
|
||||||
|
|
||||||
|
for ($i = 0; $i < min($groupcount, 7); $i += 1) {
|
||||||
|
$group = $profile_groups->fetch();
|
||||||
echo "<a href='group.php?groupname=${group['name']}' data-title='${group["name"]}'><img class='group-picture' src='${group["picture"]}' alt='${group["name"]}s logo'></a>";
|
echo "<a href='group.php?groupname=${group['name']}' data-title='${group["name"]}'><img class='group-picture' src='${group["picture"]}' alt='${group["name"]}s logo'></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($groupdif > 0) {
|
||||||
|
echo $groupdif === 1 ? "en nog 1 andere." : "...en nog $groupdif anderen.";
|
||||||
|
}
|
||||||
|
|
||||||
if($profile_groups->rowCount() === 0) {
|
if($profile_groups->rowCount() === 0) {
|
||||||
echo "<p>Deze gebruiker is nog geen lid van een groep.</p>";
|
echo "<p>Deze gebruiker is nog geen lid van een groep.</p>";
|
||||||
}
|
}
|
||||||
|
|||||||