Prosjektadministrasjon
= ($new == 1 ? "Nytt prosjekt" : "Rediger prosjekt"); ?>
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $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, 'prosjekt')){ echo 'Her har du ikke lov\'t\'å\'værra!!!'; exit(); } $projectManager = new \pvv\side\ProjectManager($pdo); $projects = $projectManager->getAll(); $new = 0; if(isset($_GET['new'])){ $new = $_GET['new']; } $projectID = 0; if(isset($_GET['id'])){ $projectID = $_GET['id']; }else if($new == 0){ echo "\nID not set"; exit(); } $project = new \pvv\side\Project( 0, 'Kult Prosjekt', '', 'kåre knoll', 'pvvadmin', 'drift@pvv.ntnu.no', 0 ); if($new == 0){ $project = $projectManager->getByID($projectID); } $members = $projectManager->getProjectMembers($projectID); $owner = [ 'name' => '', 'uname' => '', 'mail' => '', ]; foreach($members as $i => $data){ if($data['owner']){ $owner = $data; } } ?>