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); $project_is_new = false; if (isset($_GET['new'])) { $project_is_new = $_GET['new']; } $projectID = 0; if (isset($_GET['id'])) { $projectID = $_GET['id']; } elseif (!$project_is_new) { echo "\nID not set"; exit; } $project = new pvv\side\Project( id: 0, title: 'Nytt Prosjekt', description_en: null, description_no: null, gitea_link: null, issue_board_link: null, wiki_link: null, programming_languages: null, technologies: null, keywords: null, license: null, logo_url: null ); if (!$project_is_new) { $project = $projectManager->getByID($projectID); $maintainers = $projectManager->getProjectMaintainers($projectID); if ($owner['uname'] != $attrs['uid'][0]) { header('HTTP/1.0 403 Forbidden'); echo 'wrong user'; exit; } } ?>