[debian-edu-commits] debian-edu/upstream/ 02/03: class_mailAccount: On multi-edit actions, interprete an empty mail pattern as no action to take on mail address fields.
Mike Gabriel
sunweaver at debian.org
Wed Aug 26 22:54:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository gosa-plugin-mailaddress.
commit c969f70b8fc940d9bd5949556092cc65c70d1857
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Thu Aug 27 00:48:00 2015 +0200
class_mailAccount: On multi-edit actions, interprete an empty mail pattern as no action to take on mail address fields.
---
locale/de/LC_MESSAGES/messages.po | 31 ++++++++++++++---------------
locale/en/LC_MESSAGES/messages.po | 28 ++++++++++++--------------
locale/messages.po | 20 +++++++++----------
personal/mailaddress/class_mailAccount.inc | 32 +++++++++++++++---------------
personal/mailaddress/generic.tpl | 2 +-
5 files changed, 54 insertions(+), 59 deletions(-)
diff --git a/locale/de/LC_MESSAGES/messages.po b/locale/de/LC_MESSAGES/messages.po
index 672ca98..83ebf4a 100644
--- a/locale/de/LC_MESSAGES/messages.po
+++ b/locale/de/LC_MESSAGES/messages.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: messages\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-08-27 00:01+0200\n"
+"POT-Creation-Date: 2015-08-27 00:50+0200\n"
"PO-Revision-Date: 2015-08-26 21:59+0100\n"
"Last-Translator: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>\n"
"Language-Team: deutsch <de at li.org>\n"
@@ -25,7 +25,7 @@ msgstr ""
#: personal/mailaddress/class_mailAccount.inc:120
#: personal/mailaddress/class_mailAccount.inc:122
#: personal/mailaddress/class_mailAccount.inc:375
-#: personal/mailaddress/class_mailAccount.inc:420
+#: personal/mailaddress/class_mailAccount.inc:426
msgid "Mail"
msgstr "Mail"
@@ -58,7 +58,7 @@ msgstr "Bitte einen Eintrag auswählen"
#: personal/mailaddress/class_mailAccount.inc:291
#: personal/mailaddress/class_mailAccount.inc:295
#: personal/mailaddress/class_mailAccount.inc:313
-#: personal/mailaddress/class_mailAccount.inc:434
+#: personal/mailaddress/class_mailAccount.inc:440
#: personal/mailaddress/generic.tpl:7 personal/mailaddress/generic.tpl:9
msgid "Mail address"
msgstr "Mail-Adresse"
@@ -102,8 +102,7 @@ msgstr "Weiterleitungsadressen"
#: admin/groups/mailaddress/class_groupMail.inc:533
#: admin/groups/mailaddress/mailaddress.tpl:27
-#: personal/mailaddress/class_mailAccount.inc:382
-#: personal/mailaddress/class_mailAccount.inc:385
+#: personal/mailaddress/class_mailAccount.inc:383
#: personal/mailaddress/generic.tpl:26
msgid "Mail address pattern"
msgstr "Mail-Adressschema"
@@ -138,8 +137,8 @@ msgid ""
"Please specify a mail address pattern (e.g., {%cn|@your-domain."
"com) or leave empty."
msgstr ""
-"Bitte ein Mail-Adressschema eingeben (z.Bsp. {%cn}@your-domain."
-"com) oder das Feld frei lassen."
+"Bitte ein Mail-Adressschema eingeben (z.Bsp. {%cn}@your-domain.com) oder das "
+"Feld freilassen."
#: admin/groups/mailaddress/mailaddress.tpl:42
#: admin/groups/mailaddress/paste_mailaddress.tpl:26
@@ -193,25 +192,23 @@ msgid "Manage user mail address"
msgstr "Mail-Adressen von Benutzern verwalten"
#: personal/mailaddress/class_mailAccount.inc:283
-#: personal/mailaddress/class_mailAccount.inc:382
msgid "Examples"
msgstr "Beispiele"
#: personal/mailaddress/class_mailAccount.inc:283
-#: personal/mailaddress/class_mailAccount.inc:382
msgid "or"
msgstr "oder"
-#: personal/mailaddress/class_mailAccount.inc:385
+#: personal/mailaddress/class_mailAccount.inc:383
msgid "Please make use of placeholders for the user part of the mail address."
msgstr "Bitte Platzhalter für den Benutzerteil der Mail-Adresse verwenden."
-#: personal/mailaddress/class_mailAccount.inc:421
+#: personal/mailaddress/class_mailAccount.inc:427
#: personal/mailaddress/generic.tpl:6
msgid "User Mail Address"
msgstr "Mail-Adresse des Benutzers"
-#: personal/mailaddress/class_mailAccount.inc:425
+#: personal/mailaddress/class_mailAccount.inc:431
msgid "My account"
msgstr "Mein Konto"
@@ -231,8 +228,10 @@ msgstr "Mail-Adresse"
msgid ""
"Please specify a mail address pattern (e.g., {%uid|@your-domain."
"com). Valid placeholders are: {%uid|, {%givenName| and "
-"{%sn|."
+"{%sn|. For no action on the users' mail addresses, please leave "
+"empty."
msgstr ""
-"Bitte ein Mail-Adressschema eingeben (z.Bsp. {%uid}@your-"
-"domain.com). Gültige Platzhalter sind: {%uid}, "
-"{%givenName} und {%sn}."
+"Bitte ein Mail-Adressschema eingeben (z.Bsp. {%uid}@your-domain.com). "
+"Gültige Platzhalter sind: {%uid}, {%givenName} und {%sn}. Wenn die "
+"Mail-Adressen der Benutzer unverändert bleiben sollen, dieses Feld bitte "
+"freilassen."
diff --git a/locale/en/LC_MESSAGES/messages.po b/locale/en/LC_MESSAGES/messages.po
index 3c0a117..80cf428 100644
--- a/locale/en/LC_MESSAGES/messages.po
+++ b/locale/en/LC_MESSAGES/messages.po
@@ -4,7 +4,7 @@
#: personal/mailaddress/class_mailAccount.inc:120
#: personal/mailaddress/class_mailAccount.inc:122
#: personal/mailaddress/class_mailAccount.inc:375
-#: personal/mailaddress/class_mailAccount.inc:420
+#: personal/mailaddress/class_mailAccount.inc:426
msgid "Mail"
msgstr "Mail"
@@ -37,7 +37,7 @@ msgstr "Please select an entry!"
#: personal/mailaddress/class_mailAccount.inc:291
#: personal/mailaddress/class_mailAccount.inc:295
#: personal/mailaddress/class_mailAccount.inc:313
-#: personal/mailaddress/class_mailAccount.inc:434
+#: personal/mailaddress/class_mailAccount.inc:440
#: personal/mailaddress/generic.tpl:7 personal/mailaddress/generic.tpl:9
msgid "Mail address"
msgstr "Mail address"
@@ -79,8 +79,7 @@ msgstr "Forwarding addresses"
#: admin/groups/mailaddress/class_groupMail.inc:533
#: admin/groups/mailaddress/mailaddress.tpl:27
-#: personal/mailaddress/class_mailAccount.inc:382
-#: personal/mailaddress/class_mailAccount.inc:385
+#: personal/mailaddress/class_mailAccount.inc:383
#: personal/mailaddress/generic.tpl:26
msgid "Mail address pattern"
msgstr "Mail address pattern"
@@ -116,8 +115,8 @@ msgid ""
"Please specify a mail address pattern (e.g., {%cn|@your-domain."
"com) or leave empty."
msgstr ""
-"Please specify a mail address pattern (e.g., {%cn}@your-domain."
-"com) or leave empty."
+"Please specify a mail address pattern (e.g., {%cn}@your-domain.com) or leave "
+"empty."
#: admin/groups/mailaddress/mailaddress.tpl:42
#: admin/groups/mailaddress/paste_mailaddress.tpl:26
@@ -171,25 +170,23 @@ msgid "Manage user mail address"
msgstr "Manage user mail address"
#: personal/mailaddress/class_mailAccount.inc:283
-#: personal/mailaddress/class_mailAccount.inc:382
msgid "Examples"
msgstr "Examples"
#: personal/mailaddress/class_mailAccount.inc:283
-#: personal/mailaddress/class_mailAccount.inc:382
msgid "or"
msgstr "or"
-#: personal/mailaddress/class_mailAccount.inc:385
+#: personal/mailaddress/class_mailAccount.inc:383
msgid "Please make use of placeholders for the user part of the mail address."
msgstr "Please make use of placeholders for the user part of the mail address."
-#: personal/mailaddress/class_mailAccount.inc:421
+#: personal/mailaddress/class_mailAccount.inc:427
#: personal/mailaddress/generic.tpl:6
msgid "User Mail Address"
msgstr "User Mail Address"
-#: personal/mailaddress/class_mailAccount.inc:425
+#: personal/mailaddress/class_mailAccount.inc:431
msgid "My account"
msgstr "My account"
@@ -209,8 +206,9 @@ msgstr "Mail addresses"
msgid ""
"Please specify a mail address pattern (e.g., {%uid|@your-domain."
"com). Valid placeholders are: {%uid|, {%givenName| and "
-"{%sn|."
+"{%sn|. For no action on the users' mail addresses, please leave "
+"empty."
msgstr ""
-"Please specify a mail address pattern (e.g., {%uid}@your-"
-"domain.com). Valid placeholders are: {%uid}, "
-"{%givenName} and {%sn}."
+"Please specify a mail address pattern (e.g., {%uid}@your-domain.com). Valid "
+"placeholders are: {%uid}, {%givenName} and {%sn}. For no action on the "
+"users' mail addresses, please leave empty."
diff --git a/locale/messages.po b/locale/messages.po
index 875b0db..a18ac18 100644
--- a/locale/messages.po
+++ b/locale/messages.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-08-27 00:01+0200\n"
+"POT-Creation-Date: 2015-08-27 00:50+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -23,7 +23,7 @@ msgstr ""
#: personal/mailaddress/class_mailAccount.inc:120
#: personal/mailaddress/class_mailAccount.inc:122
#: personal/mailaddress/class_mailAccount.inc:375
-#: personal/mailaddress/class_mailAccount.inc:420
+#: personal/mailaddress/class_mailAccount.inc:426
msgid "Mail"
msgstr ""
@@ -56,7 +56,7 @@ msgstr ""
#: personal/mailaddress/class_mailAccount.inc:291
#: personal/mailaddress/class_mailAccount.inc:295
#: personal/mailaddress/class_mailAccount.inc:313
-#: personal/mailaddress/class_mailAccount.inc:434
+#: personal/mailaddress/class_mailAccount.inc:440
#: personal/mailaddress/generic.tpl:7 personal/mailaddress/generic.tpl:9
msgid "Mail address"
msgstr ""
@@ -98,8 +98,7 @@ msgstr ""
#: admin/groups/mailaddress/class_groupMail.inc:533
#: admin/groups/mailaddress/mailaddress.tpl:27
-#: personal/mailaddress/class_mailAccount.inc:382
-#: personal/mailaddress/class_mailAccount.inc:385
+#: personal/mailaddress/class_mailAccount.inc:383
#: personal/mailaddress/generic.tpl:26
msgid "Mail address pattern"
msgstr ""
@@ -186,25 +185,23 @@ msgid "Manage user mail address"
msgstr ""
#: personal/mailaddress/class_mailAccount.inc:283
-#: personal/mailaddress/class_mailAccount.inc:382
msgid "Examples"
msgstr ""
#: personal/mailaddress/class_mailAccount.inc:283
-#: personal/mailaddress/class_mailAccount.inc:382
msgid "or"
msgstr ""
-#: personal/mailaddress/class_mailAccount.inc:385
+#: personal/mailaddress/class_mailAccount.inc:383
msgid "Please make use of placeholders for the user part of the mail address."
msgstr ""
-#: personal/mailaddress/class_mailAccount.inc:421
+#: personal/mailaddress/class_mailAccount.inc:427
#: personal/mailaddress/generic.tpl:6
msgid "User Mail Address"
msgstr ""
-#: personal/mailaddress/class_mailAccount.inc:425
+#: personal/mailaddress/class_mailAccount.inc:431
msgid "My account"
msgstr ""
@@ -224,5 +221,6 @@ msgstr ""
msgid ""
"Please specify a mail address pattern (e.g., {%uid|@your-domain."
"com). Valid placeholders are: {%uid|, {%givenName| and "
-"{%sn|."
+"{%sn|. For no action on the users' mail addresses, please leave "
+"empty."
msgstr ""
diff --git a/personal/mailaddress/class_mailAccount.inc b/personal/mailaddress/class_mailAccount.inc
index c7c80d9..ac73dd1 100644
--- a/personal/mailaddress/class_mailAccount.inc
+++ b/personal/mailaddress/class_mailAccount.inc
@@ -378,13 +378,11 @@ class mailAccount extends plugin
/* Mail address checks */
$mail_pattern = $this->mail;
- if (empty($mail_pattern)){
- $message[]= msgPool::required(_("Mail address pattern"))."<br><br><b>"._("Examples").":</b> <i>{%givenName}.{%sn}@your-domain.com</i> "._("or")." <i>{%uid}@your-domain.com</i>";
- }
- if ((!tests::is_email($mail_pattern, TRUE)) || (!preg_match('/^.*({%uid}|{%givenName}|{%sn}|{%cn}).*@.*$/i', $mail_pattern))){
- $message[]= msgPool::invalid(_("Mail address pattern"),"","","{%givenName}.{%sn}@your-domain.com")."<br><br><br>"._("Please make use of placeholders for the user part of the mail address.");
+ if (!empty($mail_pattern)){
+ if ((!tests::is_email($mail_pattern, TRUE)) || (!preg_match('/^.*({%uid}|{%givenName}|{%sn}|{%cn}).*@.*$/i', $mail_pattern))){
+ $message[]= msgPool::invalid(_("Mail address pattern"),"","","{%givenName}.{%sn}@your-domain.com")."<br><br><br>"._("Please make use of placeholders for the user part of the mail address.");
+ }
}
-
return($message);
}
@@ -400,18 +398,20 @@ class mailAccount extends plugin
/* Replace placeholders in mail address patterns */
$mail_pattern = $attrs['mail'];
- foreach (array("sn", "givenName", "uid") as $repl){
- $value= $this->$repl;
- if (preg_match("/{%$repl}/", $mail_pattern)){
- $attrs['mail']= str_replace("{%$repl}", $value, $mail_pattern);
- $mail_pattern=$attrs['mail'];
+ if($mail_pattern){
+ foreach (array("sn", "givenName", "uid") as $repl){
+ $value= $this->$repl;
+ if (preg_match("/{%$repl}/", $mail_pattern)){
+ $attrs['mail']= str_replace("{%$repl}", $value, $mail_pattern);
+ $mail_pattern=$attrs['mail'];
+ }
}
- }
- /* Add mail account data, if object is not in account state, yet
- */
- if(!$this->is_account && $this->acl_is_createable()){
- $this->is_account= TRUE;
+ /* Add mail account data, if object is not in account state, yet
+ */
+ if(!$this->is_account && $this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
}
plugin::set_multi_edit_values($attrs);
diff --git a/personal/mailaddress/generic.tpl b/personal/mailaddress/generic.tpl
index be1a1fd..a6d1611 100644
--- a/personal/mailaddress/generic.tpl
+++ b/personal/mailaddress/generic.tpl
@@ -18,7 +18,7 @@
<h3>{t}User Mail Addresses{/t}</h3>
<table summary="{t}Mail addresses{/t}">
<tr>
- <td colspan="2"><i>{t}Please specify a mail address pattern (e.g., {%uid|@your-domain.com). Valid placeholders are: {%uid|, {%givenName| and {%sn|.{/t}</i>
+ <td colspan="2"><i>{t}Please specify a mail address pattern (e.g., {%uid|@your-domain.com). Valid placeholders are: {%uid|, {%givenName| and {%sn|. For no action on the users' mail addresses, please leave empty.{/t}</i>
</td>
</tr>
<tr><td> </td></tr>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/upstream/gosa-plugin-mailaddress.git
More information about the debian-edu-commits
mailing list