X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/dff68e21ac958ebfb8164bca4cb2143c427f4330..66170c339bbcd8b87e23c47daa11359a99e0d02d:/www/edit.php diff --git a/www/edit.php b/www/edit.php index 897aada..e95ca3f 100644 --- a/www/edit.php +++ b/www/edit.php @@ -3,6 +3,7 @@ namespace phorkie; /** * Edit paste contents */ +$reqWritePermissions = true; require_once 'www-header.php'; $repo = new Repository(); @@ -10,13 +11,20 @@ $repo->loadFromRequest(); $repopo = new Repository_Post($repo); if ($repopo->process($_POST, $_SESSION)) { - redirect($repo->getLink('display')); + redirect($repo->getLink('display', null, true)); +} + +$file = null; +if (isset($_GET['file'])) { + $file = $repo->getFileByName($_GET['file']); } render( 'edit', array( 'repo' => $repo, + 'singlefile' => $file, + 'dh' => new \Date_HumanDiff(), 'htmlhelper' => new HtmlHelper(), ) );