Code

+ Move reset handling before object creation, otherwise no
[gosa.git] / trunk / gosa-plugins / gofax / gofax / blocklists / main.inc
1 <?php
3 /* Remove locks created by this plugin
4 */
5 if ($remove_lock){
6   if(session::is_set('blocklist')){
7       $macl = session::get('blocklist');
8       $macl->remove_lock();
9   }
10 }
12 /* Remove this plugin from session
13 */
14 if ( $cleanup ){
15   session::un_set('blocklist');
16 }else{
17         /* Reset requested? */
18         if (isset($_GET['reset']) && $_GET['reset'] == 1){
19                 session::un_set ('blocklist');
20         }
22         /* Create blocklist object on demand */
23         if (!session::is_set('blocklist')){
24                 $blocklist= new blocklist($config, $ui);
25                 $blocklist->set_acl_category("gofaxlist");
26                 session::set('blocklist',$blocklist);
27         }
28         $blocklist = session::get('blocklist');
29         $blocklist->save_object();
30         $output= $blocklist->execute();
32         /* Page header*/
33         if (get_object_info() != ""){
34                 $display= print_header(get_template_path($blocklist->plIcon), _("Blocklist management"), "<img alt=\"\"align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".LDAP::fix(get_object_info()));
35         } else {
36                 $display= print_header(get_template_path($blocklist->plIcon), _("Blocklist management"));
37         }
38         $display.= $output;
40         session::set('blocklist',$blocklist);
41 }
42 ?>