From 43c01a615c00ba79b96504934366bc173a074964 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 28 Oct 2009 10:29:00 +0000 Subject: [PATCH] Updated management copy & paste handling. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14667 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_CopyPasteHandler.inc | 2 +- gosa-core/include/class_management.inc | 24 +++++++++++++- .../admin/users/class_userManagement.inc | 31 ++++++++----------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/gosa-core/include/class_CopyPasteHandler.inc b/gosa-core/include/class_CopyPasteHandler.inc index ee772bb30..d9e8948c2 100644 --- a/gosa-core/include/class_CopyPasteHandler.inc +++ b/gosa-core/include/class_CopyPasteHandler.inc @@ -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){ diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 0d0f43ba0..801a00e0a 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -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); diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 6b9555930..9a10adf8a 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -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"; -- 2.30.2