Subversion Repositories taios

Rev

Rev 484 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
266 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Add Category', '../');
6
 
7
$page->checkLoggedIn();
8
 
269 tom 9
$parentID = $_POST['parentID'];
493 tom 10
if (empty($parentID)) {
266 tom 11
    $parentID = -1;
12
}
13
 
14
$title = $_POST['title'];
15
$description = $_POST['description'];
16
 
493 tom 17
if ($page->isUserAdmin($page->getLoggedInUser())) {
18
    if (empty($title)) {
266 tom 19
        $page->redirect('add-category.php?error=No Title Specified');
20
    }
21
 
493 tom 22
    $page->query("INSERT INTO ForumCategories VALUES (0, ?, ?, ?)", array($parentID, $title, $description));
266 tom 23
    $page->redirect('index.php?parentID=' . $parentID);
493 tom 24
} else {
266 tom 25
    $page->drawError('You do not have permission to access this page.');
26
}
27
 
28
?>