Rev 484 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
278 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Edit Category', '../'); |
||
6 | |||
7 | $page->checkLoggedIn(); |
||
8 | |||
9 | $id = $page->getPostID(); |
||
10 | |||
11 | $title = $_POST['title']; |
||
12 | $description = $_POST['description']; |
||
13 | |||
493 | tom | 14 | if ($page->isUserAdmin($page->getLoggedInUser())) { |
15 | if (empty($title)) { |
||
278 | tom | 16 | $page->redirect('edit-category.php?error=No Title Specified'); |
17 | } |
||
18 | |||
493 | tom | 19 | $args = array($title, $description, $id); |
20 | $page->query("UPDATE ForumCategories SET Title = ?, Description = ? WHERE ID = ?", $args); |
||
278 | tom | 21 | $page->redirect('index.php'); |
493 | tom | 22 | } else { |
278 | tom | 23 | $page->drawError('You do not have permission to access this page.'); |
24 | } |
||
25 | |||
26 | ?> |