From 75cf05006c9d77d01def2fe8688b3f6a503096b4 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 19 Sep 2017 02:49:16 +0200 Subject: [PATCH] page: omit edit link if unwritable --- page.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/page.inc.php b/page.inc.php index 9d49fad..7c8e191 100644 --- a/page.inc.php +++ b/page.inc.php @@ -11,7 +11,18 @@ if (isset($User)) { print '

'; printf('Ingelogd: %s', $User['name']); if ($User['admin']) { - print ' Wijzig'; + $editpage = $Page.$Args; + if (is_dir($editpage)) { + if (file_exists("$editpage/index.html")) { + $editpage .= '/index.html'; + } + } + else { + $editpage .= '.html'; + } + if (is_writable($editpage)) { + print ' Wijzig'; + } } print "

\n"; } -- 2.30.0