Rev 230 | Rev 290 | 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 | |||
13 | if ($page->isUserGM($page->getLoggedInUser())) |
||
14 | { |
||
15 | $filename = 'pages/' . $pageName . '.txt'; |
||
16 | |||
17 | $fp = @fopen($filename, 'w'); |
||
18 | if ($fp) |
||
19 | { |
||
20 | fwrite($fp, $_POST['content']); |
||
21 | fclose($fp); |
||
231 | tom | 22 | |
23 | $page->redirect('index.php?page=' . $pageName); |
||
230 | tom | 24 | } |
25 | else |
||
26 | { |
||
27 | $page->drawError('Failed to write file.'); |
||
28 | } |
||
29 | } |
||
30 | else |
||
31 | { |
||
32 | $page->drawError('You do not have permission to access this page.'); |
||
33 | } |
||
34 | |||
35 | $page->drawFooter(); |
||
36 | |||
37 | ?> |
||
38 |