Subversion Repositories taios

Rev

Rev 484 | Rev 515 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
215 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Edit Project', '../');
6
 
216 tom 7
$project = $page->getProject($page->getPostID());
215 tom 8
if (!$project)
9
{
216 tom 10
    $page->drawError('No such project, #' . $page->getPostID());
215 tom 11
}
12
 
13
$title = $_POST['title'];
14
$description = $_POST['description'];
15
$logoURL = $_POST['logourl'];
16
$websiteURL = $_POST['websiteurl'];
17
$downloadURL = $_POST['downloadurl'];
18
$latestVersion = $_POST['latestversion'];
19
 
20
$page->checkLoggedIn();
21
$user = $page->getLoggedInUser();
22
 
23
if ($page->isUserAdmin($page->getLoggedInUser()) || $page->getLoggedInUser()->ID == $project->author->ID)
24
{
492 tom 25
    if (!empty($title)) {
26
        $page->query("UPDATE Projects SET Title = ? WHERE ID = ?", array($title, $project->ID));
215 tom 27
    }
492 tom 28
 
29
    if (!empty($description)) {
30
        $page->query("UPDATE Projects SET Description = ? WHERE ID = ?", array($description, $project->ID));
215 tom 31
    }
492 tom 32
 
33
    if (!empty($logoURL)) {
34
        $page->query("UPDATE Projects SET LogoURL = ? WHERE ID = ?", array($logoURL, $project->ID));
215 tom 35
    }
492 tom 36
 
37
    if (!empty($websiteURL)) {
38
        $page->query("UPDATE Projects SET WebsiteURL = ? WHERE ID = ?", array($websiteURL, $project->ID));
215 tom 39
    }
492 tom 40
 
41
    if (!empty($downloadURL)) {
42
        $page->query("UPDATE Projects SET DownloadURL = ? WHERE ID = ?", array($downloadURL, $project->ID));
215 tom 43
    }
492 tom 44
 
45
    if (!empty($latestVersion)) {
46
        $page->query("UPDATE Projects SET LatestVersion = ? WHERE ID = ?", array($latestVersion,  $project->ID));
215 tom 47
    }
48
 
492 tom 49
    $page->query("UPDATE Projects SET LastUpdate = NOW() WHERE ID = ?", array($project->ID));
215 tom 50
 
51
    $page->redirect('index.php');
492 tom 52
} else {
215 tom 53
    $page->drawError('You do not have permission to access this page.');
54
}
55
 
56
?>