Code

Updated sudo stuff
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 8 Apr 2008 11:00:03 +0000 (11:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 8 Apr 2008 11:00:03 +0000 (11:00 +0000)
-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
gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc
gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc
gosa-plugins/sudo/admin/sudo/class_sudoOption.inc

index 404a5a0e26313d5764b6068edaa43ab971464521..05a00306e5ffabda1611dbb583956ba8016e41d2 100644 (file)
@@ -127,9 +127,9 @@ class divListSudo extends MultiSelectWindow
     if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl)){
       $s.= "..|---|\n";
       $s.= "..|<img src='images/editcopy.png' alt='' border='0' class='center'>".
-        "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
+        "&nbsp;"._("Copy")."|"."multiple_copy_sudo|\n";
 #      $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
-#        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
+#        "&nbsp;"._("Cut")."|"."multiple_cut_sudo|\n";
 
       if($this->parent->CopyPasteHandler->entries_queued()){
         $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
index 6f33477d1f31e3f136358050d813a24e74998f02..1b044fa1840bf129425750237aa7de9e84cf6ae1 100644 (file)
@@ -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;
index 9f13e3ab8a1ca587c013515b0ca7c0ba268243c0..241a23ef9b1ba66683f9284159f817aa7cc522db 100644 (file)
@@ -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  ...
      ********************/
index e73ec41ffd258c15f047e982b30aa139e8b22977..bbd9c1880d7d57bd5817297bbf2d0c4f84e73f74 100644 (file)
@@ -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: