Subversion Repositories taios

Rev

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

<?php

require '../_taios.php';

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

$page->checkLoggedIn();

$id = $page->getPostID();

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

if ($page->isUserAdmin($page->getLoggedInUser())) {
    if (empty($title)) {
        $page->redirect('edit-category.php?error=No Title Specified');
    }
   
    $args = array($title, $description, $id);
    $page->query("UPDATE ForumCategories SET Title = ?, Description = ? WHERE ID = ?", $args);
    $page->redirect('index.php');
} else {
    $page->drawError('You do not have permission to access this page.');
}

?>