requireAuth(); $attrs = $as->getAttributes(); $pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $projectManager = new \pvv\side\ProjectManager($pdo); $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, 'Nytt Prosjekt', '', $attrs["cn"][0], $attrs["uid"][0], $attrs["mail"][0], 1 ); if($new == 0){ $project = $projectManager->getByID($projectID); $owner = $projectManager->getProjectOwner($projectID); if($owner['uname'] != $attrs["uid"][0]){ header('HTTP/1.0 403 Forbidden'); echo "wrong user"; exit(); } } ?>