aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/sympa/manifests/list.pp8
-rw-r--r--modules/sympa/manifests/scenario/sender_email.pp5
-rw-r--r--modules/sympa/manifests/scenario/sender_ldap_group.pp2
-rw-r--r--modules/sympa/templates/config10
-rw-r--r--modules/sympa/templates/scenari/sender.email4
-rw-r--r--modules/sympa/templates/scenari/sender.ldap_group4
6 files changed, 13 insertions, 20 deletions
diff --git a/modules/sympa/manifests/list.pp b/modules/sympa/manifests/list.pp
index 4e265f31..7b613297 100644
--- a/modules/sympa/manifests/list.pp
+++ b/modules/sympa/manifests/list.pp
@@ -41,14 +41,14 @@ define sympa::list( $subject,
}
if $sender_ldap_group {
- if ! defined(Sympa::Scenario::Sender_ldap_group[$sender_ldap_group]) {
- sympa::scenario::sender_ldap_group { $sender_ldap_group: }
+ sympa::scenario::sender_ldap_group { $name:
+ ldap_group => $sender_ldap_group,
}
}
if $sender_email {
- if ! defined(Sympa::Scenario::Sender_email[$sender_email]) {
- sympa::scenario::sender_email { $sender_email: }
+ sympa::scenario::sender_email { $name:
+ email => $sender_email,
}
}
diff --git a/modules/sympa/manifests/scenario/sender_email.pp b/modules/sympa/manifests/scenario/sender_email.pp
index 4f811189..7f4bc688 100644
--- a/modules/sympa/manifests/scenario/sender_email.pp
+++ b/modules/sympa/manifests/scenario/sender_email.pp
@@ -1,6 +1,5 @@
-define sympa::scenario::sender_email {
- $sender_email_file = regsubst($name,'\@','-at-')
- file { "/etc/sympa/scenari/send.restricted_$sender_email_file":
+define sympa::scenario::sender_email($email) {
+ file { "/etc/sympa/scenari/send.restricted_$name":
content => template('sympa/scenari/sender.email')
}
}
diff --git a/modules/sympa/manifests/scenario/sender_ldap_group.pp b/modules/sympa/manifests/scenario/sender_ldap_group.pp
index 363af4f3..70915080 100644
--- a/modules/sympa/manifests/scenario/sender_ldap_group.pp
+++ b/modules/sympa/manifests/scenario/sender_ldap_group.pp
@@ -1,4 +1,4 @@
-define sympa::scenario::sender_ldap_group {
+define sympa::scenario::sender_ldap_group($ldap_group) {
file { "/etc/sympa/scenari/send.restricted_$name":
content => template('sympa/scenari/sender.ldap_group')
}
diff --git a/modules/sympa/templates/config b/modules/sympa/templates/config
index 36510531..47a91f14 100644
--- a/modules/sympa/templates/config
+++ b/modules/sympa/templates/config
@@ -52,16 +52,10 @@ apply forced
-<% if sender_email %>
-#TODO write scenari
-send restricted_<%= sender_email_file %>
-
-<% elsif sender_ldap_group %>
-#TODO write scenari
-send restricted_<%= sender_ldap_group %>
+<% if sender_email || sender_ldap_group %>
+send restricted_<%= @name %>
<% else %>
-#TODO write scenari
send subscriber_moderated
<% end %>
diff --git a/modules/sympa/templates/scenari/sender.email b/modules/sympa/templates/scenari/sender.email
index ee293dfd..ee53dc38 100644
--- a/modules/sympa/templates/scenari/sender.email
+++ b/modules/sympa/templates/scenari/sender.email
@@ -1,5 +1,5 @@
-title.gettext restricted to email <%= name %>
+title.gettext restricted to email <%= @email %>
-equal([sender], '<%= name %>') smtp,md5,smime -> do_it
+equal([sender], '<%= @email %>') smtp,md5,smime -> do_it
true() smtp,md5,smime -> reject(reason='send_subscriber')
diff --git a/modules/sympa/templates/scenari/sender.ldap_group b/modules/sympa/templates/scenari/sender.ldap_group
index d1abe66d..ac8b3fd9 100644
--- a/modules/sympa/templates/scenari/sender.ldap_group
+++ b/modules/sympa/templates/scenari/sender.ldap_group
@@ -1,5 +1,5 @@
-title.gettext restricted to group <%= name %>
+title.gettext restricted to group <%= @ldap_group %>
-search(<%= name %>.ldap) smtp,md5,smime -> do_it
+search(<%= @ldap_group %>.ldap) smtp,md5,smime -> do_it
true() smtp,md5,smime -> reject(reason='send_subscriber')