Subversion Repositories taios

Rev

Rev 267 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

$page = new Taios_Page('Add Category', '../');
$page->drawHeader();
$page->drawMiddle();

$page->checkLoggedIn();

$parentID = $_GET['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 (0, ' . $parentID . ', "' . $title . '", "' . $description . '")');
    $page->redirect('index.php?parentID=' . $parentID);
}
else
{
    $page->drawError('You do not have permission to access this page.');
}

$page->drawFooter();

?>