commit ef37105662c273e32b79f1bd135e0d13cad39969
parent 1e2fdacb2cc4ce91d605512951ff0d8e5f6f33eb
Author: uriel@engel.se.cat-v.org <unknown>
Date: Wed, 22 Oct 2008 09:20:06 +0200
Improvements to wiki and comments code, take advantage of improvements in user auth interfaca
Diffstat:
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/lib/default_master.tpl b/lib/default_master.tpl
@@ -26,8 +26,7 @@ gensidebar
%}
</div>
-% # TODO: probably should check if we have the right perms
-% if (! ~ $#wiki 0 && test -f $body.md && get_user && ! ~ $#logged_user 0) {
+% if (! ~ $#wiki 0 && test -f $body.md && check_user $wiki_editors_group) {
<div>
<form action="/_apps/dirdir/edit" method="POST">
<input type="hidden" name="edit_wiki_page" value="%($req_path%)" />
@@ -43,7 +42,6 @@ gensidebar
% }
<div id="main-copy">
-
% genbody
% if (! ~ $#allowComments 0) {
@@ -52,20 +50,26 @@ gensidebar
cdir = $body.md_werc/comments
if (test -d $cdir) {
echo '<hr /><h2>Comments</h2>'
- for(c in `{ls $cdir}) {
- parse_rec $c
-
- echo '<div>'
- echo User: $rec_user_name '<br />'
- echo $rec_data | escape_html | sed 's,$,<br />,'
- echo '<hr /></div>'
+ for(c in `{ls $cdir/}) {
+%}
+ <div>
+% echo By: `{cat $c/user}
+ <br />
+% cat $c/body | escape_html | sed 's,$,<br />,'
+ <hr /></div>
+%{
}
}
%}
-
+<hr /><hr />
<form action="" method="post">
- <input type="text" name="comment_user_name" value="Anonimous glenda" /><input type="submit" name="post_comment" value="Post a comment" />
+% if(! check_user) {
+ User: <input type="text" name="comment_user_name" value="" /> Password:
+ <input type="password" name="comment_user_password" value="" />
+ <small>If you are not registered enter your desired user/password and your account will be created when your comment is approved.</small>
+% }
<textarea name="comment_text" id="comment_text" cols="80" rows="16"></textarea>
+ <input type="submit" name="post_comment" value="Post a comment" />
</form>
% }