Code

Fix error message for invalid LDAP URIs
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Oct 2009 08:36:41 +0000 (08:36 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Oct 2009 08:36:41 +0000 (08:36 +0000)
- Properly check for missing server specification in the
  given LDAP URI
- Give a message indicating that the format of the URI is
  defect, not incorrectly stating that it contains wrong
  characters.
- Add localisation for new error string

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14533 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc
trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po
trunk/gosa-plugins/goto/locale/messages.po

index 165659b461ef19b0cbafccafe318685bb45970c5..a372071a50c1fc5e7afbc90cd88dd3116bdc0f57 100644 (file)
@@ -78,8 +78,11 @@ class goLdapServer extends goService{
     if(empty($this->goLdapBase)){
       $message[] = msgPool::required(_("Base"));
     }
-    if(!preg_match("/^ldap[si]?:\/\/[^\/]+\/.+$/", $this->goLdapBase)){
-      $message[] = msgPool::invalid(_("Base"),"","","ldap[si]://base");
+    if(!preg_match("/^ldap[si]?:\/\/[\w-:_]+\/.+$/", $this->goLdapBase)){
+      $err = _('The specified LDAP URI is incorrectly formatted.');
+      $err .= "<br><br><i>"._("Example").":</i> ". "ldap[si]://server/base";
+
+      $message[] = $err;
     }
     return($message);
   }
index 88ced00e902ef8b3e5fca4d2acbad840af452bca..5db58f54538808958da2eb05146b4461a84c0629 100644 (file)
@@ -13,7 +13,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: messages\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-10-02 18:02+0200\n"
+"POT-Creation-Date: 2009-10-05 14:31+0200\n"
 "PO-Revision-Date: 2008-12-04 11:18+0100\n"
 "Last-Translator: Cajus Pollmeier <pollmeier@gonicus.de>\n"
 "Language-Team: deutsch <de@li.org>\n"
@@ -216,7 +216,7 @@ msgstr "Gerät"
 #: admin/systems/services/shares/class_goShareServer.inc:301
 #: admin/systems/services/shares/class_goShareServer.inc:314
 #: admin/systems/services/ntp/class_goNtpServer.inc:98
-#: admin/systems/services/ldap/class_goLdapServer.inc:117
+#: admin/systems/services/ldap/class_goLdapServer.inc:120
 #: admin/systems/services/terminal/class_goTerminalServer.inc:103
 #: admin/applications/class_applicationParameters.inc:158
 #: admin/applications/class_applicationParameters.inc:226
@@ -262,7 +262,6 @@ msgstr "Geräte"
 #: admin/systems/goto/class_workstationGeneric.inc:710
 #: admin/systems/goto/workstation.tpl:35 admin/systems/goto/printer.tpl:27
 #: admin/systems/services/ldap/class_goLdapServer.inc:79
-#: admin/systems/services/ldap/class_goLdapServer.inc:82
 #: admin/applications/generic.tpl:42
 #: admin/applications/class_applicationGeneric.inc:622
 #: admin/applications/class_divListApplication.inc:90
@@ -2380,7 +2379,7 @@ msgstr "CUPS"
 #: admin/systems/services/kiosk/class_goKioskService.inc:270
 #: admin/systems/services/shares/class_goShareServer.inc:414
 #: admin/systems/services/ntp/class_goNtpServer.inc:115
-#: admin/systems/services/ldap/class_goLdapServer.inc:129
+#: admin/systems/services/ldap/class_goLdapServer.inc:132
 #: admin/systems/services/terminal/class_goTerminalServer.inc:165
 #: admin/systems/services/syslog/class_goLogDBServer.inc:93
 #: admin/systems/services/syslog/class_goSyslogServer.inc:69
@@ -2506,12 +2505,21 @@ msgstr "LDAP URI"
 msgid "fill-in-your-servers-dns-name"
 msgstr "tragen-sie-den-dns-namen-des-servers-ein"
 
-#: admin/systems/services/ldap/class_goLdapServer.inc:128
-#: admin/systems/services/ldap/class_goLdapServer.inc:129
+#: admin/systems/services/ldap/class_goLdapServer.inc:82
+msgid "The specified LDAP URI is incorrectly formatted."
+msgstr "Die angegebene LDAP URI ist nicht korrekt formatiert."
+
+#: admin/systems/services/ldap/class_goLdapServer.inc:83
+#: addons/goto/goto_import_file.tpl:9
+msgid "Example"
+msgstr "Beispiel"
+
+#: admin/systems/services/ldap/class_goLdapServer.inc:131
+#: admin/systems/services/ldap/class_goLdapServer.inc:132
 msgid "Ldap"
 msgstr "LDAP"
 
-#: admin/systems/services/ldap/class_goLdapServer.inc:137
+#: admin/systems/services/ldap/class_goLdapServer.inc:140
 msgid "Ldap base"
 msgstr "LDAP-Basis"
 
@@ -3874,10 +3882,6 @@ msgstr "IP-Adresse"
 msgid "DHCP group"
 msgstr "DHCP-Gruppe"
 
-#: addons/goto/goto_import_file.tpl:9
-msgid "Example"
-msgstr "Beispiel"
-
 #: addons/goto/goto_import_file.tpl:21
 msgid "Select list to import"
 msgstr "Wählen Sie die zu importierende Liste"
index b41af27a58e60a88e4403c3d27dda07ef3e5a865..ea8ba3d197aea1233c53c51e1bb02a8581f25dd6 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-10-02 18:02+0200\n"
+"POT-Creation-Date: 2009-10-05 14:31+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -209,7 +209,7 @@ msgstr ""
 #: admin/systems/services/shares/class_goShareServer.inc:301
 #: admin/systems/services/shares/class_goShareServer.inc:314
 #: admin/systems/services/ntp/class_goNtpServer.inc:98
-#: admin/systems/services/ldap/class_goLdapServer.inc:117
+#: admin/systems/services/ldap/class_goLdapServer.inc:120
 #: admin/systems/services/terminal/class_goTerminalServer.inc:103
 #: admin/applications/class_applicationParameters.inc:158
 #: admin/applications/class_applicationParameters.inc:226
@@ -255,7 +255,6 @@ msgstr ""
 #: admin/systems/goto/class_workstationGeneric.inc:710
 #: admin/systems/goto/workstation.tpl:35 admin/systems/goto/printer.tpl:27
 #: admin/systems/services/ldap/class_goLdapServer.inc:79
-#: admin/systems/services/ldap/class_goLdapServer.inc:82
 #: admin/applications/generic.tpl:42
 #: admin/applications/class_applicationGeneric.inc:622
 #: admin/applications/class_divListApplication.inc:90
@@ -2311,7 +2310,7 @@ msgstr ""
 #: admin/systems/services/kiosk/class_goKioskService.inc:270
 #: admin/systems/services/shares/class_goShareServer.inc:414
 #: admin/systems/services/ntp/class_goNtpServer.inc:115
-#: admin/systems/services/ldap/class_goLdapServer.inc:129
+#: admin/systems/services/ldap/class_goLdapServer.inc:132
 #: admin/systems/services/terminal/class_goTerminalServer.inc:165
 #: admin/systems/services/syslog/class_goLogDBServer.inc:93
 #: admin/systems/services/syslog/class_goSyslogServer.inc:69
@@ -2435,12 +2434,21 @@ msgstr ""
 msgid "fill-in-your-servers-dns-name"
 msgstr ""
 
-#: admin/systems/services/ldap/class_goLdapServer.inc:128
-#: admin/systems/services/ldap/class_goLdapServer.inc:129
+#: admin/systems/services/ldap/class_goLdapServer.inc:82
+msgid "The specified LDAP URI is incorrectly formatted."
+msgstr ""
+
+#: admin/systems/services/ldap/class_goLdapServer.inc:83
+#: addons/goto/goto_import_file.tpl:9
+msgid "Example"
+msgstr ""
+
+#: admin/systems/services/ldap/class_goLdapServer.inc:131
+#: admin/systems/services/ldap/class_goLdapServer.inc:132
 msgid "Ldap"
 msgstr ""
 
-#: admin/systems/services/ldap/class_goLdapServer.inc:137
+#: admin/systems/services/ldap/class_goLdapServer.inc:140
 msgid "Ldap base"
 msgstr ""
 
@@ -3762,10 +3770,6 @@ msgstr ""
 msgid "DHCP group"
 msgstr ""
 
-#: addons/goto/goto_import_file.tpl:9
-msgid "Example"
-msgstr ""
-
 #: addons/goto/goto_import_file.tpl:21
 msgid "Select list to import"
 msgstr ""