Subversion Repositories taios

Rev

Rev 290 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

$pageName = $_GET['page'];
if (empty($pageName))
{
    $pageName = 'Index';
}

$page = new Taios_Page('Edit Page - ' . $pageName, '../');
$page->drawHeader();
$page->drawMiddle();

$page->checkLoggedIn();

if ($page->isUserGM($page->getLoggedInUser()))
{
    $pageName = str_replace("../", "/", $pageName);

    $filename = 'pages/' . $pageName . '.txt';
   
    $content = "";

    $fp = @fopen($filename, 'r');
    if ($fp)
    {
        $content = fread($fp, filesize($filename));
        fclose($fp);
    }
   
?>

<form action="edit-do.php" method="POST">
<input type="hidden" name="page" value="<?php echo $pageName; ?>" />
<table>
<tr>
<td><textarea name="content"><?php write($content); ?></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Edit" /></td>
</tr>
</table>
</form>

<?php
}
else
{
    $page->drawError('You do not have permission to access this page.');
}

$page->drawFooter();

?>