[CMF-checkins] CVS: CMF/CMFDefault/skins/generic - discussion_reply.py:1.2 discussion_reply_form.dtml:1.6 discussion_reply_preview.dtml:1.5
Florent Guillaume
fg@nuxeo.com
Sat, 29 Jun 2002 17:00:39 -0400
Update of /cvs-repository/CMF/CMFDefault/skins/generic
In directory cvs.zope.org:/tmp/cvs-serv654/CMFDefault/skins/generic
Modified Files:
discussion_reply.py discussion_reply_form.dtml
discussion_reply_preview.dtml
Log Message:
Made discussion replies work correctly when hitting Enter in the title
field (Tracker #515), and corrected discussion Preview followed by an
Edit that lost body information (Tracker #516).
Put Creator computation in discussion_reply.py, no need to get it from
the forms. The Creator can still be spoofed though by using a URL like
doc/talkback/createReply?title=foo&text=bar&Creator=mickeymouse but this
is less obvious to script kiddies. But createReply should really compute
the creator itself.
Simplified a bit the page templates.
Fixed dtml to html_quote everything.
Removed spurious "This is evaluated." text.
=== CMF/CMFDefault/skins/generic/discussion_reply.py 1.1 => 1.2 ===
-##parameters=title,text,Creator
+##parameters=title,text
##title=Reply to content
+Creator = context.portal_membership.getAuthenticatedMember().getUserName()
replyID = context.createReply( title = title
, text = text
, Creator = Creator
=== CMF/CMFDefault/skins/generic/discussion_reply_form.dtml 1.5 => 1.6 ===
<form method="POST" action="<dtml-var expr="absolute_url() + '/talkback'">">
-<dtml-let member="portal_membership.getAuthenticatedMember()">
-<input type="hidden" name="Creator" value="&dtml-member;">
-</dtml-let>
+<input type="hidden" name=":default_method" value="discussion_reply">
<table class="FormLayout">
<tr>
<th align="left">Subject (Title)</th>
<td><input name="title" value="<dtml-if title_override
- ><dtml-var title_override><dtml-else><dtml-var title></dtml-if>"></td>
+ >&dtml-title_override;<dtml-else>&dtml-title;</dtml-if>"></td>
</tr>
<tr>
<td colspan="2">
<b>Reply body</b><br>
<textarea name="text" cols="70" rows="10" wrap="soft" style="width: 100%"
- ><dtml-if text_override><dtml-var text_override
- ></dtml-if></textarea>
+ ><dtml-if text_override>&dtml-text_override;</dtml-if></textarea>
</td>
</tr>
<tr>
=== CMF/CMFDefault/skins/generic/discussion_reply_preview.dtml 1.4 => 1.5 ===
-<h3><dtml-var "REQUEST.form['title']"></h3>
+<h3><dtml-var "REQUEST.form['title']" html_quote></h3>
<dtml-var "REQUEST.form['text']" fmt="structured-text">
@@ -13,9 +13,6 @@
value="<dtml-var "REQUEST.form['title']" html_quote>">
<input type="hidden" name="text_override"
value="<dtml-var "REQUEST.form['text']" html_quote>">
- <dtml-let member="portal_membership.getAuthenticatedMember()">
- <input type="hidden" name="Creator" value="&dtml-member;">
- </dtml-let>
<table><tr>
<td width="15%"></td>
<td>