Subversion Repositories taios

Rev

Rev 515 | 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
 
518 freddie 5
$page = new Taios_Page('Add Project', '../');
6
 
515 freddie 7
$page->checkCSRFToken($page->getLoggedInUser()->ID, $_POST['csrftoken']);
8
 
202 tom 9
$title = $_POST['title'];
10
$description = $_POST['description'];
11
$logoURL = $_POST['logourl'];
12
$websiteURL = $_POST['websiteurl'];
13
$downloadURL = $_POST['downloadurl'];
206 tom 14
$latestVersion = $_POST['latestversion'];
202 tom 15
 
16
$page->checkLoggedIn();
17
$user = $page->getLoggedInUser();
18
 
492 tom 19
if (empty($title)) {
202 tom 20
    $page->redirect('add-project.php?error=No Title Specified');
21
}
492 tom 22
 
23
if (empty($description)) {
202 tom 24
    $page->redirect('add-project.php?error=No Title Specified');
25
}
26
 
492 tom 27
if ($page->isUserGM($user)) {
28
        $args = array($user->ID, $title, $description, $logoURL, $downloadURL, $websiteURL, $latestVersion);
29
    $page->query("INSERT INTO Projects VALUES (0, ?, ?, ?, ?, ?, ?, ?, NOW())", $args);
202 tom 30
    $page->redirect('index.php');
492 tom 31
} else {
202 tom 32
    $page->drawError('You do not have permission to access this page.');
33
}
34
 
35
?>