From c6129592b2002800af47ea8bcab51748b64a9e97 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 8 Apr 2008 11:00:03 +0000 Subject: [PATCH] Updated sudo stuff -Fixed copy & paste for options. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10281 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/sudo/admin/sudo/class_divListSudo.inc | 4 ++-- gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc | 6 +++--- gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc | 6 ++++-- gosa-plugins/sudo/admin/sudo/class_sudoOption.inc | 6 ++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc index 404a5a0e2..05a00306e 100644 --- a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc +++ b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc @@ -127,9 +127,9 @@ class divListSudo extends MultiSelectWindow if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl)){ $s.= "..|---|\n"; $s.= "..|". - " "._("Copy")."|"."multiple_copy_systems|\n"; + " "._("Copy")."|"."multiple_copy_sudo|\n"; # $s.= "..|". -# " "._("Cut")."|"."multiple_cut_systems|\n"; +# " "._("Cut")."|"."multiple_cut_sudo|\n"; if($this->parent->CopyPasteHandler->entries_queued()){ $img = ""; diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 6f33477d1..1b044fa18 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -567,8 +567,8 @@ class sudo extends plugin } /* Check name */ - if(!preg_match("/^[a-z\@]*$/i",$this->cn)){ - $message[] = msgPool::invalid(_("Name"),$this->cn,"/[a-z\@]/i"); + if(!preg_match("/^[0-9a-z\@]*$/i",$this->cn)){ + $message[] = msgPool::invalid(_("Name"),$this->cn,"/[0-9a-z\@]/i"); } /* Check if this entry will cause duplicated ldap entries */ @@ -730,7 +730,7 @@ class sudo extends plugin { $vars = array("cn"); $smarty = get_smarty(); - $smarty->assign("cn" ,$this->cn); + $smarty->assign("cn", htmlentities($this->cn)); $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE)); $ret = array(); $ret['string'] = $str; diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc index 9f13e3ab8..241a23ef9 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc @@ -106,11 +106,13 @@ class sudoManagement extends plugin $s_action = $_POST['menu_action']; } - + /* handle C&P from layers menu */ + if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_sudo/",$_POST['menu_action'])){ + $s_action = "copy_multiple"; + } $smarty= get_smarty(); - /******************** Copy & Paste Handling ... ********************/ diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc index e73ec41ff..bbd9c1880 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc @@ -499,8 +499,10 @@ class sudoOption extends plugin function PrepareForCopyPaste($source) { plugin::PrepareForCopyPaste($source); - $this->attrs['sudoOption'] = $source['sudoOption']; - $this->load_options(); + if(isset($source['sudoOption'])){ + $this->attrs['sudoOption'] = $source['sudoOption']; + $this->load_options(); + } } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2