Rev 231 | Go to most recent revision | Details | 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); |
||
22 | } |
||
23 | else |
||
24 | { |
||
25 | $page->drawError('Failed to write file.'); |
||
26 | } |
||
27 | } |
||
28 | else |
||
29 | { |
||
30 | $page->drawError('You do not have permission to access this page.'); |
||
31 | } |
||
32 | |||
33 | $page->drawFooter(); |
||
34 | |||
35 | ?> |
||
36 |