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::global_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 set_object_info();
372 }
375 /****************
376 Delete object group Canceled
377 ****************/
379 /* Delete group canceled? */
380 if (isset($_POST['delete_cancel'])){
381 $this->remove_lock();
382 set_object_info();
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,TRUE));
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 set_object_info($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 set_object_info();
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 set_object_info();
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 instanceOf tabs || $this->ogroup instanceOf plugin) && $this->ogroup->read_only == TRUE){
475 $display.= "<p style=\"text-align:right\">
476 <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
477 </p>";
478 }elseif (!$this->ogroup->by_object[$this->ogroup->current]->dialog){
479 $display.= "<p style=\"text-align:right\">\n";
480 $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
481 $display.= " \n";
482 if ($this->dn != "new"){
483 $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
484 $display.= " \n";
485 }
486 $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
487 $display.= "</p>";
488 }
489 return ($display);
490 }
493 /****************
494 Display list
495 ****************/
497 /* Check if there is a snapshot dialog open */
498 $base = $this->DivListOGroup->selectedBase;
499 if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
500 return($str);
501 }
503 /* Display dialog with group list */
504 $this->DivListOGroup->parent = $this;
505 $this->DivListOGroup->execute();
507 /* Add departments if subsearch is disabled */
508 if(!$this->DivListOGroup->SubSearch){
509 $this->DivListOGroup->AddDepartments($this->DivListOGroup->selectedBase,4,1);
510 }
511 $this->reload ();
512 $this->DivListOGroup->setEntries($this->ogrouplist);
513 return($this->DivListOGroup->Draw());
514 }
517 /* Return departments, that will be included within snapshot detection */
518 function get_used_snapshot_bases()
519 {
520 return(array(get_ou('ogroupRDN').$this->DivListOGroup->selectedBase));
521 }
525 function convert_list($input)
526 {
527 $temp= "";
529 $conv= array(
530 "U" => array("plugins/generic/images/head.png" ,_("User") , "ogroup"),
531 "G" => array("plugins/groups/images/groups.png" ,_("Group") , "ogroup"),
532 "A" => array("plugins/ogroups/images/application.png" ,_("Application") , "ogroup"),
533 "D" => array("plugins/departments/department.png" ,_("Department") , "ogroup"),
534 "S" => array("plugins/ogroups/images/server.png" ,_("Server") , "ogroup"),
535 "F" => array("plugins/ogroups/images/asterisk.png" ,_("Phone") , "phonequeue"),
536 "W" => array("plugins/ogroups/images/workstation.png" ,_("Workstation") , "workstartup"),
537 "O" => array("plugins/ogroups/images/winstation.png" ,_("Windows Install") , "ogroup"),
538 "T" => array("plugins/ogroups/images/terminal.png" ,_("Terminal") , "termgroup"),
539 "P" => array("plugins/ogroups/images/printer.png" ,_("Printer") , "ogroup"));
541 /* Assemble picture */
542 $type= $input['gosaGroupObjects'][0];
543 $type= preg_replace("/[^A-Z]/i","",$type);
544 if (isset($type[0])){
545 $p1['pic']= $conv[$type[0]][0];
546 $p1['tit']= $conv[$type[0]][1];
547 $p1['alt']= $type[0];
548 $p1['lnk']= $conv[$type[0]][2];
549 $html_object_1 = "<input type='image' name='".$p1['lnk']."_group_edit_%KEY' ";
550 } else {
551 $p1['pic']= "images/empty.png";
552 $p1['tit']= "";
553 $p1['alt']= "";
554 $p1['lnk']= "";//$conv[$type[0]][2];
555 $html_object_1 = "<img ";
556 }
558 if (isset($type[1])){
559 $p2['pic']= $conv[$type[1]][0];
560 $p2['alt']= $type[1];
561 $p2['tit']= $conv[$type[1]][1];
562 $p2['lnk']= $conv[$type[1]][2];
563 $html_object_2 = "<input type='image' name='".$p2['lnk']."_group_edit_%KEY' ";
564 } else {
565 $p2['pic']= "images/empty.png";
566 $p2['alt']= "";
567 $p2['tit']= "";
568 $p2['lnk']= ""; //$conv[$type[0]][2];
569 $html_object_2 = "<img ";
570 }
572 $temp = $html_object_1." class='center' id='iconA".preg_replace("/_/","",$p1['lnk']."_group_edit_%KEY")."'
573 src='".$p1['pic']."' alt='".$p1['alt']."' title='".$p1['tit']."'>";
574 $temp.= $html_object_2." class='center' id='iconB".preg_replace("/_/","",$p2['lnk']."_group_edit_%KEY")."'
575 src='".$p2['pic']."' alt='".$p2['alt']."' title='".$p2['tit']."'>";
576 return ($temp);
577 }
580 function reload()
581 {
582 /* Set base for all searches && initialise some vars */
583 $this->ogrouplist= array();
584 $base = $this->DivListOGroup->selectedBase;
585 $filter = "(gosaGroupObjects=[])";
586 $Regex = $this->DivListOGroup->Regex;
588 $chk = array(
589 "UserGroups" => "(gosaGroupObjects=*U*)" ,
590 "GroupGroups" => "(gosaGroupObjects=*G*)" ,
591 "ApplicationGroups" => "(gosaGroupObjects=*A*)" ,
592 "DepartmentGroups" => "(gosaGroupObjects=*D*)" ,
593 "ServerGroups" => "(gosaGroupObjects=*S*)" ,
594 "WorkstationGroups" => "(gosaGroupObjects=*W*)" ,
595 "WindowsGroups" => "(gosaGroupObjects=*O*)" ,
596 "TerminalGroups" => "(gosaGroupObjects=*T*)" ,
597 "PrinterGroups" => "(gosaGroupObjects=*P*)" ,
598 "PhoneGroups" => "(gosaGroupObjects=*F*)" );
599 /* Create filter */
600 foreach($chk as $chkBox => $FilterPart){
601 if($this->DivListOGroup->$chkBox){
602 $filter .= $FilterPart;
603 }
604 }
605 $filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))";
607 if($this->DivListOGroup->SubSearch){
608 $res= get_sub_list($filter, "ogroups",get_ou('ogroupRDN'), $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
609 }else{
610 $res= get_sub_list($filter, "ogroups",get_ou('ogroupRDN'), get_ou('ogroupRDN').$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
611 }
613 $this->ogrouplist= $res;
614 ksort ($this->ogrouplist);
615 reset ($this->ogrouplist);
616 $tmp=array();
617 $tmp2 = array();
618 foreach($this->ogrouplist as $tkey => $val ){
619 $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
620 $tmp2[strtolower($val['cn'][0]).$val['cn'][0]] = strtolower($val['cn'][0]).$val['cn'][0];
621 }
622 natcasesort($tmp2);
623 $this->ogrouplist=array();
624 foreach($tmp2 as $val){
625 $this->ogrouplist[]=$tmp[$val];
626 }
627 reset ($this->ogrouplist);
628 }
631 function list_get_selected_items()
632 {
633 $ids = array();
634 foreach($_POST as $name => $value){
635 if(preg_match("/^item_selected_[0-9]*$/",$name)){
636 $id = preg_replace("/^item_selected_/","",$name);
637 $ids[$id] = $id;
638 }
639 }
640 return($ids);
641 }
644 function copyPasteHandling_from_queue($s_action,$s_entry)
645 {
646 /* Check if Copy & Paste is disabled */
647 if(!is_object($this->CopyPasteHandler)){
648 return("");
649 }
651 $ui = get_userinfo();
653 /* Add a single entry to queue */
654 if($s_action == "cut" || $s_action == "copy"){
656 /* Cleanup object queue */
657 $this->CopyPasteHandler->cleanup_queue();
658 $dn = $this->ogrouplist[$s_entry]['dn'];
659 if($s_action == "copy" && $ui->is_copyable($dn,"ogroups","ogroup")){
660 $this->CopyPasteHandler->add_to_queue($dn,$s_action,"ogrouptabs","OGROUPTABS","ogroups");
661 }
662 if($s_action == "cut" && $ui->is_cutable($dn,"ogroups","ogroup")){
663 $this->CopyPasteHandler->add_to_queue($dn,$s_action,"ogrouptabs","OGROUPTABS","ogroups");
664 }
665 }
668 /* Add entries to queue */
669 if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
671 /* Cleanup object queue */
672 $this->CopyPasteHandler->cleanup_queue();
674 /* Add new entries to CP queue */
675 foreach($this->list_get_selected_items() as $id){
676 $dn = $this->ogrouplist[$id]['dn'];
678 if($s_action == "copy_multiple" && $ui->is_copyable($dn,"ogroups","ogroup")){
679 $this->CopyPasteHandler->add_to_queue($dn,"copy","ogrouptabs","OGROUPTABS","ogroups");
680 }
681 if($s_action == "cut_multiple" && $ui->is_cutable($dn,"ogroups","ogroup")){
682 $this->CopyPasteHandler->add_to_queue($dn,"cut","ogrouptabs","OGROUPTABS","ogroups");
683 }
684 }
685 }
687 /* Start pasting entries */
688 if($s_action == "editPaste"){
689 $this->start_pasting_copied_objects = TRUE;
690 }
692 /* Return C&P dialog */
693 if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
695 /* Get dialog */
696 $this->CopyPasteHandler->SetVar("base",$this->DivListOGroup->selectedBase);
697 $data = $this->CopyPasteHandler->execute();
699 /* Return dialog data */
700 if(!empty($data)){
701 return($data);
702 }
703 }
704 /* Automatically disable status for pasting */
705 if(!$this->CopyPasteHandler->entries_queued()){
706 $this->start_pasting_copied_objects = FALSE;
707 }
708 return("");
709 }
712 function remove_lock()
713 {
714 if (isset($this->apptabs->dn)){
715 del_lock ($this->apptabs->dn);
716 }elseif(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
717 del_lock($this->dn);
718 }
719 if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
720 del_lock($this->dns);
721 }
722 }
725 function save_object()
726 {
727 $this->DivListOGroup->save_object();
728 if(is_object($this->CopyPasteHandler)){
729 $this->CopyPasteHandler->save_object();
730 }
731 }
734 }
736 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
737 ?>