Code

Updated hot plug ACLs.
[gosa.git] / gosa-plugins / goto / admin / mimetypes / class_mimetypeManagement.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  */
21 class mimetypeManagement extends plugin
22 {
23   /* Definitions */
24   var $plHeadline     = "Mime types";
25   var $plDescription  = "Manage mime types";
27   /* Dialog attributes */
28   var $ui                             = NULL;
29   var $DivListMimeTypes               = NULL;
30   var $mimetabs                       = NULL;
31   var $snapDialog                     = NULL;
32   var $CopyPasteHandler               = NULL;
33   var $start_pasting_copied_objects   = FALSE;
34   var $enableReleaseManagement        = false;
36   var $mime_base    = "";
37   var $mime_release = "";
39   var $acl_module = array("mimetypes");
41   function IsReleaseManagementActivated()
42   {
43     /* Check if we should enable the release selection */
44     $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
45     if(!empty($tmp)){
46       return(true);
47     }
48     return(false);
49   }
52   function mimetypeManagement (&$config, &$ui)
53   {
54     /* Save configuration for internal use */
55     $this->config   = &$config;
56     $this->ui       = &$ui;
58     /* Check if copy & paste is activated */
59     if($this->config->boolValueIsTrue("MAIN","ENABLECOPYPASTE")){
60       $this->CopyPasteHandler = new CopyPasteHandler($this->config);
61     }
63     /* Creat dialog object */
64     $this->DivListMimeTypes = new divListMimeTypes($this->config,$this);
66     if($this->IsReleaseManagementActivated()){
68       /* Check if we should enable the release selection */
69       $this->enableReleaseManagement = true;
71       /* Hide SubSearch checkbox */
72       $this->DivListMimeTypes->DisableCheckBox("SubSearch");
73     }
75     /* Set default release */
76     if(!$this->IsReleaseManagementActivated()){
77       $this->mime_base = get_ou("mimetypeou").$this->config->current['BASE'];
78       if(!session::is_set("mime_filter")){
79         session::set("mime_filter",array("mime_base" => $this->mime_base));
80       }
81       $mime_filter     = session::get("mime_filter");
82       $this->mime_base = $mime_filter['mime_base'];
83     }else{
84       $this->mime_base = get_ou("mimetypeou").$this->config->current['BASE'];
85       if(!session::is_set("mime_filter")){
86         session::set("mime_filter",array("mime_base" => $this->mime_base,"mime_release" => $this->mime_base));
87       }
88       $mime_filter         = session::get("mime_filter");
89       $this->mime_base     = $mime_filter['mime_base'];
90       $this->mime_release  = $mime_filter['mime_release'];
91     }
92   }
95   /* Get all releases */
96   function getReleases()
97   {
98     $ldap                   = $this->config->get_ldap_link();
99     $ret                    = array();
100     $ret [$this->mime_base] = "/";    
102     $ldap->cd($this->mime_base);
103     $ldap->search("(&(objectClass=FAIbranch)(objectClass=organizationalUnit))",array("ou"));
105     while($attrs = $ldap->fetch()){
106       $str = str_replace($this->mime_base,"",$attrs['dn']);
107       $tmp = array_reverse( split("ou=",$str));
108       $str = "";
109       foreach($tmp as $val){
110         $val = trim(preg_replace("/,/","",$val));
111         if(empty($val)) break;
112         $str .= "/".$val;
113       } 
114       if(!empty($str)){
115         $ret[$attrs['dn']]= preg_replace("/^\//","",$str);
116       }
117     }
118     asort($ret);
119     return($ret);
120   }
123   function execute()
124   {
125     /* Call parent execute */
126     plugin::execute();
129     /**************** 
130       Variable init 
131      ****************/
133     /* These vars will be stored if you try to open a locked mime, 
134         to be able to perform your last requests after showing a warning message */
135     session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^mime_edit_/","/^mime_del_/",
136           "/^item_selected/","/^remove_multiple_mimetypes/","/^menu_action/"));
138     $smarty       = get_smarty();             // Smarty instance
139     $s_action     = "";                       // Contains the action to proceed
140     $s_entry      = "";                       // The value for s_action
141     $base_back    = "";                       // The Link for Backbutton
142     
143     /* Test Posts */
144     foreach($_POST as $key => $val){
145       // Post for delete
146       if(preg_match("/mime_del.*/",$key)){
147         $s_action = "del";
148         $s_entry  = preg_replace("/mime_".$s_action."_/i","",$key);
149         // Post for edit
150       }elseif(preg_match("/mime_edit_.*/",$key)){
151         $s_action="edit";
152         $s_entry  = preg_replace("/mime_".$s_action."_/i","",$key);
153         // Post for new
154       }elseif(preg_match("/^copy_.*/",$key)){
155         $s_action="copy";
156         $s_entry  = preg_replace("/^copy_/i","",$key);
157       }elseif(preg_match("/^cut_.*/",$key)){
158         $s_action="cut";
159         $s_entry  = preg_replace("/^cut_/i","",$key);
160         // Post for new
161       }elseif(preg_match("/^mime_new.*/",$key)){
162         $s_action="new";
163       }elseif(preg_match("/^remove_multiple_mimetypes/",$key)){
164         $s_action="del_multiple";
165       }elseif(preg_match("/^editPaste.*/i",$key)){
166         $s_action="editPaste";
167       }elseif(preg_match("/^multiple_copy_mimetypes/",$key)){
168         $s_action = "copy_multiple";
169       }elseif(preg_match("/^multiple_cut_mimetypes/",$key)){
170         $s_action = "cut_multiple";
171       }
172     }
174     if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){
175       $s_action ="edit";
176       $s_entry  = $_GET['id'];
177     }
179     $s_entry  = preg_replace("/_.$/","",$s_entry);
181     /* handle C&P from layers menu */
182     if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){
183       $s_action = "copy_multiple";
184     }
185     if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){
186       $s_action = "cut_multiple";
187     }
188     if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){
189       $s_action = "editPaste";
190     }
192     /* Create options */
193     if(isset($_POST['menu_action']) && $_POST['menu_action'] == "mime_new"){
194       $s_action = "new";
195     }
197     /* handle remove from layers menu */
198     if(isset($_POST['menu_action']) && preg_match("/^remove_multiple/",$_POST['menu_action'])){
199       $s_action = "del_multiple";
200     }
203     /**************** 
204       Copy & Paste handling  
205      ****************/
207     /* Display the copy & paste dialog, if it is currently open */
208     $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
209     if($ret){
210       return($ret);
211     }
214     /**************** 
215       Create a new mime type 
216      ****************/
218     /* New mime type? */
219     $ui = get_userinfo();
220     $acl = $ui->get_permissions($this->mime_base,"mimetypes/mimetype");
221     if (($s_action=="new") && preg_match("/c/",$acl)){
223       /* By default we set 'dn' to 'new', all relevant plugins will
224          react on this. */
225       $this->dn= "new";
227       /* Create new usertab object */
228       $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
229       $this->mimetabs->parent = &$this;
230       $this->mimetabs->set_acl_base($this->mime_base);
231     }   
234     /**************** 
235       Edit entry canceled 
236      ****************/
238     /* Cancel dialogs */
239     if (isset($_POST['edit_cancel'])){
240       $this->remove_lock();
241       $this->mimetabs= NULL;
242       session::un_set('objectinfo');
243     }
246     /**************** 
247       Edit entry finished 
248      ****************/
250     /* Finish mime edit is triggered by the tabulator dialog, so
251        the user wants to save edited data. Check and save at this point. */
252     if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply']) ) && (isset($this->mimetabs->config))){
254       /* Check tabs, will feed message array */
255       $this->mimetabs->save_object();
256       $message= $this->mimetabs->check();
258       /* Save, or display error message? */
259       if (count($message) == 0){
261         /* Save data data to ldap */
262         $this->mimetabs->save();
264         if (!isset($_POST['edit_apply'])){
265           /* Mime type has been saved successfully, remove lock from LDAP. */
266           if ($this->dn != "new"){
267             $this->remove_lock();
268           }
269           unset ($this->mimetabs);
270           $this->mimetabs= NULL;
271           session::un_set('objectinfo');
272         }else{
274           /* Reinitialize tab */
275           if($this->mimetabs instanceof tabs){
276             $this->mimetabs->re_init();
277           }
278         }
279       } else {
280         /* Ok. There seem to be errors regarding to the tab data,
281            show message and continue as usual. */
282         msg_dialog::displayChecks($message);
283       }
284     }
287     /**************** 
288       Edit entry  
289      ****************/
291     /* User wants to edit data? */
292     if (($s_action=="edit") && (!isset($this->mimetabs->config))){
294       /* Get 'dn' from posted 'mimelist', must be unique */
295       $this->dn= $this->mimetypes[$s_entry]['dn'];
297       /* Check locking, save current plugin in 'back_plugin', so
298          the dialog knows where to return. */
299       if (($user= get_lock($this->dn)) != ""){
300         return(gen_locked_message ($user, $this->dn));
301       }
303       /* Lock the current entry, so everyone will get the
304          above dialog */
305       add_lock ($this->dn, $this->ui->dn);
307       /* Register mimetabs to trigger edit dialog */
308       $this->mimetabs= new mimetabs($this->config,$this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
309       if($this->IsReleaseManagementActivated()){
310         $this->mimetabs->set_FAIstate($this->mimetypes[$s_entry]['FAIstate'][0]);
311       }
312       $this->mimetabs->parent = &$this;
313       $this->mimetabs->set_acl_base($this->dn);
314       session::set('objectinfo',$this->dn);
315     }
318     /********************
319       Delete MULTIPLE entries requested, display confirm dialog
320      ********************/
322     if ($s_action=="del_multiple"){
323       $ids = $this->list_get_selected_items();
325       $this->dns = array();
326       if(count($ids)){
328         $disallowed = array();
329         foreach($ids as $id){
330           $dn = $this->mimetypes[$id]['dn'];
331           $acl = $this->ui->get_permissions($dn, "mimetypes/mimetype");
332           if(preg_match("/d/",$acl)){
333             $this->dns[$id] = $dn;
334           }else{
335             $disallowed[] = $dn;
336           }
337         }
339         if(count($disallowed)){
340           msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG);
341         }
343         if(count($this->dns)){
345           /* Check locks */
346           if ($user= get_multiple_locks($this->dns)){
347             return(gen_locked_message($user,$this->dns));
348           }
350           $dns_names = array();
351           foreach($this->dns as $dn){
352             $dns_names[] = @LDAP::fix($dn);
353           }
355           add_lock ($this->dns, $this->ui->dn);
357           /* Lock the current entry, so nobody will edit it during deletion */
358           $smarty->assign("info", msgPool::deleteInfo($dns_names,_("Mime type")));
359           $smarty->assign("multiple", true);
360           return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
361         }
362       }
363     }
366     /********************
367       Delete MULTIPLE entries confirmed
368      ********************/
370     /* Confirmation for deletion has been passed. Users should be deleted. */
371     if (isset($_POST['delete_multiple_mimetype_confirm'])){
373       $ui = get_userinfo();
375       /* Remove user by user and check acls before removeing them */
376       foreach($this->dns as $key => $dn){
378         $acl = $ui->get_permissions($dn,"mimetypes/mimetype");
379         if(preg_match("/d/",$acl)){
381           /* Delete request is permitted, perform LDAP action */
382           $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes");
383           $this->mimetabs->parent = &$this;
384           $this->mimetabs->set_acl_base($dn);
385           $this->mimetabs->delete ();
386           unset ($this->mimetabs);
387           $this->mimetabs= NULL;
389         } else {
390           /* Normally this shouldn't be reached, send some extra
391              logs to notify the administrator */
392           msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
393           new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion.");
394         }
395       }
397       /* Remove lock file after successfull deletion */
398       $this->remove_lock();
399       $this->dns = array();
400     }
403     /********************
404       Delete MULTIPLE entries Canceled
405      ********************/
407     /* Remove lock */
408     if(isset($_POST['delete_multiple_mimetype_cancel'])){
409       $this->remove_lock();
410       $this->dns = array();
411     }
414     /**************** 
415       Delete mime type 
416      ****************/
418     /* Remove user was requested */
419     if ($s_action == "del"){
421       /* Get 'dn' from posted 'uid' */
422       $this->dn= $this->mimetypes[$s_entry]['dn'];
424       /* Load permissions for selected 'dn' and check if
425          we're allowed to remove this 'dn' */
426       $ui = get_userinfo();
427       $acl = $ui->get_permissions($this->dn,"mimetypes/mimetype");
428       if (preg_match("/d/",$acl)){
430         /* Check locking, save current plugin in 'back_plugin', so
431            the dialog knows where to return. */
432         if (($user= get_lock($this->dn)) != ""){
433           return (gen_locked_message ($user, $this->dn));
434         }
436         /* Lock the current entry, so nobody will edit it during deletion */
437         add_lock ($this->dn, $this->ui->dn);
438         $smarty= get_smarty();
439         $smarty->assign("info", msgPool::deleteInfo(@LDAP::fix($this->dn),_("Mime type")));
440         $smarty->assign("multiple", false);
441         return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
442       } else {
444         /* Obviously the user isn't allowed to delete. Show message and
445            clean session. */
446         msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
447       }
448     }
451     /**************** 
452       Delete mime confirmed 
453      ****************/
455     /* Confirmation for deletion has been passed. Group should be deleted. */
456     if (isset($_POST['delete_mime_confirm'])){
458       /* Some nice guy may send this as POST, so we've to check
459          for the permissions again. */
460       $ui = get_userinfo();
461       $acl = $ui->get_permissions($this->dn,"mimetypes/mimetype");
462       if(preg_match("/d/",$acl)){
464         /* Delete request is permitted, perform LDAP action */
465         $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes");
466         $this->mimetabs->parent = &$this;
467         $this->mimetabs->set_acl_base($this->dn);
468         $this->mimetabs->delete ();
469         unset ($this->mimetabs);
470         $this->mimetabs= NULL;
472       } else {
474         /* Normally this shouldn't be reached, send some extra
475            logs to notify the administrator */
476         msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
477         new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion.");
478       }
480       /* Remove lock file after successfull deletion */
481       $this->remove_lock();
482     }
485     /**************** 
486       Delete mime canceled 
487      ****************/
489     /* Delete mime type canceled? */
490     if (isset($_POST['delete_cancel'])){
491       $this->remove_lock();
492       session::un_set('objectinfo');
493     }
495     /* Show tab dialog if object is present */
496     if (($this->mimetabs) && (isset($this->mimetabs->config))){
497       $display= $this->mimetabs->execute();
499       /* Don't show buttons if tab dialog requests this */
500       if (!$this->mimetabs->by_object[$this->mimetabs->current]->dialog){
501         $display.= "<p style=\"text-align:right\">\n";
503         if(isset($this->mimetabs->FAIstate) && !preg_match("/freeze/i",$this->mimetabs->FAIstate)){
504           $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
505           $display.= "&nbsp;\n";
506           if ($this->dn != "new"){
507             $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
508             $display.= "&nbsp;\n";
509           }
510         }
511       
512         $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
513         $display.= "</p>";
514       }
515       return ($display);
516     }
519     /****************
520       Dialog display
521      ****************/
523     /* Check if there is a snapshot dialog open */
524     if($this->IsReleaseManagementActivated()){
525       $base = $this->mime_release;
526     }else{
527       $base = $this->mime_base;
528     }
529     if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
530       return($str);
531     }
533     /* Display dialog with system list */
534     $this->DivListMimeTypes->parent = $this;
535     $this->DivListMimeTypes->execute();
536     if(!$this->IsReleaseManagementActivated()){
537       $this->DivListMimeTypes->AddDepartments($this->DivListMimeTypes->selectedBase,3,1);
538     }
539     $this->reload();
540     $this->DivListMimeTypes->setEntries($this->mimetypes);
541     return($this->DivListMimeTypes->Draw());
542   }
544     
545   /* Return departments, that will be included within snapshot detection */
546   function get_used_snapshot_bases()
547   {
548     if($this->IsReleaseManagementActivated()){
549       return(array($this->mime_release));
550     }else{
551       return(array($this->mime_base));
552     }
553   }
556   function reload()
557   {
558     $this->mimetypes= array();
560     /* Set base for all searches */
561     $base       = $this->mime_base;
562     $Regex      = $this->DivListMimeTypes->Regex;
563     $SubSearch  = $this->DivListMimeTypes->SubSearch; 
564     $Flags      =  GL_NONE | GL_SIZELIMIT;
565     $Filter     = "(&(|(cn=".$Regex.")(description=".$Regex."))(objectClass=gotoMimeType))";
566     $tmp        = array();
568     if(!$this->IsReleaseManagementActivated()){
569       $use_base = $this->mime_base;
570       if($SubSearch){
571         $use_base = preg_replace("/^".normalizePreg(get_ou("mimeou"))."/","",$use_base);
572       }
573     }else{
574       $use_base = $this->mime_release;
575       $SubSearch= FALSE;
576     }
578     /* Add FAIstate to the search attributes */
579     $search_attrs = array("cn","description","dn","objectClass");
580     if($this->IsReleaseManagementActivated()) {
581       $search_attrs[] = "FAIstate";
582     }
584     if($SubSearch){
585       $res= get_sub_list($Filter, "mimetypes",get_ou("mimeou"), $use_base, $search_attrs, $Flags);
586     }else{
587       $res= get_list($Filter, "mimetypes",$use_base, $search_attrs, $Flags);
588     }
591     $tmp2 = array();
592     foreach ($res as $val){
593       if(!isset($val['FAIstate'])){
594         $val['FAIstate'][0] = "";
595       }
596       $tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
597       $tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
598     }
600     /* sort entries */
601     natcasesort($tmp2);
602     $this->mimetypes=array();
603     foreach($tmp2 as $val){
604       $this->mimetypes[]=$tmp[$val];
605     }
606     reset ($this->mimetypes);
607   }
610   function remove_from_parent()
611   {
612     /* Optionally execute a command after we're done */
613     $this->postremove();
614   }
617   function copyPasteHandling_from_queue($s_action,$s_entry)
618   {
619     /* Check if Copy & Paste is disabled */
620     if(!is_object($this->CopyPasteHandler)){
621       return("");
622     }
624     $ui = get_userinfo();  
626     /* Add a single entry to queue */
627     if($s_action == "cut" || $s_action == "copy"){
629       /* Cleanup object queue */
630       $this->CopyPasteHandler->cleanup_queue();
631       $dn = $this->mimetypes[$s_entry]['dn'];
632       if($s_action == "copy" && $ui->is_copyable($dn,"mimetypes","mimetype")){
633         $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
634       }
635       if($s_action == "cut" && $ui->is_cutable($dn,"mimetypes","mimetype")){ 
636         $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
637       }
638     }
640     /* Add entries to queue */
641     if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
643       /* Cleanup object queue */
644       $this->CopyPasteHandler->cleanup_queue();
645   
646       /* Add new entries to CP queue */
647       foreach($this->list_get_selected_items() as $id){
648         $dn = $this->mimetypes[$id]['dn'];
650         if($s_action == "copy_multiple" && $ui->is_copyable($dn,"mimetypes","mimetype")){ 
651           $this->CopyPasteHandler->add_to_queue($dn,"copy","mimetabs","MIMETABS","mimetypes");
652         }
653         if($s_action == "cut_multiple" && $ui->is_cutable($dn,"mimetypes","mimetype")){
654           $this->CopyPasteHandler->add_to_queue($dn,"cut","mimetabs","MIMETABS","mimetypes");
655         }
656       }
657     }
659     /* Start pasting entries */
660     if($s_action == "editPaste"){
661       $this->start_pasting_copied_objects = TRUE;
662     }
664     /* Return C&P dialog */
665     if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
667       /* Get dialog */
668       $this->CopyPasteHandler->SetVar("base",preg_replace("/^".normalizePreg(get_ou("mimetypeou"))."/","",$this->mime_base));
669       $this->CopyPasteHandler->SetVar("parent",$this);
670       $data = $this->CopyPasteHandler->execute();
672       /* Return dialog data */
673       if(!empty($data)){
674         return($data);
675       }
676     }
678     /* Automatically disable status for pasting */
679     if(!$this->CopyPasteHandler->entries_queued()){
680       $this->start_pasting_copied_objects = FALSE;
681     }
682     return("");
683   }
686   function list_get_selected_items()
687   {
688     $ids = array();
689     foreach($_POST as $name => $value){
690       if(preg_match("/^item_selected_[0-9]*$/",$name)){
691         $id   = preg_replace("/^item_selected_/","",$name);
692         $ids[$id] = $id;
693       }
694     }
695     return($ids);
696   }
699   /* Save to LDAP */
700   function save()
701   {
702     /* Optionally execute a command after we're done */
703     $this->postcreate();
704   }
706   function remove_lock()
707   {
708     if (isset($this->mimetabs->dn)){
709       del_lock ($this->mimetabs->dn);
710     }
711     if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
712       del_lock($this->dn);
713     }
714     if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
715       del_lock($this->dns);
716     }
717   }
719   function save_object() 
720   {
721     $this->DivListMimeTypes->save_object();
722     if(is_object($this->CopyPasteHandler)){
723       $this->CopyPasteHandler->save_object();
724     }
726     if($this->IsReleaseManagementActivated() && isset($_POST['mime_release'])){
727       $sel_rel = get_post('mime_release');
728       $releases = array_flip($this->getReleases());
729       if(isset($releases[$sel_rel])){
730         $this->mime_release = $releases[$sel_rel];
731       }
732       $mime_filter     = session::get("mime_filter");
733       $mime_filter['mime_release'] = $this->mime_release;
734       session::set("mime_filter",$mime_filter);
735     }elseif(!$this->IsReleaseManagementActivated()){
736       $this->mime_base = get_ou("mimetypeou").$this->DivListMimeTypes->selectedBase;
737       $mime_filter     = session::get("mime_filter");
738       $mime_filter['mime_base'] = $this->mime_base;
739       session::set("mime_filter",$mime_filter);
740     }
741   }
744   function check() {}
745   function adapt_from_template($dn, $skip= array()) {}
746   function password_change_needed() {}
748 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
749 ?>