Improvements to wiki and comments code, take advantage of improvements in user auth interfaca

This commit is contained in:
Uriel 2008-10-22 09:20:06 +02:00
parent 746b70d971
commit 3d2be79505

View file

@ -26,8 +26,7 @@ gensidebar
%} %}
</div> </div>
% # TODO: probably should check if we have the right perms % if (! ~ $#wiki 0 && test -f $body.md && check_user $wiki_editors_group) {
% if (! ~ $#wiki 0 && test -f $body.md && get_user && ! ~ $#logged_user 0) {
<div> <div>
<form action="/_apps/dirdir/edit" method="POST"> <form action="/_apps/dirdir/edit" method="POST">
<input type="hidden" name="edit_wiki_page" value="%($req_path%)" /> <input type="hidden" name="edit_wiki_page" value="%($req_path%)" />
@ -43,7 +42,6 @@ gensidebar
% } % }
<div id="main-copy"> <div id="main-copy">
% genbody % genbody
% if (! ~ $#allowComments 0) { % if (! ~ $#allowComments 0) {
@ -52,20 +50,26 @@ gensidebar
cdir = $body.md_werc/comments cdir = $body.md_werc/comments
if (test -d $cdir) { if (test -d $cdir) {
echo '<hr /><h2>Comments</h2>' echo '<hr /><h2>Comments</h2>'
for(c in `{ls $cdir}) { for(c in `{ls $cdir/}) {
parse_rec $c %}
<div>
echo '<div>' % echo By: `{cat $c/user}
echo User: $rec_user_name '<br />' <br />
echo $rec_data | escape_html | sed 's,$,<br />,' % cat $c/body | escape_html | sed 's,$,<br />,'
echo '<hr /></div>' <hr /></div>
%{
} }
} }
%} %}
<hr /><hr />
<form action="" method="post"> <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> <textarea name="comment_text" id="comment_text" cols="80" rows="16"></textarea>
<input type="submit" name="post_comment" value="Post a comment" />
</form> </form>
% } % }