Rev 486 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 229 | tom | 1 | <?php |
| 2 | |||
| 3 | require '../_taios.php'; |
||
| 496 | muzer | 4 | if (get_magic_quotes_gpc()) { |
| 5 | $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); |
||
| 6 | while (list($key, $val) = each($process)) { |
||
| 7 | foreach ($val as $k => $v) { |
||
| 8 | unset($process[$key][$k]); |
||
| 9 | if (is_array($v)) { |
||
| 10 | $process[$key][stripslashes($k)] = $v; |
||
| 11 | $process[] = &$process[$key][stripslashes($k)]; |
||
| 12 | } else { |
||
| 13 | $process[$key][stripslashes($k)] = stripslashes($v); |
||
| 14 | } |
||
| 15 | } |
||
| 16 | } |
||
| 17 | unset($process); |
||
| 18 | } |
||
| 229 | tom | 19 | $pageName = $_GET['page']; |
| 20 | if (empty($pageName)) |
||
| 21 | { |
||
| 22 | $pageName = 'Index'; |
||
| 23 | } |
||
| 24 | |||
| 25 | $page = new Taios_Page('Edit Page - ' . $pageName, '../'); |
||
| 26 | $page->drawHeader(); |
||
| 27 | $page->drawMiddle(); |
||
| 28 | |||
| 290 | tom | 29 | $page->checkLoggedIn(); |
| 30 | |||
| 229 | tom | 31 | if ($page->isUserGM($page->getLoggedInUser())) |
| 32 | { |
||
| 486 | muzer | 33 | $pageName = str_replace("../", "/", $pageName); |
| 34 | |||
| 229 | tom | 35 | $filename = 'pages/' . $pageName . '.txt'; |
| 36 | |||
| 37 | $content = ""; |
||
| 38 | |||
| 39 | $fp = @fopen($filename, 'r'); |
||
| 40 | if ($fp) |
||
| 41 | { |
||
| 42 | $content = fread($fp, filesize($filename)); |
||
| 43 | fclose($fp); |
||
| 44 | } |
||
| 45 | |||
| 46 | ?> |
||
| 47 | |||
| 48 | <form action="edit-do.php" method="POST"> |
||
| 232 | tom | 49 | <input type="hidden" name="page" value="<?php echo $pageName; ?>" /> |
| 229 | tom | 50 | <table> |
| 51 | <tr> |
||
| 486 | muzer | 52 | <td><textarea name="content"><?php write($content); ?></textarea></td> |
| 229 | tom | 53 | </tr> |
| 54 | <tr> |
||
| 55 | <td><input type="submit" value="Edit" /></td> |
||
| 56 | </tr> |
||
| 57 | </table> |
||
| 58 | </form> |
||
| 59 | |||
| 60 | <?php |
||
| 61 | } |
||
| 62 | else |
||
| 63 | { |
||
| 64 | $page->drawError('You do not have permission to access this page.'); |
||
| 65 | } |
||
| 66 | |||
| 67 | $page->drawFooter(); |
||
| 68 | |||
| 69 | ?> |
||
| 70 |