git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
396a686
)
page: omit edit link if unwritable
author
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 19 Sep 2017 00:49:16 +0000
(
02:49
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 27 Sep 2017 23:30:39 +0000
(
01:30
+0200)
page.inc.php
patch
|
blob
|
history
diff --git
a/page.inc.php
b/page.inc.php
index 9d49fad2df8050b4ac7daa86bf903080a9b34bb9..7c8e191aa2485d5060f8d44d5d02209354a79a98 100644
(file)
--- a/
page.inc.php
+++ b/
page.inc.php
@@
-11,7
+11,18
@@
if (isset($User)) {
print '<div class="login"><p>';
printf('<span>Ingelogd: <b>%s</b></span>', $User['name']);
if ($User['admin']) {
- print ' <a href="#edit">Wijzig</a>';
+ $editpage = $Page.$Args;
+ if (is_dir($editpage)) {
+ if (file_exists("$editpage/index.html")) {
+ $editpage .= '/index.html';
+ }
+ }
+ else {
+ $editpage .= '.html';
+ }
+ if (is_writable($editpage)) {
+ print ' <a href="#edit">Wijzig</a>';
+ }
}
print "</p></div>\n";
}