22 Commits

Author SHA1 Message Date
Marijn Jansen
e3f4fa0b3c Favicon 2017-02-03 11:42:16 +01:00
Lars van Hijfte
16f83d93ce Merge branch 'lars' into 'master'
Lars

See merge request !206
2017-02-03 11:21:12 +01:00
Lars van Hijfte
306fd3090f Merge branch 'hendrik-testing' into 'master'
removed session id lol

See merge request !205
2017-02-03 11:20:24 +01:00
Hendrik
771567660c removed session id lol 2017-02-03 11:19:06 +01:00
Lars van Hijfte
4eae09dfc7 Merge branch 'master' into lars 2017-02-03 11:19:02 +01:00
Lars van Hijfte
53e1d7fef3 Fixed admin layout 2017-02-03 11:18:32 +01:00
Lars van Hijfte
c29be662bc Session logout now works 2017-02-03 11:18:17 +01:00
Lars van Hijfte
000d1f4072 Merge branch 'joey-testing' into 'master'
fixed login

See merge request !202
2017-02-03 11:16:48 +01:00
Lars van Hijfte
d260bf04bc Merge branch 'hendrik-testing' into 'master'
Hendrik testing

See merge request !204
2017-02-03 11:16:36 +01:00
Hendrik
a0ef234b79 Merge branch 'master' into hendrik-testing 2017-02-03 11:15:01 +01:00
Hendrik
da061de226 validated adminpanel, added shown friends limit in profile. 2017-02-03 11:14:03 +01:00
Marijn Jansen
f18088d8d2 Merge branch 'marijn-groups' into 'master'
Comments

See merge request !203
2017-02-03 11:13:46 +01:00
Marijn Jansen
c69b5d8ed3 Comments 2017-02-03 11:12:02 +01:00
Marijn Jansen
5de3a84683 Merge branch 'marijn-groups' into 'master'
Marijn groups

See merge request !201
2017-02-03 10:59:35 +01:00
Marijn Jansen
b8d6136a9d Added deadmin! 2017-02-03 10:59:10 +01:00
Lars van Hijfte
1862369013 Merge branch 'joey-testing' into 'master'
Joey testing

See merge request !200
2017-02-03 10:54:47 +01:00
Lars van Hijfte
5e8fa6791f Merge branch 'joey-testing' into 'master'
Fixed url

See merge request !198
2017-02-03 10:45:33 +01:00
Marijn Jansen
28e9269b52 Delete groups 2017-02-03 10:44:50 +01:00
Hendrik
bb352c7a7a merge 2017-02-03 10:41:29 +01:00
Hendrik
0f202088a1 Merge branch 'master' into hendrik-testing 2017-02-03 10:40:44 +01:00
Hendrik
fde736b8c5 misc 2017-02-03 10:33:44 +01:00
Hendrik
afb45d6709 add closing of modal on escape key and clicking outside 2017-02-02 15:51:27 +01:00
51 changed files with 355 additions and 89 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
website/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -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();

View File

@@ -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();

View File

@@ -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",

View File

@@ -51,6 +51,7 @@ function sendMessage() {
}); });
$("#newContent").val(""); $("#newContent").val("");
$("#newContent").focus();
} }
// Add messages to the chat. // Add messages to the chat.

View File

@@ -7,7 +7,7 @@ var facebookModal = document.getElementById("fbModal");
// Get the button that opens the modal // Get the button that opens the modal
var registerBtn = document.getElementById("registerBtn"); var registerBtn = document.getElementById("registerBtn");
var btn = document.getElementById("myBtn"); var btn = document.getElementById("myBtn");
var fbBtn = document.getElementById("fbBtn");
// Get the <span> element that closes the modal // Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0]; var span = document.getElementsByClassName("close")[0];
@@ -24,9 +24,6 @@ btn.onclick = function () {
registerBtn.onclick = function () { registerBtn.onclick = function () {
registerModal.style.display = "block"; registerModal.style.display = "block";
} }
fbBtn.onclick = function () {
facebookModal.style.display = "block";
}
/** /**
* WHen the user clicks on (X), close the modal * WHen the user clicks on (X), close the modal

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

44
website/public/manifest.json Executable file
View 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"
}

View File

@@ -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();

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
website/public/wide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -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;
} }

View File

@@ -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);
} }

View File

@@ -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("

View File

@@ -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");
}
}

View File

@@ -1,9 +1,5 @@
<?php <?php
/**
* Returns 1 if an username exists with the filled in username.
* @return int
*/
function getExistingUsername() { function getExistingUsername() {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
@@ -20,10 +16,6 @@ function getExistingUsername() {
} }
/**
* Returns 1 if an username exists with facebooklogin
* @return int
*/
function getExistingFBUsername() { function getExistingFBUsername() {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
@@ -40,10 +32,6 @@ function getExistingFBUsername() {
} }
/**
* Returns 1 if an email exists with the filled in email.
* @return int
*/
function getExistingEmail() { function getExistingEmail() {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
@@ -60,10 +48,6 @@ function getExistingEmail() {
} }
/**
* Returns 1 if an email exists with facebook register
* @return int
*/
function getExistingFBEmail() { function getExistingFBEmail() {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
@@ -81,10 +65,6 @@ function getExistingFBEmail() {
} }
/**
* Returns 1 if an email exists with the forgot email input
* @return int
*/
function getResetEmail() { function getResetEmail() {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
@@ -101,9 +81,6 @@ function getResetEmail() {
} }
/**
* Registers a new account in the database
*/
function registerAccount() { function registerAccount() {
$stmt = prepareQuery(" $stmt = prepareQuery("
INSERT INTO INSERT INTO
@@ -142,9 +119,6 @@ function registerAccount() {
$stmt->rowCount(); $stmt->rowCount();
} }
/**
* Registers a new account with facebook register
*/
function fbRegisterAccount() { function fbRegisterAccount() {
$stmt = prepareQuery(" $stmt = prepareQuery("
INSERT INTO INSERT INTO
@@ -184,11 +158,6 @@ function fbRegisterAccount() {
return $stmt->execute(); return $stmt->execute();
} }
/**
* Checks which dates need to be selected when there is an invalid registration.
* @param $date
* @param $value
*/
function submitselect($date, $value){ function submitselect($date, $value){
if ($date == $value){ if ($date == $value){
echo "selected"; echo "selected";

View File

@@ -1,10 +1,6 @@
<?php <?php
include_once "../queries/connect.php"; include_once "../queries/connect.php";
/**
* Sends a link to an email to change the password of an account
* @param string $email
*/
function sendPasswordRecovery(string $email) { function sendPasswordRecovery(string $email) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)) { if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$stmt = prepareQuery(" $stmt = prepareQuery("
@@ -28,16 +24,11 @@ function sendPasswordRecovery(string $email) {
$hashedHash = password_hash($hash, PASSWORD_DEFAULT); $hashedHash = password_hash($hash, PASSWORD_DEFAULT);
setHashToDatabase($userID, $hash); setHashToDatabase($userID, $hash);
doSendPasswordRecovery($userID, $email, $username, $hashedHash); doSendPasswordRecovery($userID, $email, $username, $hashedHash);
} else {
// TODO: Be angry!
} }
} }
/**
* Sets the message in the email to reset a password of an account.
* @param int $userID
* @param string $email
* @param string $username
* @param string $hash
*/
function doSendPasswordRecovery(int $userID, string $email, string $username, string $hash) { function doSendPasswordRecovery(int $userID, string $email, string $username, string $hash) {
$resetLink = "https://myhyvesbookplus.nl/resetpassword.php?u=$userID&h=$hash"; $resetLink = "https://myhyvesbookplus.nl/resetpassword.php?u=$userID&h=$hash";
@@ -47,11 +38,6 @@ function doSendPasswordRecovery(int $userID, string $email, string $username, st
mail($email, $subject, $body, $header); mail($email, $subject, $body, $header);
} }
/**
* Sets the previous password invalid.
* @param int $userID
* @param string $hash
*/
function setHashToDatabase(int $userID, string $hash) { function setHashToDatabase(int $userID, string $hash) {
$stmt = prepareQuery(" $stmt = prepareQuery("
UPDATE UPDATE

View File

@@ -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`

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,9 +1,3 @@
<?php
if(isset($acces_token)) {
echo '<button id="fbBtn" class="button">Facebook registreer</button>';
}
?>
<!-- The Modal --> <!-- The Modal -->
<div id="fbModal" class="modal"> <div id="fbModal" class="modal">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"

View File

@@ -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>

View File

@@ -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>

View File

@@ -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"

View File

@@ -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>";
} }