Code

Moved copy&paste into a seperate function
[gosa.git] / plugins / admin / applications / class_applicationManagement.inc
1 <?php
2 /*
3    This code is part of GOsa (https://gosa.gonicus.de)
4    Copyright (C) 2003  Cajus Pollmeier
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 require "tabs_application.inc";
22 class applicationManagement extends plugin
23 {
24   /* Definitions */
25   var $plHeadline= "Applications";
26   var $plDescription= "This does something";
28   /* Dialog attributes */
29   var $apptabs= NULL;
30   var $applications= array();
31   var $ui= NULL;
32   var $acl= "";
34   var $CopyPasteHandler = NULL;
36   var $Release  = "";
37   var $Releases = array();
39   var $enableReleaseManagement = false;
42   function applicationManagement ($config, $ui)
43   {
44     /* Save configuration for internal use */
45     $this->config= $config;
46     $this->ui= $ui;
48     if((isset($this->config->data['MAIN']['ENABLECOPYPASTE'])) 
49         && 
50         (preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE'] ))){
51       $this->CopyPasteHandler = new CopyPasteHandler($this->config);
52     }
54     /* Check if we should enable the release selection */
55     $tmp = search_config($this->config->data,"faiManagement","CLASS");
56     if(!empty($tmp)){
57       $this->enableReleaseManagement = true;
58     }
60     /* Get global filter config */
61     if (!is_global("appfilter")){
62       $base= get_base_from_people($ui->dn);
64       $appfilter= array("regex" => "*" ,
65                         "release" => "ou=apps,".$base);
66       register_global("appfilter", $appfilter);
67     }
69     $appfilter = get_global("appfilter");
70     if(!isset($_SESSION['CurrentMainBase'])){
71       $_SESSION['CurrentMainBase'] = get_base_from_people($ui->dn);
72     }
74     $this->Releases = $this->getReleases($_SESSION['CurrentMainBase']);
75     asort($this->Releases);
76     $this->Release  = $appfilter['release'];
77   }
79   function getReleases($base)
80   {
81     $dn   = "ou=apps,".$base;
83     $ret  = array();
85     $ret ["ou=apps,".$base] = "/";
87     $ldap = $this->config->get_ldap_link();
88     $ldap->cd($dn);
90     $ldap->search("objectClass=organizationalUnit",array("ou"));
92     while($attrs = $ldap->fetch()){
93       $str = str_replace($dn,"",$attrs['dn']);
94       $tmp = array_reverse( split("ou=",$str));
95       $str = "";
96       foreach($tmp as $val){
97         $val = trim(preg_replace("/,/","",$val));
98         if(empty($val)) break;
99         $str .= "/".$val;
100       } 
101       if(!empty($str)){
102         $ret[$attrs['dn']]= preg_replace("/^\//","",$str);
103       }
104     }
105     return($ret);
106   }
108   function execute()
109   {
110     /* Call parent execute */
111     plugin::execute();
113     $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^appl_edit_/","/^appl_del_/");
115     /* Save data */
116     $appfilter    = get_global("appfilter");
117     $smarty       = get_smarty();             // Smarty instance
118     $s_action     = "";                       // Contains the action to proceed
119     $s_entry      = "";                       // The value for s_action
120     $base_back    = "";                       // The Link for Backbutton
121     
122     /* Start for New List Managment */
123     if(isset($_GET['act'])&&($_GET['act']=="dep_open")){
124       $s_action="open";
125       $s_entry = base64_decode($_GET['dep_id']);
126       $_SESSION['CurrentMainBase']= "".$this->config->departments[trim($s_entry)];
127     }
129     /* Get posted release */
130     if(isset($_POST['select_release'])){
131       $r = $_POST['select_release'];
132       if((isset($this->Releases[$r])) && ($this->Release != $r)){
133         $this->Release = $r;
134         $appfilter = get_global("appfilter");
135         $appfilter['release'] = $r;
136         register_global("appfilter",$appfilter);      
137       }
138     }
140     /* Test Posts */
141     foreach($_POST as $key => $val){
142       // Post for delete
143       if(preg_match("/appl_del.*/",$key)){
144         $s_action = "del";
145         $s_entry  = preg_replace("/appl_".$s_action."_/i","",$key);
146         // Post for edit
147       }elseif(preg_match("/appl_edit_.*/",$key)){
148         $s_action="edit";
149         $s_entry  = preg_replace("/appl_".$s_action."_/i","",$key);
150         // Post for new
151       }elseif(preg_match("/^copy_.*/",$key)){
152         $s_action="copy";
153         $s_entry  = preg_replace("/^copy_/i","",$key);
154       }elseif(preg_match("/^cut_.*/",$key)){
155         $s_action="cut";
156         $s_entry  = preg_replace("/^cut_/i","",$key);
157         // Post for new
158       }elseif(preg_match("/^dep_back.*/i",$key)){
159         $s_action="back";
160       }elseif(preg_match("/^appl_new.*/",$key)){
161         $s_action="new";
162       }elseif(preg_match("/^dep_home.*/i",$key)){
163         $s_action="home";
164       }elseif(preg_match("/^dep_root.*/i",$key)){
165         $s_action="root";
166       }elseif(preg_match("/^editPaste.*/i",$key)){
167         $s_action="editPaste";
168       }
169     }
171     if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){
172       $s_action ="edit";
173       $s_entry  = $_GET['id'];
174     }
176     $s_entry  = preg_replace("/_.$/","",$s_entry);
178     /* Department changed? */
179     if(isset($_POST['CurrentMainBase']) && $_POST['CurrentMainBase']){
180       $_SESSION['CurrentMainBase']= $_POST['CurrentMainBase'];
181     }
183     /* Homebutton is posted */
184     if($s_action=="home"){
185       $_SESSION['CurrentMainBase']=(preg_replace("/^[^,]+,/","",$this->ui->dn));
186       $_SESSION['CurrentMainBase']=(preg_replace("/^[^,]+,/","",$_SESSION['CurrentMainBase']));
187     }
189     if($s_action=="root"){
190       $_SESSION['CurrentMainBase']=($this->config->current['BASE']);
191     }
193     /* If Backbutton is Posted */
194     if($s_action=="back"){
195       $base_back          = preg_replace("/^[^,]+,/","",$_SESSION['CurrentMainBase']);
196       $base_back          = convert_department_dn($base_back);
198       if(isset($this->config->departments[trim($base_back)])){
199         $_SESSION['CurrentMainBase']= $this->config->departments[trim($base_back)];
200       }else{
201         $_SESSION['CurrentMainBase']= $this->config->departments["/"];
202       }
203     }
205     if (isset($_POST['regex'])){
206       $appfilter['regex']= $_POST['regex'];
207     }
208     if (isset($_GET['search'])){
209       $s= mb_substr($_GET['search'], 0, 1, "UTF8")."*";
210       if ($s == "**"){
211         $s= "*";
212       }
213       $appfilter['regex']= $s;
214     }
215     
216     $this->Releases = $this->getReleases($_SESSION['CurrentMainBase']);
217     asort($this->Releases);
218     if(!isset($this->Releases[$this->Release])){
219       $this->Release = key($this->Releases);
220       $appfilter['release'] = $this->Release;
221       register_global("appfilter",$appfilter);
222     }
224     register_global("appfilter", $appfilter);
226     /* Check sorting variable */
227     $this->reload();
228     $smarty= get_smarty();
230     /* Check for exeeded sizelimit */
231     if (($message= check_sizelimit()) != ""){
232       return($message);
233     }
236     /* Only perform copy / paste if it is enabled 
237      */
238     if($this->CopyPasteHandler){
239       if($str = $this->copyPasteHandling($s_action,$s_entry)){
240        return($str);
241       };
242     }
244     /* New application? */
245     if ($s_action=="new"){
247       /* By default we set 'dn' to 'new', all relevant plugins will
248          react on this. */
249       $this->dn= "new";
251       /* Create new usertab object */
252       $this->apptabs= new apptabs($this->config,
253           $this->config->data['TABS']['APPSTABS'], $this->dn);
254       $this->apptabs->set_acl(array(':all'));
255     }
257     /* Cancel dialogs */
258     if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
259       del_lock ($this->apptabs->dn);
260       unset ($this->apptabs);
261       $this->apptabs= NULL;
262       unset ($_SESSION['objectinfo']);
263     }
265     /* Finish apps edit is triggered by the tabulator dialog, so
266        the user wants to save edited data. Check and save at this
267        point. */
268     if ((isset($_POST['edit_finish'])) && (isset($this->apptabs->config))){
270       /* Check tabs, will feed message array */
271       $this->apptabs->last= $this->apptabs->current;
272       $this->apptabs->save_object();
273       $message= $this->apptabs->check();
275       /* Save, or display error message? */
276       if (count($message) == 0){
278         /* Save data data to ldap */
279         $this->apptabs->set_release($this->Release);
280         $this->apptabs->save();
281         gosa_log ("Application object'".$this->dn."' has been saved");
283         /* Application has been saved successfully, remove lock from
284            LDAP. */
285         if ($this->dn != "new"){
286           del_lock ($this->dn);
287         }
289         /* There's no page reload so we have to read new apps at
290            this point. */
291         $this->reload ();
292         unset ($this->apptabs);
293         $this->apptabs= NULL;
294         unset ($_SESSION['objectinfo']);
295       } else {
296         /* Ok. There seem to be errors regarding to the tab data,
297            show message and continue as usual. */
298         show_errors($message);
299       }
300     }
302     /* User wants to edit data? */
303     if (($s_action=="edit") && (!isset($this->apptabs->config))){
305       /* Get 'dn' from posted 'applist', must be unique */
306       $this->dn= $this->applications[$s_entry]['dn'];
308       /* Check locking, save current plugin in 'back_plugin', so
309          the dialog knows where to return. */
310       if (($user= get_lock($this->dn)) != ""){
311         return(gen_locked_message ($user, $this->dn));
312       }
314       /* Lock the current entry, so everyone will get the
315          above dialog */
316       add_lock ($this->dn, $this->ui->dn);
318       /* Set up the users ACL's for this 'dn' */
319       $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
321       /* Register apptabs to trigger edit dialog */
322       $this->apptabs= new apptabs($this->config,
323           $this->config->data['TABS']['APPSTABS'], $this->dn);
324       $this->apptabs->set_acl($acl);
325       $_SESSION['objectinfo']= $this->dn;
326     }
328     /* Remove user was requested */
329     if ($s_action == "del"){
331       /* Get 'dn' from posted 'uid' */
332       $this->dn= $this->applications[$s_entry]['dn'];
334       /* Load permissions for selected 'dn' and check if
335          we're allowed to remove this 'dn' */
336       $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
337       $this->acl= get_module_permission($acl, "application", $this->dn);
338       if (chkacl($this->acl, "delete") == ""){
340         /* Check locking, save current plugin in 'back_plugin', so
341            the dialog knows where to return. */
342         if (($user= get_lock($this->dn)) != ""){
343           return (gen_locked_message ($user, $this->dn));
344         }
346         /* Lock the current entry, so nobody will edit it during deletion */
347         add_lock ($this->dn, $this->ui->dn);
348         $smarty= get_smarty();
349         $smarty->assign("intro", sprintf(_("You're about to delete the application '%s'."), @LDAP::fix($this->dn)));
350         return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
351       } else {
353         /* Obviously the user isn't allowed to delete. Show message and
354            clean session. */
355         print_red (_("You are not allowed to delete this application!"));
356       }
357     }
359     /* Confirmation for deletion has been passed. Group should be deleted. */
360     if (isset($_POST['delete_app_confirm'])){
362       /* Some nice guy may send this as POST, so we've to check
363          for the permissions again. */
364       if (chkacl($this->acl, "delete") == ""){
366         /* Delete request is permitted, perform LDAP action */
367         $this->apptabs= new apptabs($this->config,
368             $this->config->data['TABS']['APPSTABS'], $this->dn);
369         $this->apptabs->set_acl(array($this->acl));
370         $this->apptabs->delete ();
371         gosa_log ("Application object'".$this->dn."' has been removed");
372         unset ($this->apptabs);
373         $this->apptabs= NULL;
375         /* Group list has changed, reload it. */
376         $this->reload ();
377       } else {
379         /* Normally this shouldn't be reached, send some extra
380            logs to notify the administrator */
381         print_red (_("You are not allowed to delete this application!"));
382         gosa_log ("Warning: '".$this->ui->uid."' tried to trick group deletion.");
383       }
385       /* Remove lock file after successfull deletion */
386       del_lock ($this->dn);
387     }
390     /* Delete application canceled? */
391     if (isset($_POST['delete_cancel'])){
392       del_lock ($this->dn);
393       unset($_SESSION['objectinfo']);
394     }
396     /* Show tab dialog if object is present */
397     if (($this->apptabs) && (isset($this->apptabs->config))){
398       $display= $this->apptabs->execute();
400       /* Don't show buttons if tab dialog requests this */
401       if (!$this->apptabs->by_object[$this->apptabs->current]->dialog){
402         $display.= "<p style=\"text-align:right\">\n";
403         $display.= "<input type=\"submit\" name=\"edit_finish\" value=\""._("Save")."\">\n";
404         $display.= "&nbsp;\n";
405         $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
406         $display.= "</p>";
407       }
408       return ($display);
409     }
411     /* Show main page */
413     /* Prepare departments */
414     $options= "";
415     foreach ($this->config->idepartments as $key => $value){
416       if ($_SESSION['CurrentMainBase']== $key){
417         $options.= "<option selected='selected' value='$key'>$value</option>";
418       } else {
419         $options.= "<option value='$key'>$value</option>";
420       }
421     }
423     if($this->CopyPasteHandler){
424       $Copy_Paste = " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
426       if($this->CopyPasteHandler->isCurrentObjectPastAble()){
428         if($this->CopyPasteHandler->isCurrentCutted()){
429           $img = "images/cutpaste.png";
430         }else{
431           $img = "images/copypaste.png";
432         }
434         $Copy_Paste .= "<input type='image' name='editPaste' class='center' 
435           src='".$img."' alt='"._("Paste")."' title='".$this->CopyPasteHandler->GetCurrentDn()."'>&nbsp;";
436       }else{
437         $Copy_Paste .= "<img class='center' src='images/cant_editpaste.png' alt='"._("Can't paste")."'>&nbsp;";
438       }
439     }else{
440       $Copy_Paste ="";
441     }
443     // Managment
444     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
445       " <input class='center' type='image' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
446       " <input class='center' type='image' align='middle' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
447       " <input class='center' type='image' align='middle' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'>&nbsp;".
448       " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
449       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
450       " <input class='center' type='image' align='middle' src='images/list_new_app.png' alt='"._("new")."' title='"._("Create new application")."' name='appl_new'>&nbsp;".
451       $Copy_Paste.
452       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
453       _("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
454       " <input class='center' type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
455       "</div>";
459     if($this->CopyPasteHandler){
460       $actions = "<input class='center' type='image' 
461         src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
462       $actions.= "<input class='center' type='image' 
463         src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
464       $actions.= "<input class='center' type='image' 
465         src='images/edit.png' alt='"._("edit")."' name='appl_edit_%KEY%' title='"._("Edit this entry")."'>";
466       $actions.= "<input class='center' type='image' 
467         src='images/edittrash.png' alt='"._("delete")."' name='appl_del_%KEY%' title='"._("Delete this entry")."'>";
468     }else{
470       $actions = "<input class='center' type='image' 
471         src='images/edit.png' alt='"._("edit")."' name='appl_edit_%KEY%' title='"._("Edit this entry")."'>";
472       $actions.= "<input class='center' type='image' 
473         src='images/edittrash.png' alt='"._("delete")."' name='appl_del_%KEY%' title='"._("Delete this entry")."'>";
474     }
477     // Defining Links
478     $linkopen = "<a href='?plug=".$_GET['plug']."&amp;act=dep_open&amp;dep_id=%s'>%s</a>";
480     // image Buttons
481     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
482     $userimg  = "<img class='center' src='images/select_groups.png' alt='User'    title='%s'>";
484     // Extension images
485     $applimg  = "<img class='center' src='images/select_application.png' alt='A'  title='"._("Application")."'>";
487     // Space
488     $empty    = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt=''>";
491     $divlist = new divlist("applicationtabs");
492     $divlist->SetHeader(array(
493           array("string" => "&nbsp;", "attach" => "style='text-align:center;width:20px;'"),
494           array("string" => _("Application name")." / "._("Department"), "attach" => "style=''"),
495           array("string" => _("Actions"), "attach" => "style='width:80px;border-right:0px;text-align:right;'")
496           ));
499     $divlist->SetSummary(_("This table displays all groups, in the selected tree."));
500     $divlist->SetEntriesPerPage(0);
502     foreach($this->departments as $key=> $val){
504       if(!isset($this->config->departments[trim($key)])){
505         $this->config->departments[trim($key)]="";
506       }
508       $non_empty="";
509       $keys= str_replace("/","\/",$key);
510       foreach($this->config->departments as $keyd=>$vald ){
511         if(preg_match("/".$keys."\/.*/",$keyd)){
512           $non_empty="full";
513         }
514       }
516       $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
517       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
518       $field3 = array("string" => "&nbsp;", "attach" => "style='width:80px;border-right:0px;text-align:right;'");
520       $divlist->AddEntry(array($field1,$field2,$field3));
521     }
523     foreach($this->applications as $key => $val){
524       $title = "title='dn:&nbsp;".@LDAP::fix($val['dn'])."'";
526       if(!isset($val['description'][0])){
527         $desc = "";
528       }else{
529         $desc = " - [ ".$val['description'][0]." ]";
530       }
531       $field1 = array("string" => sprintf($applimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
532       $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title);
533       $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:80px;border-right:0px;text-align:right;'");
535       $divlist->AddEntry(array($field1,$field2,$field3));
536     }
538     $smarty->assign("applicationshead", $listhead);
539     $smarty->assign("applications", $divlist->DrawList());
540     $smarty->assign("search_image", get_template_path('images/search.png'));
541     $smarty->assign("tree_image", get_template_path('images/tree.png'));
542     $smarty->assign("infoimage", get_template_path('images/info.png'));
543     $smarty->assign("launchimage", get_template_path('images/launch.png'));
544     $smarty->assign("releaseimage"   , get_template_path('images/branch.png'));
545     $smarty->assign("deplist", $this->config->idepartments);
546     $smarty->assign("regex", $appfilter['regex']);
548     if($this->enableReleaseManagement){
549       $smarty->assign("releases",     $this->Releases );
550       $smarty->assign("releaseKeys",   array_flip($this->Releases));
551       $smarty->assign("select_release",$this->Release);
552     }
554     $smarty->assign("enableReleaseManagement",$this->enableReleaseManagement);
556     /* Extend if we are not using javascript */
557     $smarty->assign("apply", apply_filter());
558     $smarty->assign("alphabet", generate_alphabet());
559     $smarty->assign("hint", print_sizelimit_warning());
561     return($smarty->fetch(get_template_path('headpage.tpl', TRUE)));
562   }
565   function reload()
566   {
567     /* Get config */
568     $appfilter= get_global('appfilter');
570     /* Set base for all searches */
571     $base= $this->Release;
572     
573     /* Regex filter? */
574     if ($appfilter['regex'] != ""){
575       $regex= $appfilter['regex'];
576     } else {
577       $regex= "*";
578     }
580     /* Generate application list */
581     //FIXME: No GL_SIZELIMIT?
582     $res= get_list("(&(cn=$regex)(objectClass=gosaApplication))", $this->ui->subtreeACL,
583                    $base, array("*"), GL_NONE);
584     $this->applications= array();
585     foreach ($res as $value){
586       $this->applications[]= $value;
587     }
588     reset ($this->applications);
592     /* NEW LIST MANAGMENT
593      * We also need to search for the departments
594      * So we are able to navigate like in konquerer
595      */
596     $peopleOU = get_people_ou();
597     $base2 = $_SESSION['CurrentMainBase'];
599     /* Get all departments within this subtree */
600     $deps= get_list("(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", $this->ui->subtreeACL,
601         $base2, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT);
603     $this->departments = array();
604     foreach($deps as $value){
605       if(isset($value['description'][0])){
606         $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]";
607       }else{
608         $this->departments[$value['dn']]= get_sub_department($value['dn']);
609       }
610     }
611     natcasesort($this->departments);
612     /* END NEW LIST MANAGMENT
613      */
615     $tmp=array();
616     foreach($this->applications as $tkey => $val ){
617       $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
618     }
619     ksort($tmp);
620     $this->applications=array();
621     foreach($tmp as $val){
622       $this->applications[]=$val;
623     }
624     reset ($this->applications);
627   }
629   function remove_from_parent()
630   {
631     /* Optionally execute a command after we're done */
632     $this->postremove();
633   }
636   function copyPasteHandling($s_action,$s_entry)
637   {
638     /* Paste copied/cutted object in here
639      */
640     echo "jo";
641     if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
642       $this->CopyPasteHandler->save_object();
643       $this->CopyPasteHandler->SetVar("base", $_SESSION['CurrentMainBase']);
645       if($str = $this->CopyPasteHandler->execute()) {
646         return($str);
647       }
648     }
650     /* Copy current object to CopyHandler
651      */
652     if($s_action == "copy"){
653       $this->CopyPasteHandler->Clear();
654       $dn = $this->applications[$s_entry]['dn'];
655       $obj    = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn);
656       $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new");
657       $this->CopyPasteHandler->Copy($obj,$objNew);
658     }
660     /* Copy current object to CopyHandler
661      */
662     if($s_action == "cut"){
663       $this->CopyPasteHandler->Clear();
664       $dn = $this->applications[$s_entry]['dn'];
665       $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn);
666       $this->CopyPasteHandler->Cut($obj);
667     }
668   }
670   /* Save data to object */
671   function save_object()
672   {
673   }
676   /* Check values */
677   function check()
678   {
679   }
682   /* Save to LDAP */
683   function save()
684   {
685     /* Optionally execute a command after we're done */
686     $this->postcreate();
687   }
689   function adapt_from_template($dn)
690   {
691   }
693   function password_change_needed()
694   {
695   }
697   function show_header($button_text, $text, $disabled= FALSE)
698   {
699   }
701   function remove_lock()
702   {
703     if (isset($this->apptabs->dn)){
704       del_lock ($this->apptabs->dn);
705     }
706   }
709 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
710 ?>