Code

Updated management copy & paste handling.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 Oct 2009 10:29:00 +0000 (10:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 Oct 2009 10:29:00 +0000 (10:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14667 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_CopyPasteHandler.inc
gosa-core/include/class_management.inc
gosa-core/plugins/admin/users/class_userManagement.inc

index ee772bb300afcc345fba4ed46facca515865fde1..d9e8948c23a60a748c8e5a76f05cadb9c514c8f4 100644 (file)
@@ -359,8 +359,8 @@ class CopyPasteHandler {
 
       /* Load next queue entry */
       if(!count($msgs)){
-        $this->lastdn = $this->current['object']->dn;
         $this->current['object']->save();
+        $this->lastdn = $this->current['object']->dn;
         $this->current = FALSE;
       }else{
         foreach( $msgs as $msg){
index 0d0f43ba0b16de5abe7e29f40f937a1a5a90ac39..801a00e0aedf69fce6f6e3967116ffbd083a1f4e 100644 (file)
@@ -74,6 +74,26 @@ class management
     if(empty($this->plIcon)){
       $this->plIcon = "plugins/".$plugname."/images/plugin.png";
     }
+
+    // Register default actions
+    $this->registerAction("new",    "newEntry");
+    $this->registerAction("edit",   "editEntry");
+    $this->registerAction("apply",  "applyChanges");
+    $this->registerAction("save",   "saveChanges");
+    $this->registerAction("cancel", "cancelEdit");
+    $this->registerAction("remove", "removeEntryRequested");
+    $this->registerAction("removeConfirmed", "removeEntryConfirmed");
+
+    $this->registerAction("copy",   "copyPasteHandler");
+    $this->registerAction("cut",    "copyPasteHandler");
+    $this->registerAction("paste",  "copyPasteHandler");
+
+    $this->registerAction("snapshot",    "createSnapshotDialog");
+    $this->registerAction("restore",     "restoreSnapshotDialog");
+    $this->registerAction("saveSnapshot","saveSnapshot");
+    $this->registerAction("restoreSnapshot","restoreSnapshot");
+    $this->registerAction("cancelSnapshot","closeDialogs");
+
   }
 
   function execute()
@@ -128,7 +148,9 @@ class management
       }
       $this->snapHandler->setSnapshotBases($bases);
     }
-      
+    
+    echo $this->cpHandler->lastdn;
+  
     $this->headpage->update();
     $display = $this->headpage->render();
     return($this->getHeader().$display);
index 6b9555930835a9500605024b0de4417cc98c67c7..9a10adf8a2551327afd5d8154f93a87bd7a58eb0 100644 (file)
@@ -74,24 +74,6 @@ class userManagement extends management
 
     parent::__construct($config, $ui, "users", $headpage);
 
-    $this->registerAction("new",    "newEntry");
-    $this->registerAction("edit",   "editEntry");
-    $this->registerAction("apply",  "applyChanges");
-    $this->registerAction("save",   "saveChanges");
-    $this->registerAction("cancel", "cancelEdit");
-    $this->registerAction("remove", "removeEntryRequested");
-    $this->registerAction("removeConfirmed", "removeEntryConfirmed");
-
-    $this->registerAction("copy",   "copyPasteHandler");
-    $this->registerAction("cut",    "copyPasteHandler");
-    $this->registerAction("paste",  "copyPasteHandler");
-
-    $this->registerAction("snapshot",    "createSnapshotDialog");
-    $this->registerAction("restore",     "restoreSnapshotDialog");
-    $this->registerAction("saveSnapshot","saveSnapshot");
-    $this->registerAction("restoreSnapshot","restoreSnapshot");
-    $this->registerAction("cancelSnapshot","closeDialogs");
-
     // Register special user actions 
     $this->registerAction("lock",   "lockEntry");
     $this->registerAction("lockUsers",   "lockUsers");
@@ -655,6 +637,19 @@ class userManagement extends management
   }
 
 
+  function copyPasteHandler($s_action,$s_entry)
+  {
+    $this->cpHandler->lastdn = "";
+    $str = management::copyPasteHandler($s_action,$s_entry);
+
+    if($this->cpHandler->lastdn != "" && isset($_POST['passwordTodo']) && $_POST['passwordTodo'] == "new"){
+      $this->pwd_change_queue[] = $this->cpHandler->lastdn;
+      return($this->handlePasswordQueue());
+    }
+    return($str);
+  }
+
+
   static function filterLockImage($userPassword)
   {
     $image= "images/empty.png";