[Zope-CVS] CVS: Products/WikiForNow - ZWikiPage.py:1.6

Ken Manheimer klm@zope.com
Sun, 24 Nov 2002 00:41:39 -0500


Update of /cvs-repository/Products/WikiForNow
In directory cvs.zope.org:/tmp/cvs-serv20730

Modified Files:
	ZWikiPage.py 
Log Message:
Extend subscriptions form to enable managers (those with "View
management screens" permission) to unsubscribe others from the pages.

This should be a good way to deal with bounces from subscriptions for
obsolete addresses.  (We might should expose the subscribers email
address, too, but for now the manager will have to track it down...)


=== Products/WikiForNow/ZWikiPage.py 1.5 => 1.6 ===
--- Products/WikiForNow/ZWikiPage.py:1.5	Tue Jul 30 18:29:15 2002
+++ Products/WikiForNow/ZWikiPage.py	Sun Nov 24 00:41:39 2002
@@ -3022,9 +3022,11 @@
 </dtml-if>
 
 <dtml-let email="_.getattr(REQUEST.AUTHENTICATED_USER, 'email', '')"
-          username="REQUEST.AUTHENTICATED_USER.getUserName()"
+          user="REQUEST.AUTHENTICATED_USER"
+          username="user.getUserName()"
           issuper="_.string.lower(username) in ['super', 'superuser']"
           isanon="_.string.lower(username) in ['anonymous', 'anonymous user']"
+          ismanager="user.has_permission('View management screens', this())"
           nonmember="issuper or isanon">
 
 <dtml-if nonmember>
@@ -3082,6 +3084,7 @@
                VALUE="Unsubscribe from this page"
                style="font-weight:bold">
         <br>
+        &nbsp;&nbsp;
         <input type="checkbox" name="unsubscribe_offspring" value="1"
                <dtml-if expr="isSubscriber(sticky=1)">CHECKED</dtml-if>>
                ... and from all offspring
@@ -3102,8 +3105,17 @@
       &dtml-n; current-page
       subscriber<dtml-unless "n==1">s</dtml-unless><dtml-if n>:<br>
       <dtml-in subscriberList>
-      <dtml-var sequence-item><br>
+        <dtml-if ismanager>
+          <input type="checkbox"
+                 name="page_unsubscribers.<dtml-var sequence-item>:record">
+        </dtml-if>
+        <dtml-var sequence-item><br>
       </dtml-in>
+      <dtml-if ismanager>
+        <input type="submit" name="../unsubscribeSelected:method"
+             value=" Unsubscribe selected page subscribers "
+             style="font-weight:bold">
+      </dtml-if>
       </dtml-if>
     </dtml-let>
     <br><br>
@@ -3133,8 +3145,18 @@
       &dtml-n; whole-wiki
       subscriber<dtml-unless "n==1">s</dtml-unless><dtml-if n>:<br>
       <dtml-in wikiSubscriberList>
-      <dtml-var sequence-item><br>
+        <dtml-if ismanager>
+          <input type="checkbox"
+                 name="wiki_unsubscribers.<dtml-var sequence-item>:record">
+        </dtml-if>
+        <dtml-var ismanager>
+        <dtml-var sequence-item><br>
       </dtml-in>
+      <dtml-if ismanager>
+        <input type="submit" name="../wikiUnsubscribeSelected:method"
+             value=" Unsubscribe selected wiki subscribers "
+             style="font-weight:bold">
+      </dtml-if>
       </dtml-if>
     </dtml-let>
     </td>