5074c325f97ea9c41dc0c1b80cff5ba80e785629
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 */
21 class mimetypeManagement extends plugin
22 {
23 /* Definitions */
24 var $plHeadline = "Mime types";
25 var $plDescription = "Manage mime types";
26 var $plIcon = "plugins/goto/images/mimetypes.png";
28 /* Dialog attributes */
29 var $ui = NULL;
30 var $DivListMimeTypes = NULL;
31 var $mimetabs = NULL;
32 var $snapDialog = NULL;
33 var $CopyPasteHandler = NULL;
34 var $start_pasting_copied_objects = FALSE;
35 var $enableReleaseManagement = false;
37 var $acl_base = "";
38 var $mime_base = "";
39 var $mime_release = "";
41 var $acl_module = array("mimetypes");
43 function IsReleaseManagementActivated()
44 {
45 /* Check if we should enable the release selection */
46 $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
47 if(!empty($tmp)){
48 return(true);
49 }
50 return(false);
51 }
54 function mimetypeManagement (&$config, &$ui)
55 {
56 /* Save configuration for internal use */
57 $this->config = &$config;
58 $this->ui = &$ui;
60 /* Check if copy & paste is activated */
61 if($this->config->get_cfg_value("copyPaste")){
62 $this->CopyPasteHandler = new CopyPasteHandler($this->config);
63 }
65 /* Creat dialog object */
66 $this->DivListMimeTypes = new divListMimeTypes($this->config,$this);
68 if($this->IsReleaseManagementActivated()){
70 /* Check if we should enable the release selection */
71 $this->enableReleaseManagement = true;
73 /* Hide SubSearch checkbox */
74 $this->DivListMimeTypes->DisableCheckBox("SubSearch");
75 }
77 /* Set default release */
78 if(!$this->IsReleaseManagementActivated()){
79 $this->mime_base = get_ou("mimetypeRDN").$this->config->current['BASE'];
80 $this->acl_base = $this->config->current['BASE'];
81 if(!session::is_set("mime_filter")){
83 /* Set intial release */
84 $rel = $config->search("faiManagement","DEFAULTFAIRELEASE",array("menu"));
85 if(empty($rel)){
86 $rel = $this->mime_base;
87 }
88 session::set("mime_filter",array("mime_base" => $rel));
89 }
90 $mime_filter = session::get("mime_filter");
91 $this->mime_base = $mime_filter['mime_base'];
92 }else{
93 $this->mime_base = get_ou("mimetypeRDN").$this->config->current['BASE'];
94 $this->acl_base = &$this->DivListMimeTypes->selectedBase;
96 /* Set intial release */
97 $rel = $config->search("faiManagement","DEFAULTFAIRELEASE",array("menu"));
98 $rels = array_flip($this->getReleases());
99 if(isset($rels[$rel])){
100 $rel = $rels[$rel];
101 }else{
102 $rel = $this->mime_base;
103 }
105 if(!session::is_set("mime_filter")){
106 session::set("mime_filter",array("mime_base" => $this->mime_base,"mime_release" => $rel));
107 }
108 $mime_filter = session::get("mime_filter");
109 $this->mime_base = $mime_filter['mime_base'];
110 $this->mime_release = $mime_filter['mime_release'];
111 }
112 }
115 /* Get all releases */
116 function getReleases()
117 {
118 $ldap = $this->config->get_ldap_link();
119 $ret = array();
120 $ret [$this->mime_base] = "/";
122 $ldap->cd($this->mime_base);
123 $ldap->search("(&(objectClass=FAIbranch)(objectClass=organizationalUnit))",array("ou"));
125 while($attrs = $ldap->fetch()){
126 $str = str_replace($this->mime_base,"",$attrs['dn']);
127 $tmp = array_reverse( split("ou=",$str));
128 $str = "";
129 foreach($tmp as $val){
130 $val = trim(preg_replace("/,/","",$val));
131 if(empty($val)) break;
132 $str .= "/".$val;
133 }
134 if(!empty($str)){
135 $ret[$attrs['dn']]= preg_replace("/^\//","",$str);
136 }
137 }
138 asort($ret);
139 return($ret);
140 }
143 function execute()
144 {
145 /* Call parent execute */
146 plugin::execute();
149 /****************
150 Variable init
151 ****************/
153 /* These vars will be stored if you try to open a locked mime,
154 to be able to perform your last requests after showing a warning message */
155 session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^mime_edit_/","/^mime_del_/",
156 "/^item_selected/","/^remove_multiple_mimetypes/","/^menu_action/"));
158 $smarty = get_smarty(); // Smarty instance
159 $s_action = ""; // Contains the action to proceed
160 $s_entry = ""; // The value for s_action
161 $base_back = ""; // The Link for Backbutton
163 /* Test Posts */
164 foreach($_POST as $key => $val){
165 // Post for delete
166 if(preg_match("/mime_del.*/",$key)){
167 $s_action = "del";
168 $s_entry = preg_replace("/mime_".$s_action."_/i","",$key);
169 // Post for edit
170 }elseif(preg_match("/mime_edit_.*/",$key)){
171 $s_action="edit";
172 $s_entry = preg_replace("/mime_".$s_action."_/i","",$key);
173 // Post for new
174 }elseif(preg_match("/^copy_.*/",$key)){
175 $s_action="copy";
176 $s_entry = preg_replace("/^copy_/i","",$key);
177 }elseif(preg_match("/^cut_.*/",$key)){
178 $s_action="cut";
179 $s_entry = preg_replace("/^cut_/i","",$key);
180 // Post for new
181 }elseif(preg_match("/^mime_new.*/",$key)){
182 $s_action="new";
183 }elseif(preg_match("/^remove_multiple_mimetypes/",$key)){
184 $s_action="del_multiple";
185 }elseif(preg_match("/^editPaste.*/i",$key)){
186 $s_action="editPaste";
187 }elseif(preg_match("/^multiple_copy_mimetypes/",$key)){
188 $s_action = "copy_multiple";
189 }elseif(preg_match("/^multiple_cut_mimetypes/",$key)){
190 $s_action = "cut_multiple";
191 }
192 }
194 if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){
195 $s_action ="edit";
196 $s_entry = $_GET['id'];
197 }
199 $s_entry = preg_replace("/_.$/","",$s_entry);
201 /* handle C&P from layers menu */
202 if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){
203 $s_action = "copy_multiple";
204 }
205 if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){
206 $s_action = "cut_multiple";
207 }
208 if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){
209 $s_action = "editPaste";
210 }
212 /* Create options */
213 if(isset($_POST['menu_action']) && $_POST['menu_action'] == "mime_new"){
214 $s_action = "new";
215 }
217 /* handle remove from layers menu */
218 if(isset($_POST['menu_action']) && preg_match("/^remove_multiple/",$_POST['menu_action'])){
219 $s_action = "del_multiple";
220 }
223 /****************
224 Copy & Paste handling
225 ****************/
227 /* Display the copy & paste dialog, if it is currently open */
228 $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
229 if($ret){
230 return($ret);
231 }
234 /****************
235 Create a new mime type
236 ****************/
238 /* New mime type? */
239 $ui = get_userinfo();
240 $acl = $ui->get_permissions($this->acl_base,"mimetypes/mimetype");
241 if (($s_action=="new") && preg_match("/c/",$acl)){
243 /* By default we set 'dn' to 'new', all relevant plugins will
244 react on this. */
245 $this->dn= "new";
247 /* Create new usertab object */
248 $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
249 $this->mimetabs->parent = &$this;
250 $this->mimetabs->set_acl_base($this->acl_base);
251 }
254 /****************
255 Edit entry canceled
256 ****************/
258 /* Cancel dialogs */
259 if (isset($_POST['edit_cancel'])){
260 $this->remove_lock();
261 $this->mimetabs= NULL;
262 set_object_info();
263 }
266 /****************
267 Edit entry finished
268 ****************/
270 /* Finish mime edit is triggered by the tabulator dialog, so
271 the user wants to save edited data. Check and save at this point. */
272 if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply']) ) && (isset($this->mimetabs->config))){
274 /* Check tabs, will feed message array */
275 $this->mimetabs->save_object();
276 $message= $this->mimetabs->check();
278 /* Save, or display error message? */
279 if (count($message) == 0){
281 /* Save data data to ldap */
282 $this->mimetabs->save();
284 if (!isset($_POST['edit_apply'])){
285 /* Mime type has been saved successfully, remove lock from LDAP. */
286 if ($this->dn != "new"){
287 $this->remove_lock();
288 }
289 unset ($this->mimetabs);
290 $this->mimetabs= NULL;
291 set_object_info();
292 }else{
294 /* Reinitialize tab */
295 if($this->mimetabs instanceof tabs){
296 $this->mimetabs->re_init();
297 }
298 }
299 } else {
300 /* Ok. There seem to be errors regarding to the tab data,
301 show message and continue as usual. */
302 msg_dialog::displayChecks($message);
303 }
304 }
307 /****************
308 Edit entry
309 ****************/
311 /* User wants to edit data? */
312 if (($s_action=="edit") && (!isset($this->mimetabs->config))){
314 /* Get 'dn' from posted 'mimelist', must be unique */
315 $this->dn= $this->mimetypes[$s_entry]['dn'];
317 /* Check locking, save current plugin in 'back_plugin', so
318 the dialog knows where to return. */
319 if (($user= get_lock($this->dn)) != ""){
320 return(gen_locked_message ($user, $this->dn,TRUE));
321 }
323 /* Lock the current entry, so everyone will get the
324 above dialog */
325 add_lock ($this->dn, $this->ui->dn);
327 /* Register mimetabs to trigger edit dialog */
328 $this->mimetabs= new mimetabs($this->config,$this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
329 if($this->IsReleaseManagementActivated()){
330 $this->mimetabs->set_FAIstate($this->mimetypes[$s_entry]['FAIstate'][0]);
331 }
332 $this->mimetabs->parent = &$this;
333 $this->mimetabs->set_acl_base($this->dn);
334 set_object_info($this->dn);
335 }
338 /********************
339 Delete MULTIPLE entries requested, display confirm dialog
340 ********************/
342 if ($s_action=="del_multiple"){
343 $ids = $this->list_get_selected_items();
345 $this->dns = array();
346 if(count($ids)){
348 $disallowed = array();
349 foreach($ids as $id){
350 $dn = $this->mimetypes[$id]['dn'];
351 $acl = $this->ui->get_permissions($dn, "mimetypes/mimetype");
352 if(preg_match("/d/",$acl)){
353 $this->dns[$id] = $dn;
354 }else{
355 $disallowed[] = $dn;
356 }
357 }
359 if(count($disallowed)){
360 msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG);
361 }
363 if(count($this->dns)){
365 /* Check locks */
366 if ($user= get_multiple_locks($this->dns)){
367 return(gen_locked_message($user,$this->dns));
368 }
370 $dns_names = array();
371 foreach($this->dns as $dn){
372 $dns_names[] = LDAP::fix($dn);
373 }
375 add_lock ($this->dns, $this->ui->dn);
377 /* Lock the current entry, so nobody will edit it during deletion */
378 $smarty->assign("info", msgPool::deleteInfo($dns_names,_("Mime type")));
379 $smarty->assign("multiple", true);
380 return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
381 }
382 }
383 }
386 /********************
387 Delete MULTIPLE entries confirmed
388 ********************/
390 /* Confirmation for deletion has been passed. Users should be deleted. */
391 if (isset($_POST['delete_multiple_mimetype_confirm'])){
393 $ui = get_userinfo();
395 /* Remove user by user and check acls before removeing them */
396 foreach($this->dns as $key => $dn){
398 $acl = $ui->get_permissions($dn,"mimetypes/mimetype");
399 if(preg_match("/d/",$acl)){
401 /* Delete request is permitted, perform LDAP action */
402 $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes");
403 $this->mimetabs->parent = &$this;
404 $this->mimetabs->set_acl_base($dn);
405 $this->mimetabs->delete ();
406 unset ($this->mimetabs);
407 $this->mimetabs= NULL;
409 } else {
410 /* Normally this shouldn't be reached, send some extra
411 logs to notify the administrator */
412 msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
413 new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion.");
414 }
415 }
417 /* Remove lock file after successfull deletion */
418 $this->remove_lock();
419 $this->dns = array();
420 }
423 /********************
424 Delete MULTIPLE entries Canceled
425 ********************/
427 /* Remove lock */
428 if(isset($_POST['delete_multiple_mimetype_cancel'])){
429 $this->remove_lock();
430 $this->dns = array();
431 }
434 /****************
435 Delete mime type
436 ****************/
438 /* Remove user was requested */
439 if ($s_action == "del"){
441 /* Get 'dn' from posted 'uid' */
442 $this->dn= $this->mimetypes[$s_entry]['dn'];
444 /* Load permissions for selected 'dn' and check if
445 we're allowed to remove this 'dn' */
446 $ui = get_userinfo();
447 $acl = $ui->get_permissions($this->dn,"mimetypes/mimetype");
448 if (preg_match("/d/",$acl)){
450 /* Check locking, save current plugin in 'back_plugin', so
451 the dialog knows where to return. */
452 if (($user= get_lock($this->dn)) != ""){
453 return (gen_locked_message ($user, $this->dn));
454 }
456 /* Lock the current entry, so nobody will edit it during deletion */
457 add_lock ($this->dn, $this->ui->dn);
458 $smarty= get_smarty();
459 $smarty->assign("info", msgPool::deleteInfo(LDAP::fix($this->dn),_("Mime type")));
460 $smarty->assign("multiple", false);
461 return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
462 } else {
464 /* Obviously the user isn't allowed to delete. Show message and
465 clean session. */
466 msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
467 }
468 }
471 /****************
472 Delete mime confirmed
473 ****************/
475 /* Confirmation for deletion has been passed. Group should be deleted. */
476 if (isset($_POST['delete_mime_confirm'])){
478 /* Some nice guy may send this as POST, so we've to check
479 for the permissions again. */
480 $ui = get_userinfo();
481 $acl = $ui->get_permissions($this->dn,"mimetypes/mimetype");
482 if(preg_match("/d/",$acl)){
484 /* Delete request is permitted, perform LDAP action */
485 $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
486 $this->mimetabs->parent = &$this;
487 $this->mimetabs->set_acl_base($this->dn);
488 $this->mimetabs->delete ();
489 unset ($this->mimetabs);
490 $this->mimetabs= NULL;
492 } else {
494 /* Normally this shouldn't be reached, send some extra
495 logs to notify the administrator */
496 msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
497 new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion.");
498 }
500 /* Remove lock file after successfull deletion */
501 $this->remove_lock();
502 }
505 /****************
506 Delete mime canceled
507 ****************/
509 /* Delete mime type canceled? */
510 if (isset($_POST['delete_cancel'])){
511 $this->remove_lock();
512 set_object_info();
513 }
515 /* Show tab dialog if object is present */
516 if (($this->mimetabs) && (isset($this->mimetabs->config))){
517 $display= $this->mimetabs->execute();
519 /* Don't show buttons if tab dialog requests this */
521 if(($this->mimetabs instanceOf tabs || $this->mimetabs instanceOf plugin) && $this->mimetabs->read_only == TRUE){
522 $display.= "<p style=\"text-align:right\">
523 <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
524 </p>";
525 }elseif (!$this->mimetabs->by_object[$this->mimetabs->current]->dialog){
526 $display.= "<p style=\"text-align:right\">\n";
528 if(isset($this->mimetabs->FAIstate) && !preg_match("/freeze/i",$this->mimetabs->FAIstate)){
529 $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
530 $display.= " \n";
531 if ($this->dn != "new"){
532 $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
533 $display.= " \n";
534 }
535 }
537 $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
538 $display.= "</p>";
539 }
540 return ($display);
541 }
544 /****************
545 Dialog display
546 ****************/
548 /* Check if there is a snapshot dialog open */
549 if($this->IsReleaseManagementActivated()){
550 $base = $this->mime_release;
551 }else{
552 $base = $this->mime_base;
553 }
554 if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
555 return($str);
556 }
558 /* Display dialog with system list */
559 $this->DivListMimeTypes->parent = $this;
560 $this->DivListMimeTypes->execute();
561 if(!$this->IsReleaseManagementActivated()){
562 $this->DivListMimeTypes->AddDepartments($this->DivListMimeTypes->selectedBase,3,1);
563 }
564 $this->reload();
565 $this->DivListMimeTypes->setEntries($this->mimetypes);
566 return($this->DivListMimeTypes->Draw());
567 }
570 /* Return departments, that will be included within snapshot detection */
571 function get_used_snapshot_bases()
572 {
573 if($this->IsReleaseManagementActivated()){
574 return(array($this->mime_release));
575 }else{
576 return(array($this->mime_base));
577 }
578 }
581 function reload()
582 {
583 $this->mimetypes= array();
585 /* Set base for all searches */
586 $base = $this->mime_base;
587 $Regex = $this->DivListMimeTypes->Regex;
588 $SubSearch = $this->DivListMimeTypes->SubSearch;
589 $Flags = GL_NONE | GL_SIZELIMIT;
590 $Filter = "(&(|(cn=".$Regex.")(description=".$Regex."))(objectClass=gotoMimeType))";
591 $tmp = array();
593 if(!$this->IsReleaseManagementActivated()){
594 $use_base = $this->mime_base;
595 if($SubSearch){
596 $use_base = preg_replace("/^".preg_quote(get_ou("mimeou"), '/')."/i","",$use_base);
597 }
598 }else{
599 $use_base = $this->mime_release;
600 $SubSearch= FALSE;
601 }
603 /* Add FAIstate to the search attributes */
604 $search_attrs = array("cn","description","dn","objectClass");
605 if($this->IsReleaseManagementActivated()) {
606 $search_attrs[] = "FAIstate";
607 }
609 if($SubSearch){
610 $res= get_sub_list($Filter, "mimetypes",get_ou("mimeou"), $use_base, $search_attrs, $Flags);
611 }else{
612 $res= get_list($Filter, "mimetypes",$use_base, $search_attrs, $Flags);
613 }
616 $tmp2 = array();
617 foreach ($res as $val){
618 if(!isset($val['FAIstate'])){
619 $val['FAIstate'][0] = "";
620 }
621 $tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
622 $tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
623 }
625 /* sort entries */
626 natcasesort($tmp2);
627 $this->mimetypes=array();
628 foreach($tmp2 as $val){
629 $this->mimetypes[]=$tmp[$val];
630 }
631 reset ($this->mimetypes);
632 }
635 function remove_from_parent()
636 {
637 /* Optionally execute a command after we're done */
638 $this->postremove();
639 }
642 function copyPasteHandling_from_queue($s_action,$s_entry)
643 {
644 /* Check if Copy & Paste is disabled */
645 if(!is_object($this->CopyPasteHandler)){
646 return("");
647 }
649 $ui = get_userinfo();
651 /* Add a single entry to queue */
652 if($s_action == "cut" || $s_action == "copy"){
654 /* Cleanup object queue */
655 $this->CopyPasteHandler->cleanup_queue();
656 $dn = $this->mimetypes[$s_entry]['dn'];
657 if($s_action == "copy" && $ui->is_copyable($dn,"mimetypes","mimetype")){
658 $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
659 }
660 if($s_action == "cut" && $ui->is_cutable($dn,"mimetypes","mimetype")){
661 $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
662 }
663 }
665 /* Add entries to queue */
666 if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
668 /* Cleanup object queue */
669 $this->CopyPasteHandler->cleanup_queue();
671 /* Add new entries to CP queue */
672 foreach($this->list_get_selected_items() as $id){
673 $dn = $this->mimetypes[$id]['dn'];
675 if($s_action == "copy_multiple" && $ui->is_copyable($dn,"mimetypes","mimetype")){
676 $this->CopyPasteHandler->add_to_queue($dn,"copy","mimetabs","MIMETABS","mimetypes");
677 }
678 if($s_action == "cut_multiple" && $ui->is_cutable($dn,"mimetypes","mimetype")){
679 $this->CopyPasteHandler->add_to_queue($dn,"cut","mimetabs","MIMETABS","mimetypes");
680 }
681 }
682 }
684 /* Start pasting entries */
685 if($s_action == "editPaste"){
686 $this->start_pasting_copied_objects = TRUE;
687 }
689 /* Return C&P dialog */
690 if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
692 /* Get dialog */
693 $this->CopyPasteHandler->SetVar("base",preg_replace("/^".preg_quote(get_ou("mimetypeRDN"), '/')."/i","",$this->mime_base));
694 $this->CopyPasteHandler->SetVar("parent",$this);
695 $data = $this->CopyPasteHandler->execute();
697 /* Return dialog data */
698 if(!empty($data)){
699 return($data);
700 }
701 }
703 /* Automatically disable status for pasting */
704 if(!$this->CopyPasteHandler->entries_queued()){
705 $this->start_pasting_copied_objects = FALSE;
706 }
707 return("");
708 }
711 function list_get_selected_items()
712 {
713 $ids = array();
714 foreach($_POST as $name => $value){
715 if(preg_match("/^item_selected_[0-9]*$/",$name)){
716 $id = preg_replace("/^item_selected_/","",$name);
717 $ids[$id] = $id;
718 }
719 }
720 return($ids);
721 }
724 /* Save to LDAP */
725 function save()
726 {
727 /* Optionally execute a command after we're done */
728 $this->postcreate();
729 }
731 function remove_lock()
732 {
733 if (isset($this->mimetabs->dn)){
734 del_lock ($this->mimetabs->dn);
735 }elseif(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
736 del_lock($this->dn);
737 }
738 if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
739 del_lock($this->dns);
740 }
741 }
743 function save_object()
744 {
745 $this->DivListMimeTypes->save_object();
746 if(is_object($this->CopyPasteHandler)){
747 $this->CopyPasteHandler->save_object();
748 }
750 if($this->IsReleaseManagementActivated() && isset($_POST['mime_release'])){
751 $sel_rel = get_post('mime_release');
752 $releases = array_flip($this->getReleases());
753 if(isset($releases[$sel_rel])){
754 $this->mime_release = $releases[$sel_rel];
755 }
756 $mime_filter = session::get("mime_filter");
757 $mime_filter['mime_release'] = $this->mime_release;
758 session::set("mime_filter",$mime_filter);
759 }elseif(!$this->IsReleaseManagementActivated()){
760 $this->mime_base = get_ou("mimetypeRDN").$this->DivListMimeTypes->selectedBase;
761 $mime_filter = session::get("mime_filter");
762 $mime_filter['mime_base'] = $this->mime_base;
763 session::set("mime_filter",$mime_filter);
764 }
765 }
768 function check() {}
769 function adapt_from_template($dn, $skip= array()) {}
770 function password_change_needed() {}
771 }
772 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
773 ?>