Rev 231 | Rev 486 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
230 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $pageName = $_POST['page']; |
||
6 | if (empty($pageName)) |
||
7 | { |
||
8 | $pageName = 'Index'; |
||
9 | } |
||
10 | |||
11 | $page = new Taios_Page('Edit Page - ' . $pageName, '../'); |
||
12 | |||
290 | tom | 13 | $page->checkLoggedIn(); |
14 | |||
230 | tom | 15 | if ($page->isUserGM($page->getLoggedInUser())) |
16 | { |
||
17 | $filename = 'pages/' . $pageName . '.txt'; |
||
18 | |||
19 | $fp = @fopen($filename, 'w'); |
||
20 | if ($fp) |
||
21 | { |
||
22 | fwrite($fp, $_POST['content']); |
||
23 | fclose($fp); |
||
231 | tom | 24 | |
25 | $page->redirect('index.php?page=' . $pageName); |
||
230 | tom | 26 | } |
27 | else |
||
28 | { |
||
29 | $page->drawError('Failed to write file.'); |
||
30 | } |
||
31 | } |
||
32 | else |
||
33 | { |
||
34 | $page->drawError('You do not have permission to access this page.'); |
||
35 | } |
||
36 | |||
37 | $page->drawFooter(); |
||
38 | |||
39 | ?> |
||
40 |