Merge lp:~stylistica/systers/adminUI into lp:~systers-dev/systers/development
- adminUI
- Merge into development
Status: | Merged |
---|---|
Merged at revision: | 83 |
Proposed branch: | lp:~stylistica/systers/adminUI |
Merge into: | lp:~systers-dev/systers/development |
Diff against target: |
506 lines (+501/-0) 1 file modified
Mailman/Gui/General.py (+501/-0) |
To merge this branch: | bzr merge lp:~stylistica/systers/adminUI |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicki Hutchens (community) | Approve | ||
Anna SdG | Approve | ||
Robin J | Pending | ||
Review via email:
|
This proposal supersedes a proposal from 2012-07-04.
Commit message
Description of the change
Added admin UI for essays, essay questions and full name .
Made changes to one file from Mailman : ../Mailman/
Changed lines 383-401
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Robin J (robin-jeffries) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Anna SdG (anna-granudd) wrote : Posted in a previous version of this proposal | # |
I agree with Robin but maybe you could add a "." at the end of each sentence of the description text (to match the other fields on the page)? Sorry for being picky... Thanks.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sneha Priscilla (stylistica) wrote : Posted in a previous version of this proposal | # |
That's alright :) I had totally missed that !
On Fri, Jul 6, 2012 at 12:40 AM, Anna SdG <email address hidden> wrote:
> I agree with Robin but maybe you could add a "." at the end of each sentence of the description text (to match the other fields on the page)? Sorry for being picky... Thanks.
> --
> https:/
> You are the owner of lp:~stylistica/systers/adminUI.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Anna SdG (anna-granudd) wrote : | # |
Thanks for adding the dots. :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nicki Hutchens (nhutchen) wrote : | # |
Thanks for explaining the changes. It looks good.
Preview Diff
1 | === added directory 'Mailman/Gui' | |||
2 | === added file 'Mailman/Gui/General.py' | |||
3 | --- Mailman/Gui/General.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ Mailman/Gui/General.py 2012-07-13 15:35:28 +0000 | |||
5 | @@ -0,0 +1,501 @@ | |||
6 | 1 | # Copyright (C) 2001-2007 by the Free Software Foundation, Inc. | ||
7 | 2 | # | ||
8 | 3 | # This program is free software; you can redistribute it and/or | ||
9 | 4 | # modify it under the terms of the GNU General Public License | ||
10 | 5 | # as published by the Free Software Foundation; either version 2 | ||
11 | 6 | # of the License, or (at your option) any later version. | ||
12 | 7 | # | ||
13 | 8 | # This program is distributed in the hope that it will be useful, | ||
14 | 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | 11 | # GNU General Public License for more details. | ||
17 | 12 | # | ||
18 | 13 | # You should have received a copy of the GNU General Public License | ||
19 | 14 | # along with this program; if not, write to the Free Software | ||
20 | 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
21 | 16 | # USA. | ||
22 | 17 | |||
23 | 18 | """MailList mixin class managing the general options.""" | ||
24 | 19 | |||
25 | 20 | import re | ||
26 | 21 | |||
27 | 22 | from types import IntType | ||
28 | 23 | |||
29 | 24 | from Mailman import mm_cfg | ||
30 | 25 | from Mailman import Utils | ||
31 | 26 | from Mailman import Errors | ||
32 | 27 | #from Mailman import MailList #sneha | ||
33 | 28 | #from Mailman.DlistUserDesc import DlistUserDesc | ||
34 | 29 | from Mailman.i18n import _ | ||
35 | 30 | from Mailman.Gui.GUIBase import GUIBase | ||
36 | 31 | |||
37 | 32 | OPTIONS = ('hide', 'ack', 'notmetoo', 'nodupes') | ||
38 | 33 | |||
39 | 34 | |||
40 | 35 | |||
41 | 0 | 36 | ||
42 | 37 | class General(GUIBase): | ||
43 | 38 | def GetConfigCategory(self): | ||
44 | 39 | return 'general', _('General Options') | ||
45 | 40 | |||
46 | 41 | def GetConfigInfo(self, mlist, category, subcat): | ||
47 | 42 | if category <> 'general': | ||
48 | 43 | return None | ||
49 | 44 | WIDTH = mm_cfg.TEXTFIELDWIDTH | ||
50 | 45 | |||
51 | 46 | # These are for the default_options checkboxes below. | ||
52 | 47 | bitfields = {'hide' : mm_cfg.ConcealSubscription, | ||
53 | 48 | 'ack' : mm_cfg.AcknowledgePosts, | ||
54 | 49 | 'notmetoo' : mm_cfg.DontReceiveOwnPosts, | ||
55 | 50 | 'nodupes' : mm_cfg.DontReceiveDuplicates | ||
56 | 51 | } | ||
57 | 52 | bitdescrs = { | ||
58 | 53 | 'hide' : _("Conceal the member's address"), | ||
59 | 54 | 'ack' : _("Acknowledge the member's posting"), | ||
60 | 55 | 'notmetoo' : _("Do not send a copy of a member's own post"), | ||
61 | 56 | 'nodupes' : | ||
62 | 57 | _('Filter out duplicate messages to list members (if possible)'), | ||
63 | 58 | } | ||
64 | 59 | |||
65 | 60 | optvals = [mlist.new_member_options & bitfields[o] for o in OPTIONS] | ||
66 | 61 | opttext = [bitdescrs[o] for o in OPTIONS] | ||
67 | 62 | |||
68 | 63 | rtn = [ | ||
69 | 64 | _('''Fundamental list characteristics, including descriptive | ||
70 | 65 | info and basic behaviors.'''), | ||
71 | 66 | |||
72 | 67 | _('General list personality'), | ||
73 | 68 | |||
74 | 69 | ('real_name', mm_cfg.String, WIDTH, 0, | ||
75 | 70 | _('The public name of this list (make case-changes only).'), | ||
76 | 71 | _('''The capitalization of this name can be changed to make it | ||
77 | 72 | presentable in polite company as a proper noun, or to make an | ||
78 | 73 | acronym part all upper case, etc. However, the name will be | ||
79 | 74 | advertised as the email address (e.g., in subscribe confirmation | ||
80 | 75 | notices), so it should <em>not</em> be otherwise altered. (Email | ||
81 | 76 | addresses are not case sensitive, but they are sensitive to | ||
82 | 77 | almost everything else :-)''')), | ||
83 | 78 | |||
84 | 79 | ('owner', mm_cfg.EmailList, (3, WIDTH), 0, | ||
85 | 80 | _("""The list administrator email addresses. Multiple | ||
86 | 81 | administrator addresses, each on separate line is okay."""), | ||
87 | 82 | |||
88 | 83 | _('''There are two ownership roles associated with each mailing | ||
89 | 84 | list. The <em>list administrators</em> are the people who have | ||
90 | 85 | ultimate control over all parameters of this mailing list. They | ||
91 | 86 | are able to change any list configuration variable available | ||
92 | 87 | through these administration web pages. | ||
93 | 88 | |||
94 | 89 | <p>The <em>list moderators</em> have more limited permissions; | ||
95 | 90 | they are not able to change any list configuration variable, but | ||
96 | 91 | they are allowed to tend to pending administration requests, | ||
97 | 92 | including approving or rejecting held subscription requests, and | ||
98 | 93 | disposing of held postings. Of course, the <em>list | ||
99 | 94 | administrators</em> can also tend to pending requests. | ||
100 | 95 | |||
101 | 96 | <p>In order to split the list ownership duties into | ||
102 | 97 | administrators and moderators, you must | ||
103 | 98 | <a href="passwords">set a separate moderator password</a>, | ||
104 | 99 | and also provide the <a href="?VARHELP=general/moderator">email | ||
105 | 100 | addresses of the list moderators</a>. Note that the field you | ||
106 | 101 | are changing here specifies the list administrators.''')), | ||
107 | 102 | |||
108 | 103 | ('moderator', mm_cfg.EmailList, (3, WIDTH), 0, | ||
109 | 104 | _("""The list moderator email addresses. Multiple | ||
110 | 105 | moderator addresses, each on separate line is okay."""), | ||
111 | 106 | |||
112 | 107 | _('''There are two ownership roles associated with each mailing | ||
113 | 108 | list. The <em>list administrators</em> are the people who have | ||
114 | 109 | ultimate control over all parameters of this mailing list. They | ||
115 | 110 | are able to change any list configuration variable available | ||
116 | 111 | through these administration web pages. | ||
117 | 112 | |||
118 | 113 | <p>The <em>list moderators</em> have more limited permissions; | ||
119 | 114 | they are not able to change any list configuration variable, but | ||
120 | 115 | they are allowed to tend to pending administration requests, | ||
121 | 116 | including approving or rejecting held subscription requests, and | ||
122 | 117 | disposing of held postings. Of course, the <em>list | ||
123 | 118 | administrators</em> can also tend to pending requests. | ||
124 | 119 | |||
125 | 120 | <p>In order to split the list ownership duties into | ||
126 | 121 | administrators and moderators, you must | ||
127 | 122 | <a href="passwords">set a separate moderator password</a>, | ||
128 | 123 | and also provide the email addresses of the list moderators in | ||
129 | 124 | this section. Note that the field you are changing here | ||
130 | 125 | specifies the list moderators.''')), | ||
131 | 126 | |||
132 | 127 | ('description', mm_cfg.String, WIDTH, 0, | ||
133 | 128 | _('A terse phrase identifying this list.'), | ||
134 | 129 | |||
135 | 130 | _('''This description is used when the mailing list is listed with | ||
136 | 131 | other mailing lists, or in headers, and so forth. It should | ||
137 | 132 | be as succinct as you can get it, while still identifying what | ||
138 | 133 | the list is.''')), | ||
139 | 134 | |||
140 | 135 | ('info', mm_cfg.Text, (7, WIDTH), 0, | ||
141 | 136 | _('''An introductory description - a few paragraphs - about the | ||
142 | 137 | list. It will be included, as html, at the top of the listinfo | ||
143 | 138 | page. Carriage returns will end a paragraph - see the details | ||
144 | 139 | for more info.'''), | ||
145 | 140 | _("""The text will be treated as html <em>except</em> that | ||
146 | 141 | newlines will be translated to <br> - so you can use links, | ||
147 | 142 | preformatted text, etc, but don't put in carriage returns except | ||
148 | 143 | where you mean to separate paragraphs. And review your changes - | ||
149 | 144 | bad html (like some unterminated HTML constructs) can prevent | ||
150 | 145 | display of the entire listinfo page.""")), | ||
151 | 146 | |||
152 | 147 | ('subject_prefix', mm_cfg.String, WIDTH, 0, | ||
153 | 148 | _('Prefix for subject line of list postings.'), | ||
154 | 149 | _("""This text will be prepended to subject lines of messages | ||
155 | 150 | posted to the list, to distinguish mailing list messages in | ||
156 | 151 | mailbox summaries. Brevity is premium here, it's ok to shorten | ||
157 | 152 | long mailing list names to something more concise, as long as it | ||
158 | 153 | still identifies the mailing list. | ||
159 | 154 | You can also add a sequential number by %%d substitution | ||
160 | 155 | directive. eg.; [listname %%d] -> [listname 123] | ||
161 | 156 | (listname %%05d) -> (listname 00123) | ||
162 | 157 | """)), | ||
163 | 158 | |||
164 | 159 | ('anonymous_list', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
165 | 160 | _("""Hide the sender of a message, replacing it with the list | ||
166 | 161 | address (Removes From, Sender and Reply-To fields)""")), | ||
167 | 162 | |||
168 | 163 | _('''<tt>Reply-To:</tt> header munging'''), | ||
169 | 164 | |||
170 | 165 | ('first_strip_reply_to', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
171 | 166 | _('''Should any existing <tt>Reply-To:</tt> header found in the | ||
172 | 167 | original message be stripped? If so, this will be done | ||
173 | 168 | regardless of whether an explict <tt>Reply-To:</tt> header is | ||
174 | 169 | added by Mailman or not.''')), | ||
175 | 170 | |||
176 | 171 | ('reply_goes_to_list', mm_cfg.Radio, | ||
177 | 172 | (_('Poster'), _('This list'), _('Explicit address')), 0, | ||
178 | 173 | _('''Where are replies to list messages directed? | ||
179 | 174 | <tt>Poster</tt> is <em>strongly</em> recommended for most mailing | ||
180 | 175 | lists.'''), | ||
181 | 176 | |||
182 | 177 | # Details for reply_goes_to_list | ||
183 | 178 | _("""This option controls what Mailman does to the | ||
184 | 179 | <tt>Reply-To:</tt> header in messages flowing through this | ||
185 | 180 | mailing list. When set to <em>Poster</em>, no <tt>Reply-To:</tt> | ||
186 | 181 | header is added by Mailman, although if one is present in the | ||
187 | 182 | original message, it is not stripped. Setting this value to | ||
188 | 183 | either <em>This list</em> or <em>Explicit address</em> causes | ||
189 | 184 | Mailman to insert a specific <tt>Reply-To:</tt> header in all | ||
190 | 185 | messages, overriding the header in the original message if | ||
191 | 186 | necessary (<em>Explicit address</em> inserts the value of <a | ||
192 | 187 | href="?VARHELP=general/reply_to_address">reply_to_address</a>). | ||
193 | 188 | |||
194 | 189 | <p>There are many reasons not to introduce or override the | ||
195 | 190 | <tt>Reply-To:</tt> header. One is that some posters depend on | ||
196 | 191 | their own <tt>Reply-To:</tt> settings to convey their valid | ||
197 | 192 | return address. Another is that modifying <tt>Reply-To:</tt> | ||
198 | 193 | makes it much more difficult to send private replies. See <a | ||
199 | 194 | href="http://www.unicom.com/pw/reply-to-harmful.html">`Reply-To' | ||
200 | 195 | Munging Considered Harmful</a> for a general discussion of this | ||
201 | 196 | issue. See <a | ||
202 | 197 | href="http://www.metasystema.net/essays/reply-to.mhtml">Reply-To | ||
203 | 198 | Munging Considered Useful</a> for a dissenting opinion. | ||
204 | 199 | |||
205 | 200 | <p>Some mailing lists have restricted posting privileges, with a | ||
206 | 201 | parallel list devoted to discussions. Examples are `patches' or | ||
207 | 202 | `checkin' lists, where software changes are posted by a revision | ||
208 | 203 | control system, but discussion about the changes occurs on a | ||
209 | 204 | developers mailing list. To support these types of mailing | ||
210 | 205 | lists, select <tt>Explicit address</tt> and set the | ||
211 | 206 | <tt>Reply-To:</tt> address below to point to the parallel | ||
212 | 207 | list.""")), | ||
213 | 208 | |||
214 | 209 | ('reply_to_address', mm_cfg.Email, WIDTH, 0, | ||
215 | 210 | _('Explicit <tt>Reply-To:</tt> header.'), | ||
216 | 211 | # Details for reply_to_address | ||
217 | 212 | _("""This is the address set in the <tt>Reply-To:</tt> header | ||
218 | 213 | when the <a | ||
219 | 214 | href="?VARHELP=general/reply_goes_to_list">reply_goes_to_list</a> | ||
220 | 215 | option is set to <em>Explicit address</em>. | ||
221 | 216 | |||
222 | 217 | <p>There are many reasons not to introduce or override the | ||
223 | 218 | <tt>Reply-To:</tt> header. One is that some posters depend on | ||
224 | 219 | their own <tt>Reply-To:</tt> settings to convey their valid | ||
225 | 220 | return address. Another is that modifying <tt>Reply-To:</tt> | ||
226 | 221 | makes it much more difficult to send private replies. See <a | ||
227 | 222 | href="http://www.unicom.com/pw/reply-to-harmful.html">`Reply-To' | ||
228 | 223 | Munging Considered Harmful</a> for a general discussion of this | ||
229 | 224 | issue. See <a | ||
230 | 225 | href="http://www.metasystema.net/essays/reply-to.mhtml">Reply-To | ||
231 | 226 | Munging Considered Useful</a> for a dissenting opinion. | ||
232 | 227 | |||
233 | 228 | <p>Some mailing lists have restricted posting privileges, with a | ||
234 | 229 | parallel list devoted to discussions. Examples are `patches' or | ||
235 | 230 | `checkin' lists, where software changes are posted by a revision | ||
236 | 231 | control system, but discussion about the changes occurs on a | ||
237 | 232 | developers mailing list. To support these types of mailing | ||
238 | 233 | lists, specify the explicit <tt>Reply-To:</tt> address here. You | ||
239 | 234 | must also specify <tt>Explicit address</tt> in the | ||
240 | 235 | <tt>reply_goes_to_list</tt> | ||
241 | 236 | variable. | ||
242 | 237 | |||
243 | 238 | <p>Note that if the original message contains a | ||
244 | 239 | <tt>Reply-To:</tt> header, it will not be changed.""")), | ||
245 | 240 | |||
246 | 241 | _('Umbrella list settings'), | ||
247 | 242 | |||
248 | 243 | ('umbrella_list', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
249 | 244 | _('''Send password reminders to, eg, "-owner" address instead of | ||
250 | 245 | directly to user.'''), | ||
251 | 246 | |||
252 | 247 | _("""Set this to yes when this list is intended to cascade only | ||
253 | 248 | to other mailing lists. When set, meta notices like | ||
254 | 249 | confirmations and password reminders will be directed to an | ||
255 | 250 | address derived from the member\'s address - it will have the | ||
256 | 251 | value of "umbrella_member_suffix" appended to the member's | ||
257 | 252 | account name.""")), | ||
258 | 253 | |||
259 | 254 | ('umbrella_member_suffix', mm_cfg.String, WIDTH, 0, | ||
260 | 255 | _('''Suffix for use when this list is an umbrella for other | ||
261 | 256 | lists, according to setting of previous "umbrella_list" | ||
262 | 257 | setting.'''), | ||
263 | 258 | |||
264 | 259 | _("""When "umbrella_list" is set to indicate that this list has | ||
265 | 260 | other mailing lists as members, then administrative notices like | ||
266 | 261 | confirmations and password reminders need to not be sent to the | ||
267 | 262 | member list addresses, but rather to the owner of those member | ||
268 | 263 | lists. In that case, the value of this setting is appended to | ||
269 | 264 | the member's account name for such notices. `-owner' is the | ||
270 | 265 | typical choice. This setting has no effect when "umbrella_list" | ||
271 | 266 | is "No".""")), | ||
272 | 267 | |||
273 | 268 | _('Notifications'), | ||
274 | 269 | |||
275 | 270 | ('send_reminders', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
276 | 271 | _('''Send monthly password reminders?'''), | ||
277 | 272 | |||
278 | 273 | _('''Turn this on if you want password reminders to be sent once | ||
279 | 274 | per month to your members. Note that members may disable their | ||
280 | 275 | own individual password reminders.''')), | ||
281 | 276 | |||
282 | 277 | ('welcome_msg', mm_cfg.Text, (4, WIDTH), 1, | ||
283 | 278 | _('''List-specific text prepended to new-subscriber welcome | ||
284 | 279 | message'''), | ||
285 | 280 | |||
286 | 281 | _("""This value, if any, will be added to the front of the | ||
287 | 282 | new-subscriber welcome message. The rest of the welcome message | ||
288 | 283 | already describes the important addresses and URLs for the | ||
289 | 284 | mailing list, so you don't need to include any of that kind of | ||
290 | 285 | stuff here. This should just contain mission-specific kinds of | ||
291 | 286 | things, like etiquette policies or team orientation, or that kind | ||
292 | 287 | of thing. | ||
293 | 288 | |||
294 | 289 | <p>Note that this text will be wrapped, according to the | ||
295 | 290 | following rules: | ||
296 | 291 | <ul><li>Each paragraph is filled so that no line is longer than | ||
297 | 292 | 70 characters. | ||
298 | 293 | <li>Any line that begins with whitespace is not filled. | ||
299 | 294 | <li>A blank line separates paragraphs. | ||
300 | 295 | </ul>""")), | ||
301 | 296 | |||
302 | 297 | ('send_welcome_msg', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
303 | 298 | _('Send welcome message to newly subscribed members?'), | ||
304 | 299 | _("""Turn this off only if you plan on subscribing people manually | ||
305 | 300 | and don't want them to know that you did so. This option is most | ||
306 | 301 | useful for transparently migrating lists from some other mailing | ||
307 | 302 | list manager to Mailman.""")), | ||
308 | 303 | |||
309 | 304 | ('goodbye_msg', mm_cfg.Text, (4, WIDTH), 0, | ||
310 | 305 | _('''Text sent to people leaving the list. If empty, no special | ||
311 | 306 | text will be added to the unsubscribe message.''')), | ||
312 | 307 | |||
313 | 308 | ('send_goodbye_msg', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
314 | 309 | _('Send goodbye message to members when they are unsubscribed?')), | ||
315 | 310 | |||
316 | 311 | ('admin_immed_notify', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
317 | 312 | _('''Should the list moderators get immediate notice of new | ||
318 | 313 | requests, as well as daily notices about collected ones?'''), | ||
319 | 314 | |||
320 | 315 | _('''List moderators (and list administrators) are sent daily | ||
321 | 316 | reminders of requests pending approval, like subscriptions to a | ||
322 | 317 | moderated list, or postings that are being held for one reason or | ||
323 | 318 | another. Setting this option causes notices to be sent | ||
324 | 319 | immediately on the arrival of new requests as well.''')), | ||
325 | 320 | |||
326 | 321 | ('admin_notify_mchanges', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
327 | 322 | _('''Should administrator get notices of subscribes and | ||
328 | 323 | unsubscribes?''')), | ||
329 | 324 | |||
330 | 325 | ('respond_to_post_requests', mm_cfg.Radio, | ||
331 | 326 | (_('No'), _('Yes')), 0, | ||
332 | 327 | _('Send mail to poster when their posting is held for approval?') | ||
333 | 328 | ), | ||
334 | 329 | |||
335 | 330 | _('Additional settings'), | ||
336 | 331 | |||
337 | 332 | ('emergency', mm_cfg.Toggle, (_('No'), _('Yes')), 1, | ||
338 | 333 | _('Emergency moderation of all list traffic.'), | ||
339 | 334 | _("""When this option is enabled, all list traffic is emergency | ||
340 | 335 | moderated, i.e. held for moderation. Turn this option on when | ||
341 | 336 | your list is experiencing a flamewar and you want a cooling off | ||
342 | 337 | period.""")), | ||
343 | 338 | |||
344 | 339 | ('new_member_options', mm_cfg.Checkbox, | ||
345 | 340 | (opttext, optvals, 0, OPTIONS), | ||
346 | 341 | # The description for new_member_options includes a kludge where | ||
347 | 342 | # we add a hidden field so that even when all the checkboxes are | ||
348 | 343 | # deselected, the form data will still have a new_member_options | ||
349 | 344 | # key (it will always be a list). Otherwise, we'd never be able | ||
350 | 345 | # to tell if all were deselected! | ||
351 | 346 | 0, _('''Default options for new members joining this list.<input | ||
352 | 347 | type="hidden" name="new_member_options" value="ignore">'''), | ||
353 | 348 | |||
354 | 349 | _("""When a new member is subscribed to this list, their initial | ||
355 | 350 | set of options is taken from the this variable's setting.""")), | ||
356 | 351 | |||
357 | 352 | ('administrivia', mm_cfg.Radio, (_('No'), _('Yes')), 1, | ||
358 | 353 | _('''(Administrivia filter) Check postings and intercept ones | ||
359 | 354 | that seem to be administrative requests?'''), | ||
360 | 355 | |||
361 | 356 | _("""Administrivia tests will check postings to see whether it's | ||
362 | 357 | really meant as an administrative request (like subscribe, | ||
363 | 358 | unsubscribe, etc), and will add it to the the administrative | ||
364 | 359 | requests queue, notifying the administrator of the new request, | ||
365 | 360 | in the process.""")), | ||
366 | 361 | |||
367 | 362 | ('max_message_size', mm_cfg.Number, 7, 0, | ||
368 | 363 | _('''Maximum length in kilobytes (KB) of a message body. Use 0 | ||
369 | 364 | for no limit.''')), | ||
370 | 365 | |||
371 | 366 | ('admin_member_chunksize', mm_cfg.Number, 7, 0, | ||
372 | 367 | _('''Maximum number of members to show on one page of the | ||
373 | 368 | Membership List.''')), | ||
374 | 369 | |||
375 | 370 | ('host_name', mm_cfg.Host, WIDTH, 0, | ||
376 | 371 | _('Host name this list prefers for email.'), | ||
377 | 372 | |||
378 | 373 | _("""The "host_name" is the preferred name for email to | ||
379 | 374 | mailman-related addresses on this host, and generally should be | ||
380 | 375 | the mail host's exchanger address, if any. This setting can be | ||
381 | 376 | useful for selecting among alternative names of a host that has | ||
382 | 377 | multiple addresses.""")), | ||
383 | 378 | |||
384 | 379 | ('essay_enabled', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
385 | 380 | _('Should an essay be provided during subscription?'), | ||
386 | 381 | _("""Turn this on if you want to require subscribers to answer | ||
387 | 382 | some questions about their eligibility for the list when they | ||
388 | 383 | request membership. """)), | ||
389 | 384 | |||
390 | 385 | ('questions', mm_cfg.Text, (4, WIDTH), 0, | ||
391 | 386 | _('''Text for subscription essay.'''), | ||
392 | 387 | _("""The essay instructions may include the lightweight markup | ||
393 | 388 | language <a href="http://en.wikipedia.org/wiki/Markdown" Title= | ||
394 | 389 | "Link to examples of markdown syntax">Markdown</a>.Changing this | ||
395 | 390 | section will have no effect until you have set the value of | ||
396 | 391 | essay_enabled to True in the previous section. """)), | ||
397 | 392 | |||
398 | 393 | |||
399 | 394 | ('fullname_required', mm_cfg.Radio, (_('No'), _('Yes')), 0, | ||
400 | 395 | _('''Should a name be provided during subscription?'''), | ||
401 | 396 | _("""Turn this on if you want to require subscribers to include | ||
402 | 397 | their name as well as email when they request membership.""")), | ||
403 | 398 | |||
404 | 399 | |||
405 | 400 | ] | ||
406 | 401 | |||
407 | 402 | if mm_cfg.ALLOW_RFC2369_OVERRIDES: | ||
408 | 403 | rtn.append( | ||
409 | 404 | ('include_rfc2369_headers', mm_cfg.Radio, | ||
410 | 405 | (_('No'), _('Yes')), 0, | ||
411 | 406 | _("""Should messages from this mailing list include the | ||
412 | 407 | <a href="http://www.faqs.org/rfcs/rfc2369.html">RFC 2369</a> | ||
413 | 408 | (i.e. <tt>List-*</tt>) headers? <em>Yes</em> is highly | ||
414 | 409 | recommended."""), | ||
415 | 410 | |||
416 | 411 | _("""RFC 2369 defines a set of List-* headers that are | ||
417 | 412 | normally added to every message sent to the list membership. | ||
418 | 413 | These greatly aid end-users who are using standards compliant | ||
419 | 414 | mail readers. They should normally always be enabled. | ||
420 | 415 | |||
421 | 416 | <p>However, not all mail readers are standards compliant yet, | ||
422 | 417 | and if you have a large number of members who are using | ||
423 | 418 | non-compliant mail readers, they may be annoyed at these | ||
424 | 419 | headers. You should first try to educate your members as to | ||
425 | 420 | why these headers exist, and how to hide them in their mail | ||
426 | 421 | clients. As a last resort you can disable these headers, but | ||
427 | 422 | this is not recommended (and in fact, your ability to disable | ||
428 | 423 | these headers may eventually go away).""")) | ||
429 | 424 | ) | ||
430 | 425 | # Suppression of List-Post: headers | ||
431 | 426 | rtn.append( | ||
432 | 427 | ('include_list_post_header', mm_cfg.Radio, | ||
433 | 428 | (_('No'), _('Yes')), 0, | ||
434 | 429 | _('Should postings include the <tt>List-Post:</tt> header?'), | ||
435 | 430 | _("""The <tt>List-Post:</tt> header is one of the headers | ||
436 | 431 | recommended by | ||
437 | 432 | <a href="http://www.faqs.org/rfcs/rfc2369.html">RFC 2369</a>. | ||
438 | 433 | However for some <em>announce-only</em> mailing lists, only a | ||
439 | 434 | very select group of people are allowed to post to the list; the | ||
440 | 435 | general membership is usually not allowed to post. For lists of | ||
441 | 436 | this nature, the <tt>List-Post:</tt> header is misleading. | ||
442 | 437 | Select <em>No</em> to disable the inclusion of this header. (This | ||
443 | 438 | does not affect the inclusion of the other <tt>List-*:</tt> | ||
444 | 439 | headers.)""")) | ||
445 | 440 | ) | ||
446 | 441 | |||
447 | 442 | # Discard held messages after this number of days | ||
448 | 443 | rtn.append( | ||
449 | 444 | ('max_days_to_hold', mm_cfg.Number, 7, 0, | ||
450 | 445 | _("""Discard held messages older than this number of days. | ||
451 | 446 | Use 0 for no automatic discarding.""")) | ||
452 | 447 | ) | ||
453 | 448 | |||
454 | 449 | return rtn | ||
455 | 450 | |||
456 | 451 | def _setValue(self, mlist, property, val, doc): | ||
457 | 452 | if property == 'real_name' and \ | ||
458 | 453 | val.lower() <> mlist.internal_name().lower(): | ||
459 | 454 | # These values can't differ by other than case | ||
460 | 455 | doc.addError(_("""<b>real_name</b> attribute not | ||
461 | 456 | changed! It must differ from the list's name by case | ||
462 | 457 | only.""")) | ||
463 | 458 | elif property == 'new_member_options': | ||
464 | 459 | newopts = 0 | ||
465 | 460 | for opt in OPTIONS: | ||
466 | 461 | bitfield = mm_cfg.OPTINFO[opt] | ||
467 | 462 | if opt in val: | ||
468 | 463 | newopts |= bitfield | ||
469 | 464 | mlist.new_member_options = newopts | ||
470 | 465 | elif property == 'subject_prefix': | ||
471 | 466 | # Convert any html entities to Unicode | ||
472 | 467 | mlist.subject_prefix = Utils.canonstr( | ||
473 | 468 | val, mlist.preferred_language) | ||
474 | 469 | elif property == 'info': | ||
475 | 470 | if val <> mlist.info: | ||
476 | 471 | if Utils.suspiciousHTML(val): | ||
477 | 472 | doc.addError(_("""The <b>info</b> attribute you saved | ||
478 | 473 | contains suspicious HTML that could potentially expose your users to cross-site | ||
479 | 474 | scripting attacks. This change has therefore been rejected. If you still want | ||
480 | 475 | to make these changes, you must have shell access to your Mailman server. | ||
481 | 476 | This change can be made with bin/withlist or with bin/config_list by setting | ||
482 | 477 | mlist.info. | ||
483 | 478 | """)) | ||
484 | 479 | else: | ||
485 | 480 | mlist.info = val | ||
486 | 481 | elif property == 'admin_member_chunksize' and (val < 1 | ||
487 | 482 | or not isinstance(val, IntType)): | ||
488 | 483 | doc.addError(_("""<b>admin_member_chunksize</b> attribute not | ||
489 | 484 | changed! It must be an integer > 0.""")) | ||
490 | 485 | else: | ||
491 | 486 | GUIBase._setValue(self, mlist, property, val, doc) | ||
492 | 487 | |||
493 | 488 | |||
494 | 489 | def _postValidate(self, mlist, doc): | ||
495 | 490 | if not mlist.reply_to_address.strip() and \ | ||
496 | 491 | mlist.reply_goes_to_list == 2: | ||
497 | 492 | # You can't go to an explicit address that is blank | ||
498 | 493 | doc.addError(_("""You cannot add a Reply-To: to an explicit | ||
499 | 494 | address if that address is blank. Resetting these values.""")) | ||
500 | 495 | mlist.reply_to_address = '' | ||
501 | 496 | mlist.reply_goes_to_list = 0 | ||
502 | 497 | |||
503 | 498 | def getValue(self, mlist, kind, varname, params): | ||
504 | 499 | if varname <> 'subject_prefix': | ||
505 | 500 | return None | ||
506 | 501 | # The subject_prefix may be Unicode | ||
507 | 502 | return Utils.uncanonstr(mlist.subject_prefix, mlist.preferred_language) |
Looks good