From 646652bc3ec07f83d4f742c2f112a031e9344f0f Mon Sep 17 00:00:00 2001 From: psc Date: Thu, 11 Feb 2010 10:24:58 +0000 Subject: [PATCH] Apply fix for #774 - Add a check that disallows dashes at the beginning of a script classname. - Add localisation for new string git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15609 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_askClassName.inc | 5 +++++ .../fai/locale/de/LC_MESSAGES/messages.po | 13 ++++++++++--- trunk/gosa-plugins/fai/locale/messages.po | 12 +++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc b/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc index 3d3beb2eb..197f9726d 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc @@ -142,6 +142,11 @@ class askClassName extends plugin $message[] = msgPool::invalid(_("Name"),preg_replace("/ /","_",$this->ClassName),"/[^_]/"); } + if($this->objectClass == "FAIscript" && preg_match("/^-/", $this->ClassName)) { + $message[] = sprintf(_("The specified classname '%s' is invalid. Scripts must not start with a dash."), $this->ClassName); + + } + if($this->ClassName == ""){ $message[]= msgPool::required(_("Name")); } diff --git a/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po b/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po index a6a8c1735..b46a1fcfc 100644 --- a/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po +++ b/trunk/gosa-plugins/fai/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-16 17:38+0200\n" +"POT-Creation-Date: 2010-02-10 15:41+0100\n" "PO-Revision-Date: 2008-12-04 11:27+0100\n" "Last-Translator: Cajus Pollmeier \n" "Language-Team: deutsch \n" @@ -70,7 +70,7 @@ msgstr "FAI Release" #: admin/fai/class_faiPartitionTableEntry.inc:474 #: admin/fai/class_faiTemplate.inc:421 admin/fai/class_faiTemplate.inc:545 #: admin/fai/faiVariable.tpl:9 admin/fai/class_askClassName.inc:142 -#: admin/fai/class_askClassName.inc:146 admin/fai/class_askClassName.inc:150 +#: admin/fai/class_askClassName.inc:151 admin/fai/class_askClassName.inc:155 #: admin/fai/class_faiManagement.inc:614 admin/fai/class_faiManagement.inc:620 #: admin/fai/class_faiScriptEntry.inc:137 #: admin/fai/class_faiScriptEntry.inc:142 @@ -651,7 +651,14 @@ msgstr "Profil" msgid "Template bundle" msgstr "Vorlagen-Gruppe" -#: admin/fai/class_askClassName.inc:175 +#: admin/fai/class_askClassName.inc:146 +#, php-format +msgid "" +"The specified classname '%s' is invalid. Scripts must not start with a dash." +msgstr "" +"Der angegebene Klassen-Name ist ungültig. Skripte dürfen nicht mit einem Bindestrich beginnn." + +#: admin/fai/class_askClassName.inc:189 #, php-format msgid "This FAI class name is already in use by the administrative unit '%s'." msgstr "" diff --git a/trunk/gosa-plugins/fai/locale/messages.po b/trunk/gosa-plugins/fai/locale/messages.po index e4286cf39..4a23d8c45 100644 --- a/trunk/gosa-plugins/fai/locale/messages.po +++ b/trunk/gosa-plugins/fai/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-16 17:38+0200\n" +"POT-Creation-Date: 2010-02-10 15:41+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -64,7 +64,7 @@ msgstr "" #: admin/fai/class_faiPartitionTableEntry.inc:474 #: admin/fai/class_faiTemplate.inc:421 admin/fai/class_faiTemplate.inc:545 #: admin/fai/faiVariable.tpl:9 admin/fai/class_askClassName.inc:142 -#: admin/fai/class_askClassName.inc:146 admin/fai/class_askClassName.inc:150 +#: admin/fai/class_askClassName.inc:151 admin/fai/class_askClassName.inc:155 #: admin/fai/class_faiManagement.inc:614 admin/fai/class_faiManagement.inc:620 #: admin/fai/class_faiScriptEntry.inc:137 #: admin/fai/class_faiScriptEntry.inc:142 @@ -613,7 +613,13 @@ msgstr "" msgid "Template bundle" msgstr "" -#: admin/fai/class_askClassName.inc:175 +#: admin/fai/class_askClassName.inc:146 +#, php-format +msgid "" +"The specified classname '%s' is invalid. Scripts must not start with a dash." +msgstr "" + +#: admin/fai/class_askClassName.inc:189 #, php-format msgid "This FAI class name is already in use by the administrative unit '%s'." msgstr "" -- 2.30.2