Subversion Repositories taios

Rev

Rev 215 | Rev 484 | 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
{
25
    if (!empty($title))
26
    {
27
        $page->query('UPDATE Projects SET Title = "' . $title . '" WHERE ID = ' . $project->ID);
28
    }
29
    if (!empty($description))
30
    {
31
        $page->query('UPDATE Projects SET Description = "' . $description . '" WHERE ID = ' . $project->ID);
32
    }
33
    if (!empty($logoURL))
34
    {
35
        $page->query('UPDATE Projects SET LogoURL = "' . $logoURL . '" WHERE ID = ' . $project->ID);
36
    }
37
    if (!empty($websiteURL))
38
    {
39
        $page->query('UPDATE Projects SET WebsiteURL = "' . $websiteURL . '" WHERE ID = ' . $project->ID);
40
    }
41
    if (!empty($downloadURL))
42
    {
43
        $page->query('UPDATE Projects SET DownloadURL = "' . $downloadURL . '" WHERE ID = ' . $project->ID);
44
    }
45
    if (!empty($latestVersion))
46
    {
47
        $page->query('UPDATE Projects SET LatestVersion = "' . $latestVersion . '" WHERE ID = ' . $project->ID);
48
    }
49
 
50
    $page->query('UPDATE Projects SET LastUpdate = NOW() WHERE ID = ' . $project->ID);
51
 
52
    $page->redirect('index.php');
53
}
54
else
55
{
56
    $page->drawError('You do not have permission to access this page.');
57
}
58
 
59
?>