1 <?php
2 /*
3 * This code is part of GOsa (http://www.gosa-project.org)
4 * Copyright (C) 2003-2008 GONICUS GmbH
5 *
6 * ID: $$Id$$
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
23 class ogroupManagement extends plugin
24 {
25 /* Definitions */
26 var $plHeadline= "Object groups";
27 var $plDescription= "Manage object groups";
29 /* attribute list for save action */
30 var $attributes= array();
31 var $objectclasses= array();
32 var $obtypes= array();
33 var $ogroup;
35 var $CopyPasteHandler = NULL;
36 var $DivListOGroup = NULL;
37 var $start_pasting_copied_objects = FALSE;
39 var $dns = array();
40 var $acl_module = array("ogroups");
42 function ogroupManagement (&$config, $dn= NULL)
43 {
44 /* Include config object */
45 $this->config= &$config;
46 $this->ui= get_userinfo();
48 /* Copy & Paste enabled ?
49 */
50 if ($this->config->get_cfg_value("copyPaste") == "true"){
51 $this->CopyPasteHandler = new CopyPasteHandler($this->config);
52 }
54 /* Div lsit management */
55 $this->DivListOGroup = new divListOGroup($this->config,$this);
56 }
58 function execute()
59 {
60 /* Call parent execute */
61 plugin::execute();
63 /****************
64 Variable intialisation && Check posts for commands
65 ****************/
67 session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_ogroups/","/^menu_action/"));
69 $smarty = get_smarty();
70 $s_action = "";
71 $s_entry = "";
73 /* Test Posts */
74 foreach($_POST as $key => $val){
75 // Post for delete
76 if(preg_match("/^group_del.*/",$key)){
77 $s_action = "del";
78 $s_entry = preg_replace("/^group_".$s_action."_/i","",$key);
79 // Post for edit
80 }elseif(preg_match("/^group_edit_.*/",$key)){
81 $s_action="edit";
82 $s_entry = preg_replace("/^group_".$s_action."_/i","",$key);
83 // Post for new
84 }elseif(preg_match("/^group_new.*/",$key)){
85 $s_action="new";
86 }elseif(preg_match("/^editPaste.*/i",$key)){
87 $s_action="editPaste";
88 }elseif(preg_match("/^copy_.*/",$key)){
89 $s_action="copy";
90 $s_entry = preg_replace("/^copy_/i","",$key);
91 }elseif(preg_match("/^cut_.*/",$key)){
92 $s_action="cut";
93 $s_entry = preg_replace("/^cut_/i","",$key);
94 }elseif(preg_match("/^remove_multiple_ogroups/",$key)){
95 $s_action="del_multiple";
96 }elseif(preg_match("/^multiple_cut_ogroups/",$key)){
97 $s_action = "cut_multiple";
98 }elseif(preg_match("/^multiple_copy_ogroups/",$key)){
99 $s_action = "copy_multiple";
100 }elseif(preg_match("/_group_edit_/",$key)){
101 $type = preg_replace("/_group_edit_.*$/","",$key);
102 $s_action="edit";
103 $s_entry = preg_replace("/".$type."_group_edit_/i","",$key);
104 $_POST['arg'] = $type;
105 }
106 }
107 $s_entry = preg_replace("/_.$/","",$s_entry);
109 // Edit if
110 if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){
111 $s_action ="edit";
112 $s_entry = $_GET['id'];
113 }
117 /* handle C&P from layers menu */
118 if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){
119 $s_action = "copy_multiple";
120 }
121 if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){
122 $s_action = "cut_multiple";
123 }
124 if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){
125 $s_action = "editPaste";
126 }
128 /* Create options */
129 if(isset($_POST['menu_action']) && $_POST['menu_action'] == "group_new"){
130 $s_action = "new";
131 }
133 /* handle remove from layers menu */
134 if(isset($_POST['menu_action']) && preg_match("/^remove_multiple/",$_POST['menu_action'])){
135 $s_action = "del_multiple";
136 }
138 /* Hanlde notification event requests */
139 if(isset($_POST['menu_action']) && preg_match("/^event/",$_POST['menu_action'])){
140 $s_action = $_POST['menu_action'];
141 }
144 /********************
145 Create notification event
146 ********************/
148 if(preg_match("/^event_/",$s_action) && class_available("DaemonEvent")){
149 $ids = $this->list_get_selected_items();
150 $uids = array();
151 foreach($ids as $id){
152 $uids[] = $this->ogrouplist[$id]['cn'][0];
153 }
154 if(count($uids)){
155 $events = DaemonEvent::get_event_types(USER_EVENT);
156 $event = preg_replace("/^event_/","",$s_action);
157 if(isset($events['BY_CLASS'][$event])){
158 $type = $events['BY_CLASS'][$event];
159 $this->ogroup = new $type['CLASS_NAME']($this->config);
160 $this->ogroup->add_targets($uids);
161 $this->ogroup->set_type(TRIGGERED_EVENT);
162 }
163 }
164 }
166 /* Abort event dialog */
167 if(isset($_POST['abort_event_dialog'])){
168 $this->ogroup = FALSE;
169 }
171 /* Save event */
172 if(isset($_POST['save_event_dialog'])){
173 $o_queue = new gosaSupportDaemon();
174 $o_queue->append($this->ogroup);
175 if($o_queue->is_error()){
176 msg_dialog::display(_("Infrastructure error"), msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
177 }else{
178 $this->ogroup = FALSE;
179 }
180 }
182 /* Display event */
183 if($this->ogroup instanceof DaemonEvent){
184 $this->ogroup->save_object();
185 return($this->ogroup->execute());
186 }
189 /****************
190 Copy & Paste handling
191 ****************/
193 /* Display the copy & paste dialog, if it is currently open */
194 $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
195 if($ret){
196 return($ret);
197 }
200 /***************
201 Create a new object group
202 ****************/
204 /* New group? */
205 if ($s_action=="new"){
207 /* By default we set 'dn' to 'new', all relevant plugins will
208 react on this. */
209 $this->dn= "new";
211 /* Create new ogroup- object */
212 $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $this->dn,"ogroups");
213 $this->ogroup->set_acl_base($this->DivListOGroup->selectedBase);
214 }
217 /********************
218 Delete MULTIPLE entries requested, display confirm dialog
219 ********************/
220 if ($s_action=="del_multiple"){
221 $ids = $this->list_get_selected_items();
223 if(count($ids)){
224 $this->dns = array();
225 $disallowed = array();
226 foreach($ids as $id){
227 $dn = $this->ogrouplist[$id]['dn'];
228 $acl = $this->ui->get_permissions($dn, "users/user");
229 if(preg_match("/d/",$acl)){
230 $this->dns[$id] = $dn;
231 }else{
232 $disallowed[] = $dn;
233 }
234 }
236 if(count($disallowed)){
237 msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG);
238 }
240 if(count($this->dns)){
242 /* Check locks */
243 if ($user= get_multiple_locks($this->dns)){
244 return(gen_locked_message($user,$this->dns));
245 }
247 $dns_names = array();
248 foreach($this->dns as $dn){
249 $dns_names[] = LDAP::fix($dn);
250 }
252 add_lock ($this->dns, $this->ui->dn);
254 /* Lock the current entry, so nobody will edit it during deletion */
255 $smarty->assign("info", msgPool::deleteInfo($dns_names,_("object group")));
256 $smarty->assign("multiple", true);
257 return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
258 }
259 }
260 }
263 /********************
264 Delete MULTIPLE entries confirmed
265 ********************/
267 /* Confirmation for deletion has been passed. Users should be deleted. */
268 if (isset($_POST['delete_multiple_ogroup_confirm'])){
270 /* Remove user by user and check acls before removeing them */
271 foreach($this->dns as $key => $dn){
273 $acl = $this->ui->get_permissions($dn, "ogroups");
274 if (preg_match('/d/', $acl)){
276 /* Delete request is permitted, perform LDAP action */
277 $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $dn);
278 $this->ogroup->delete ();
279 unset ($this->ogroup);
280 $this->ogroup= NULL;
281 } else {
283 /* Normally this shouldn't be reached, send some extra
284 logs to notify the administrator */
285 msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
286 new log("security","ogroups/".get_class($this),$dn,array(),"Tried to trick deletion.");
287 }
288 }
290 /* Remove lock file after successfull deletion */
291 $this->remove_lock();
292 $this->dns = array();
293 }
296 /********************
297 Delete MULTIPLE entries Canceled
298 ********************/
300 /* Remove lock */
301 if(isset($_POST['delete_multiple_ogroup_cancel'])){
303 /* Remove lock file after successfull deletion */
304 $this->remove_lock();
305 $this->dns = array();
306 }
309 /****************
310 Delete object group
311 ****************/
313 if ($s_action=="del"){
315 /* Get 'dn' from posted 'uid' */
316 $this->dn= $this->ogrouplist[$s_entry]['dn'];
318 /* Load permissions for selected 'dn' and check if
319 we're allowed to remove this 'dn' */
320 $acl = $this->ui->get_permissions($this->dn,"ogroups");
321 if(preg_match("/d/",$acl)){
323 /* Check locking, save current plugin in 'back_plugin', so
324 the dialog knows where to return. */
325 if (($user= get_lock($this->dn)) != ""){
326 return(gen_locked_message ($user, $this->dn));
327 }
329 /* Lock the current entry, so nobody will edit it during deletion */
330 add_lock ($this->dn, $this->ui->dn);
331 $smarty->assign("info", msgPool::deleteInfo(LDAP::fix($this->dn),_("object group")));
332 $smarty->assign("multiple", false);
333 return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
334 } else {
336 /* Obviously the user isn't allowed to delete. Show message and
337 clean session. */
338 msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
339 }
340 }
343 /****************
344 Delete confirmed
345 ****************/
347 /* Confirmation for deletion has been passed. Group should be deleted. */
348 if (isset($_POST['delete_group_confirm'])){
350 /* Some nice guy may send this as POST, so we've to check
351 for the permissions again. */
352 $acl = $this->ui->get_permissions($this->dn,"ogroups");
353 if(preg_match("/d/",$acl)){
355 /* Delete request is permitted, perform LDAP action */
356 $this->ogroup= new ogrouptabs($this->config,
357 $this->config->data['TABS']['OGROUPTABS'], $this->dn);
358 $this->ogroup->delete ();
359 unset ($this->ogroup);
360 $this->ogroup= NULL;
361 } else {
363 /* Normally this shouldn't be reached, send some extra
364 logs to notify the administrator */
365 msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
366 new log("security","ogroups/".get_class($this),$dn,array(),"Tried to trick deletion.");
367 }
369 /* Remove lock file after successfull deletion */
370 $this->remove_lock();
371 session::un_set('objectinfo');
372 }
375 /****************
376 Delete object group Canceled
377 ****************/
379 /* Delete group canceled? */
380 if (isset($_POST['delete_cancel'])){
381 $this->remove_lock();
382 session::un_set('objectinfo');
383 }
386 /****************
387 Edit group
388 ****************/
390 if (($s_action=="edit") && (! isset($this->ogroup->config)) ){
392 /* Get 'dn' from posted 'uid', must be unique */
393 $this->dn= $this->ogrouplist[$s_entry]['dn'];
395 /* Check locking, save current plugin in 'back_plugin', so
396 the dialog knows where to return. */
397 if (($user= get_lock($this->dn)) != ""){
398 return(gen_locked_message ($user, $this->dn));
399 }
401 /* Lock the current entry, so everyone will get the
402 above dialog */
403 add_lock ($this->dn, $this->ui->dn);
405 /* Register grouptab to trigger edit dialog */
406 $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $this->dn, "ogroups");
407 $this->ogroup->set_acl_base($this->dn);
408 session::set('objectinfo',$this->dn);
409 }
412 /****************
413 Edit finished save
414 ****************/
416 /* Finish button has been pressed */
417 if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && (isset($this->ogroup->config)) ){
419 /* Check tabs, will feed message array */
420 $message= $this->ogroup->check();
422 /* Save, or display error message? */
423 if (count($message) == 0){
425 /* Save user data to ldap */
426 $this->ogroup->save();
428 if (!isset($_POST['edit_apply'])){
429 /* Group has been saved successfully, remove lock from
430 LDAP. */
431 if ($this->dn != "new"){
432 $this->remove_lock();
433 }
435 unset ($this->ogroup);
436 $this->ogroup= NULL;
437 session::un_set('objectinfo');
438 }else{
440 /* Reinitialize tab */
441 if($this->ogroup instanceof tabs){
442 $this->ogroup->re_init();
443 }
444 }
445 } else {
446 /* Ok. There seem to be errors regarding to the tab data,
447 show message and continue as usual. */
448 msg_dialog::displayChecks($message);
449 }
450 }
453 /****************
454 Cancel edit object group
455 ****************/
457 /* Cancel dialogs */
458 if ((isset($_POST['edit_cancel'])) && (isset($this->ogroup->dn))){
459 $this->remove_lock();
460 $this->ogroup= NULL;
461 session::un_set('objectinfo');
462 }
465 /****************
466 Display open dialogs
467 ****************/
469 /* Show dialog if object is present */
470 if (isset($this->ogroup->config)){
471 $display= $this->ogroup->execute();
473 /* Don't show buttons if tab dialog requests this */
474 if (!$this->ogroup->by_object[$this->ogroup->current]->dialog){
475 $display.= "<p style=\"text-align:right\">\n";
476 $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
477 $display.= " \n";
478 if ($this->dn != "new"){
479 $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
480 $display.= " \n";
481 }
482 $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
483 $display.= "</p>";
484 }
485 return ($display);
486 }
489 /****************
490 Display list
491 ****************/
493 /* Check if there is a snapshot dialog open */
494 $base = $this->DivListOGroup->selectedBase;
495 if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
496 return($str);
497 }
499 /* Display dialog with group list */
500 $this->DivListOGroup->parent = $this;
501 $this->DivListOGroup->execute();
503 /* Add departments if subsearch is disabled */
504 if(!$this->DivListOGroup->SubSearch){
505 $this->DivListOGroup->AddDepartments($this->DivListOGroup->selectedBase,4,1);
506 }
507 $this->reload ();
508 $this->DivListOGroup->setEntries($this->ogrouplist);
509 return($this->DivListOGroup->Draw());
510 }
513 /* Return departments, that will be included within snapshot detection */
514 function get_used_snapshot_bases()
515 {
516 return(array(get_ou('ogroupRDN').$this->DivListOGroup->selectedBase));
517 }
521 function convert_list($input)
522 {
523 $temp= "";
525 $conv= array(
526 "U" => array("plugins/generic/images/head.png" ,_("User") , "ogroup"),
527 "G" => array("plugins/groups/images/groups.png" ,_("Group") , "ogroup"),
528 "A" => array("plugins/ogroups/images/application.png" ,_("Application") , "ogroup"),
529 "D" => array("plugins/departments/department.png" ,_("Department") , "ogroup"),
530 "S" => array("plugins/ogroups/images/server.png" ,_("Server") , "ogroup"),
531 "F" => array("plugins/ogroups/images/asterisk.png" ,_("Phone") , "phonequeue"),
532 "W" => array("plugins/ogroups/images/workstation.png" ,_("Workstation") , "workstartup"),
533 "O" => array("plugins/ogroups/images/winstation.png" ,_("Windows Install") , "ogroup"),
534 "T" => array("plugins/ogroups/images/terminal.png" ,_("Terminal") , "termgroup"),
535 "P" => array("plugins/ogroups/images/printer.png" ,_("Printer") , "ogroup"));
537 /* Assemble picture */
538 $type= $input['gosaGroupObjects'][0];
539 $type= preg_replace("/[^A-Z]/i","",$type);
540 if (isset($type[0])){
541 $p1['pic']= $conv[$type[0]][0];
542 $p1['tit']= $conv[$type[0]][1];
543 $p1['alt']= $type[0];
544 $p1['lnk']= $conv[$type[0]][2];
545 $html_object_1 = "<input type='image' name='".$p1['lnk']."_group_edit_%KEY' ";
546 } else {
547 $p1['pic']= "images/empty.png";
548 $p1['tit']= "";
549 $p1['alt']= "";
550 $p1['lnk']= "";//$conv[$type[0]][2];
551 $html_object_1 = "<img ";
552 }
554 if (isset($type[1])){
555 $p2['pic']= $conv[$type[1]][0];
556 $p2['alt']= $type[1];
557 $p2['tit']= $conv[$type[1]][1];
558 $p2['lnk']= $conv[$type[1]][2];
559 $html_object_2 = "<input type='image' name='".$p2['lnk']."_group_edit_%KEY' ";
560 } else {
561 $p2['pic']= "images/empty.png";
562 $p2['alt']= "";
563 $p2['tit']= "";
564 $p2['lnk']= ""; //$conv[$type[0]][2];
565 $html_object_2 = "<img ";
566 }
568 $temp = $html_object_1." class='center' id='iconA".preg_replace("/_/","",$p1['lnk']."_group_edit_%KEY")."'
569 src='".$p1['pic']."' alt='".$p1['alt']."' title='".$p1['tit']."'>";
570 $temp.= $html_object_2." class='center' id='iconB".preg_replace("/_/","",$p2['lnk']."_group_edit_%KEY")."'
571 src='".$p2['pic']."' alt='".$p2['alt']."' title='".$p2['tit']."'>";
572 return ($temp);
573 }
576 function reload()
577 {
578 /* Set base for all searches && initialise some vars */
579 $this->ogrouplist= array();
580 $base = $this->DivListOGroup->selectedBase;
581 $filter = "(gosaGroupObjects=[])";
582 $Regex = $this->DivListOGroup->Regex;
584 $chk = array(
585 "UserGroups" => "(gosaGroupObjects=*U*)" ,
586 "GroupGroups" => "(gosaGroupObjects=*G*)" ,
587 "ApplicationGroups" => "(gosaGroupObjects=*A*)" ,
588 "DepartmentGroups" => "(gosaGroupObjects=*D*)" ,
589 "ServerGroups" => "(gosaGroupObjects=*S*)" ,
590 "WorkstationGroups" => "(gosaGroupObjects=*W*)" ,
591 "WindowsGroups" => "(gosaGroupObjects=*O*)" ,
592 "TerminalGroups" => "(gosaGroupObjects=*T*)" ,
593 "PrinterGroups" => "(gosaGroupObjects=*P*)" ,
594 "PhoneGroups" => "(gosaGroupObjects=*F*)" );
595 /* Create filter */
596 foreach($chk as $chkBox => $FilterPart){
597 if($this->DivListOGroup->$chkBox){
598 $filter .= $FilterPart;
599 }
600 }
601 $filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))";
603 if($this->DivListOGroup->SubSearch){
604 $res= get_sub_list($filter, "ogroups",get_ou('ogroupRDN'), $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
605 }else{
606 $res= get_sub_list($filter, "ogroups",get_ou('ogroupRDN'), get_ou('ogroupRDN').$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
607 }
609 $this->ogrouplist= $res;
610 ksort ($this->ogrouplist);
611 reset ($this->ogrouplist);
612 $tmp=array();
613 $tmp2 = array();
614 foreach($this->ogrouplist as $tkey => $val ){
615 $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
616 $tmp2[strtolower($val['cn'][0]).$val['cn'][0]] = strtolower($val['cn'][0]).$val['cn'][0];
617 }
618 natcasesort($tmp2);
619 $this->ogrouplist=array();
620 foreach($tmp2 as $val){
621 $this->ogrouplist[]=$tmp[$val];
622 }
623 reset ($this->ogrouplist);
624 }
627 function list_get_selected_items()
628 {
629 $ids = array();
630 foreach($_POST as $name => $value){
631 if(preg_match("/^item_selected_[0-9]*$/",$name)){
632 $id = preg_replace("/^item_selected_/","",$name);
633 $ids[$id] = $id;
634 }
635 }
636 return($ids);
637 }
640 function copyPasteHandling_from_queue($s_action,$s_entry)
641 {
642 /* Check if Copy & Paste is disabled */
643 if(!is_object($this->CopyPasteHandler)){
644 return("");
645 }
647 $ui = get_userinfo();
649 /* Add a single entry to queue */
650 if($s_action == "cut" || $s_action == "copy"){
652 /* Cleanup object queue */
653 $this->CopyPasteHandler->cleanup_queue();
654 $dn = $this->ogrouplist[$s_entry]['dn'];
655 if($s_action == "copy" && $ui->is_copyable($dn,"ogroups","ogroup")){
656 $this->CopyPasteHandler->add_to_queue($dn,$s_action,"ogrouptabs","OGROUPTABS","ogroups");
657 }
658 if($s_action == "cut" && $ui->is_cutable($dn,"ogroups","ogroup")){
659 $this->CopyPasteHandler->add_to_queue($dn,$s_action,"ogrouptabs","OGROUPTABS","ogroups");
660 }
661 }
664 /* Add entries to queue */
665 if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
667 /* Cleanup object queue */
668 $this->CopyPasteHandler->cleanup_queue();
670 /* Add new entries to CP queue */
671 foreach($this->list_get_selected_items() as $id){
672 $dn = $this->ogrouplist[$id]['dn'];
674 if($s_action == "copy_multiple" && $ui->is_copyable($dn,"ogroups","ogroup")){
675 $this->CopyPasteHandler->add_to_queue($dn,"copy","ogrouptabs","OGROUPTABS","ogroups");
676 }
677 if($s_action == "cut_multiple" && $ui->is_cutable($dn,"ogroups","ogroup")){
678 $this->CopyPasteHandler->add_to_queue($dn,"cut","ogrouptabs","OGROUPTABS","ogroups");
679 }
680 }
681 }
683 /* Start pasting entries */
684 if($s_action == "editPaste"){
685 $this->start_pasting_copied_objects = TRUE;
686 }
688 /* Return C&P dialog */
689 if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
691 /* Get dialog */
692 $this->CopyPasteHandler->SetVar("base",$this->DivListOGroup->selectedBase);
693 $data = $this->CopyPasteHandler->execute();
695 /* Return dialog data */
696 if(!empty($data)){
697 return($data);
698 }
699 }
700 /* Automatically disable status for pasting */
701 if(!$this->CopyPasteHandler->entries_queued()){
702 $this->start_pasting_copied_objects = FALSE;
703 }
704 return("");
705 }
708 function remove_lock()
709 {
710 if (isset($this->apptabs->dn)){
711 del_lock ($this->apptabs->dn);
712 }
713 if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
714 del_lock($this->dn);
715 }
716 if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
717 del_lock($this->dns);
718 }
719 }
722 function save_object()
723 {
724 $this->DivListOGroup->save_object();
725 if(is_object($this->CopyPasteHandler)){
726 $this->CopyPasteHandler->save_object();
727 }
728 }
731 }
733 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
734 ?>