From 9610f9463f535019e076f483f82bed63043d6ead Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 12 Mar 2008 15:01:58 +0000 Subject: [PATCH] Updated msgPool usage in fai. -Scripts -Tamplates -Hooks - The rest is missing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9719 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiHookEntry.inc | 6 ++--- .../fai/admin/fai/class_faiScriptEntry.inc | 6 ++--- .../fai/admin/fai/class_faiTemplateEntry.inc | 26 ++++++++----------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc index 668e12cf7..679e740b6 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc @@ -149,15 +149,15 @@ class faiHookEntry extends plugin $message= plugin::check(); if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ - $message[] =_("Name is already in use!"); + $message[]= msgPool::duplicated(_("Name")); } if(empty($this->FAIscript)) { - $message[]=_("Please enter a script!"); + $message[]= msgPool::required(_("Script")); } if(empty($this->cn)){ - $message[] = _("Name is empty!"); + $message[]= msgPool::required(_("Name")); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc index 143d6f506..0202baecb 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc @@ -138,15 +138,15 @@ class faiScriptEntry extends plugin $message= plugin::check(); if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ - $message[] =_("Name is already in use!"); + $message[] = msgPool::duplicated(_("Name")); } if(empty($this->cn)){ - $message[] = _("Name is empty!"); + $message[] = msgPool::required(_("Name")); } if(empty($this->FAIscript)){ - $message[]=_("Please enter a script!"); + $message[]= msgPool::required("Script")); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc index d7066e181..62752d01d 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc @@ -193,38 +193,34 @@ class faiTemplateEntry extends plugin $message= plugin::check(); if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ - $message[] =_("There is already a template with the given name."); + $message[] = msgPool::duplicated(_("Name")); } if(empty($this->FAItemplateFile)){ - $message[]=_("Please specify a value for attribute 'file'."); + $message[]= msgPool::required(_("File")); } if(!preg_match('/^\//', $this->FAItemplatePath)){ - $message[]=_("Please specify a valid value for attribute 'Destination path'."); + $message[]= msgPool::invalid(_("Destination path"),$this->FAItemplatePath,'/^\//'); } - - if(empty($this->cn)){ - $message[] = _("Please enter a file name."); + + $b = basename($this->FAItemplatePath); + if(empty($b)){ + $message[] = msgPool::required(_("File name")); } -# echo $this->cn; -# if(preg_match('/\//', $this->cn)){ -# $message[] = _("The file name should not contain / characters."); -# # } - if(empty($this->user)){ - $message[] = _("Please enter a user."); + $message[] = msgPool::required(_("User")); } elseif(preg_match("/[^0-9a-z]/i",$this->user)){ - $message[] = _("Please enter a valid user. Only a-z/0-9 are allowed."); + $message[] = msgPool::invalid(_("User"),$this->user,"/[0-9a-z]/"); } if(empty($this->group)){ - $message[] = _("Please enter a group."); + $message[] = msgPool::required(_("Group")); } elseif(preg_match("/[^0-9a-z]/i",$this->group)){ - $message[] = _("Please enter a valid group. Only a-z/0-9 are allowed."); + $message[] = msgPool::invalid(_("Group"),$this->group,"/[0-9a-z]/"); } return ($message); -- 2.30.2