From 69ca0365a2201e08340a7b2b16e79653e3ba664d Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 27 Nov 2007 14:49:08 +0000 Subject: [PATCH] Updated blocklists. -We can copy & paste blocklists now git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7917 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_CopyPasteHandler.inc | 2 +- include/class_tabs.inc | 4 +-- .../blocklists/class_blocklistGeneric.inc | 22 ++++++++++++++ .../blocklists/class_blocklistManagement.inc | 29 ++++--------------- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/include/class_CopyPasteHandler.inc b/include/class_CopyPasteHandler.inc index 1d6a1f04a..5c021bfbc 100644 --- a/include/class_CopyPasteHandler.inc +++ b/include/class_CopyPasteHandler.inc @@ -400,7 +400,7 @@ class CopyPasteHandler { { $ret = array(); foreach($this->current['object']->by_object as $obj){ - if($obj->is_account){ + if($obj->is_account || $obj->ignore_account){ $ret = array_merge($ret , $obj->check()); } } diff --git a/include/class_tabs.inc b/include/class_tabs.inc index f75847a3a..7e9c593a1 100644 --- a/include/class_tabs.inc +++ b/include/class_tabs.inc @@ -307,7 +307,7 @@ class tabs function saveCopyDialog() { foreach ($this->by_object as &$obj){ - if($obj->is_account){ + if($obj->is_account || $obj->ignore_account){ $obj->saveCopyDialog(); } } @@ -321,7 +321,7 @@ class tabs $ret = ""; $this->SubDialog = false; foreach ($this->by_object as &$obj){ - if($obj->is_account){ + if($obj->is_account || $obj->ignore_account){ $tmp = $obj->getCopyDialog(); if($tmp['status'] == "SubDialog"){ $this->SubDialog = true; diff --git a/plugins/gofax/blocklists/class_blocklistGeneric.inc b/plugins/gofax/blocklists/class_blocklistGeneric.inc index 4504dfb27..4a5e013d5 100644 --- a/plugins/gofax/blocklists/class_blocklistGeneric.inc +++ b/plugins/gofax/blocklists/class_blocklistGeneric.inc @@ -290,6 +290,28 @@ class blocklistGeneric extends plugin + function getCopyDialog() + { + $smarty = get_smarty(); + $smarty->assign("cn",$this->cn); + $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__))); + $ret = array(); + $ret['string'] = $str; + $ret['status'] = ""; + return($ret); + } + + function saveCopyDialog() + { + if(isset($_POST['cn'])){ + $this->cn = get_post('cn'); + } + } + + function PrepareForCopyPaste($source) + { + plugin::PrepareForCopyPaste($source); + } diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index 16fa5e08f..f9b19ea2a 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -5,18 +5,12 @@ class blocklist extends plugin var $plHeadline= "FAX Blocklists"; var $plDescription= "This does something"; - /* CLI vars */ - var $cli_summary= "Handling of GOfax block lists"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - var $blocklists = array(); var $DivListBlocklist = NULL; var $CopyPasteHandler = NULL; var $start_pasting_copied_objects = FALSE; - function blocklist (&$config, $ui) { $this->ui = $ui; @@ -239,7 +233,7 @@ class blocklist extends plugin Delete MULTIPLE entries confirmed ********************/ - /* Confirmation for deletion has been passed. Users should be deleted. */ + /* Confirmation for deletion has been passed. */ if (isset($_POST['delete_multiple_blocklist_confirm'])){ /* Remove user by user and check acls before removeing them */ @@ -428,7 +422,7 @@ class blocklist extends plugin /* Cleanup object queue */ $this->CopyPasteHandler->cleanup_queue(); $dn = $this->blocklists[$s_entry]['dn']; - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"blocklistGeneric","","users"); + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist"); } /* Add entries to queue */ @@ -442,10 +436,10 @@ class blocklist extends plugin $dn = $this->blocklists[$id]['dn']; if($s_action == "copy_multiple"){ - $this->CopyPasteHandler->add_to_queue($dn,"copy","usertabs","USERTABS","users"); + $this->CopyPasteHandler->add_to_queue($dn,"copy","faxblocktabs","FAXBLOCKTABS","gofaxlist"); } if($s_action == "cut_multiple"){ - $this->CopyPasteHandler->add_to_queue($dn,"cut","usertabs","USERTABS","users"); + $this->CopyPasteHandler->add_to_queue($dn,"cut","faxblocktabs","FAXBLOCKTABS","gofaxlist"); } } } @@ -460,24 +454,13 @@ class blocklist extends plugin /* Load entry from queue and set base */ $this->CopyPasteHandler->load_entry_from_queue(); - $this->CopyPasteHandler->SetVar("base",$this->DivListUsers->selectedBase); + $this->CopyPasteHandler->SetVar("base",$this->DivListBlocklist->selectedBase); /* Get dialog */ $data = $this->CopyPasteHandler->execute(); - /* Set CPPasswordChange to s_entry which indicates that this entry requires a new password. */ - if(isset($_POST['passwordTodo']) && ($_POST['passwordTodo'] == "new")){ - $s_entry = $this->CopyPasteHandler->last_entry(); - $this->reload(); - foreach($this->blocklists as $key => $entry){ - if($entry['dn'] == $s_entry){ - $this->CPPasswordChange = $key; - } - } - } - /* Return dialog data */ - if(!empty($data) && $this->CPPasswordChange == ""){ + if(!empty($data)){ return($data); } } -- 2.30.2