Rev 484 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
202 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Add Project', '../'); |
||
6 | |||
7 | $title = $_POST['title']; |
||
8 | $description = $_POST['description']; |
||
9 | $logoURL = $_POST['logourl']; |
||
10 | $websiteURL = $_POST['websiteurl']; |
||
11 | $downloadURL = $_POST['downloadurl']; |
||
206 | tom | 12 | $latestVersion = $_POST['latestversion']; |
202 | tom | 13 | |
14 | $page->checkLoggedIn(); |
||
15 | $user = $page->getLoggedInUser(); |
||
16 | |||
492 | tom | 17 | if (empty($title)) { |
202 | tom | 18 | $page->redirect('add-project.php?error=No Title Specified'); |
19 | } |
||
492 | tom | 20 | |
21 | if (empty($description)) { |
||
202 | tom | 22 | $page->redirect('add-project.php?error=No Title Specified'); |
23 | } |
||
24 | |||
492 | tom | 25 | if ($page->isUserGM($user)) { |
26 | $args = array($user->ID, $title, $description, $logoURL, $downloadURL, $websiteURL, $latestVersion); |
||
27 | $page->query("INSERT INTO Projects VALUES (0, ?, ?, ?, ?, ?, ?, ?, NOW())", $args); |
||
202 | tom | 28 | $page->redirect('index.php'); |
492 | tom | 29 | } else { |
202 | tom | 30 | $page->drawError('You do not have permission to access this page.'); |
31 | } |
||
32 | |||
33 | ?> |