Subversion Repositories taios

Rev

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

<?php

require '../_taios.php';

$page = new Taios_Page('Add Category', '../');

$page->checkLoggedIn();

$parentID = $_POST['parentID'];
if (empty($parentID)) {
    $parentID = -1;
}

$title = $_POST['title'];
$description = $_POST['description'];

if ($page->isUserAdmin($page->getLoggedInUser())) {
    if (empty($title)) {
        $page->redirect('add-category.php?error=No Title Specified');
    }
   
    $page->query("INSERT INTO ForumCategories VALUES (0, ?, ?, ?)", array($parentID, $title, $description));
    $page->redirect('index.php?parentID=' . $parentID);
} else {
    $page->drawError('You do not have permission to access this page.');
}

?>