1 |
diff -up smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists.delete smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists |
2 |
--- smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists.delete 2013-12-10 23:29:27.000000000 -0500 |
3 |
+++ smeserver-ezmlm-web-1.1.2/root/etc/e-smith/web/functions/mailinglists 2013-12-10 23:30:15.000000000 -0500 |
4 |
@@ -1,4 +1,4 @@ |
5 |
-#!/usr/bin/perl -w |
6 |
+#!/usr/bin/perl -wT |
7 |
|
8 |
#---------------------------------------------------------------------- |
9 |
# heading : Collaboration |
10 |
@@ -395,13 +395,31 @@ sub performDeleteList ($) |
11 |
# Attempt to delete list |
12 |
#------------------------------------------------------------ |
13 |
my $listName = $q->param ('list'); |
14 |
+ if ($listName =~ /^([a-z][a-z\-0-9]*)$/) |
15 |
+ { |
16 |
+ $listName = $1; |
17 |
+ } |
18 |
+ else |
19 |
+ { |
20 |
+ showInitial ($q, |
21 |
+ "Error: unexpected characters in list name: " . |
22 |
+ "\"$listName\". The list name should contain only " . |
23 |
+ "lower-case letters, numbers and hypens, and " . |
24 |
+ "must start " . |
25 |
+ "with a lower-case letter. For example \"betty\", " . |
26 |
+ "\"hjohnson\", and \"abc-12\" are all valid list " . |
27 |
+ "names, but \"3friends\", \"John Smith\" and " . |
28 |
+ "\"Henry-Miller\" are not."); |
29 |
+ return; |
30 |
+ } |
31 |
+ |
32 |
my $list = $accounts->get($listName); |
33 |
if ($list) |
34 |
{ |
35 |
system ('/sbin/e-smith/signal-event', 'mailinglist-delete', $listName) == 0 |
36 |
or die ("Error occurred while deleting list.\n"); |
37 |
$list->delete; |
38 |
- showInitial ($q, "Successfully deleted mailing list $list."); |
39 |
+ showInitial ($q, "Successfully deleted mailing list $listName."); |
40 |
} |
41 |
} |
42 |
|