X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/97c4ac59eed8b66b2e7f85d8ac325b063fb8a0ce..19f1b5d2a1730f8e37c8fc5585d30b99e70a8575:/www/edit.php diff --git a/www/edit.php b/www/edit.php index db4428b..e95ca3f 100644 --- a/www/edit.php +++ b/www/edit.php @@ -3,23 +3,28 @@ namespace phorkie; /** * Edit paste contents */ +$reqWritePermissions = true; require_once 'www-header.php'; -if ($GLOBALS['phorkie']['auth']['secure'] > 0) { - require_once 'secure.php'; -} $repo = new Repository(); $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(), ) );