2017-10-07 23:12:10 +02:00
|
|
|
<?php
|
|
|
|
require __DIR__ . '/../../../src/_autoload.php';
|
2024-02-15 22:57:03 +01:00
|
|
|
require __DIR__ . '/../../../config.php';
|
2017-10-07 23:12:10 +02:00
|
|
|
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
|
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
2017-11-11 17:06:56 +01:00
|
|
|
$userManager = new \pvv\admin\UserManager($pdo);
|
|
|
|
|
|
|
|
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
|
|
|
$as = new SimpleSAML_Auth_Simple('default-sp');
|
|
|
|
$as->requireAuth();
|
|
|
|
$attrs = $as->getAttributes();
|
|
|
|
$uname = $attrs['uid'][0];
|
|
|
|
|
|
|
|
if(!$userManager->hasGroup($uname, 'aktiviteter')){
|
2017-11-11 20:37:04 +01:00
|
|
|
echo 'Her har du ikke lov\'t\'å\'værra!!!';
|
2017-11-11 17:06:56 +01:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2017-10-07 23:12:10 +02:00
|
|
|
$eventID = $_GET['id'];
|
|
|
|
|
|
|
|
$query = 'DELETE FROM events WHERE id=\'' . $eventID . '\'';
|
|
|
|
$statement = $pdo->prepare($query);
|
|
|
|
$statement->execute();
|
|
|
|
|
2017-10-12 00:38:28 +02:00
|
|
|
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
2017-10-08 03:33:42 +02:00
|
|
|
?>
|
|
|
|
|
2017-10-22 17:57:55 +02:00
|
|
|
<a href=".?page=1">Om du ikke ble omdirigert tilbake klikk her</a>
|