From: psc Date: Tue, 6 Oct 2009 08:36:41 +0000 (+0000) Subject: Fix error message for invalid LDAP URIs X-Git-Url: https://git.tokkee.org/?p=gosa.git;a=commitdiff_plain;h=13093538998b9e87e26a2804a7ca4ef1516c837a Fix error message for invalid LDAP URIs - 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 --- diff --git a/trunk/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc b/trunk/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc index 165659b46..a372071a5 100644 --- a/trunk/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc +++ b/trunk/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc @@ -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 .= "

"._("Example").": ". "ldap[si]://server/base"; + + $message[] = $err; } return($message); } diff --git a/trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po b/trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po index 88ced00e9..5db58f545 100644 --- a/trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po +++ b/trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po @@ -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 \n" "Language-Team: deutsch \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" diff --git a/trunk/gosa-plugins/goto/locale/messages.po b/trunk/gosa-plugins/goto/locale/messages.po index b41af27a5..ea8ba3d19 100644 --- a/trunk/gosa-plugins/goto/locale/messages.po +++ b/trunk/gosa-plugins/goto/locale/messages.po @@ -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 \n" "Language-Team: LANGUAGE \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 ""