Code

Added a seperate ACL filter
[gosa.git] / gosa-core / plugins / admin / acl / tabs_acl_role.inc
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 aclroletab extends tabs
24 {
26   function aclroletab($config, $data, $dn)
27   {
28     $data = array(array("CLASS" => "aclrole" , "NAME" => _("ACL Templates")));
29     tabs::tabs($config, $data, $dn,"acl");
30   }
32   function save($ignore_account= FALSE)
33   {
34     $baseobject= $this->by_object['aclrole'];
36     /* Check for new 'dn', in order to propagate the
37        'dn' to all plugins */
38     $new_dn= 'cn='.$baseobject->cn.",".get_ou('aclRoleRDN').$baseobject->base;
40     if ($this->dn != $new_dn){
42       /* Write entry on new 'dn' */
43       if ($this->dn != "new"){
44         $baseobject->move($this->dn, $new_dn);
45         $this->by_object['aclrole']= $baseobject;
46       }
48       /* Happen to use the new one */
49       $this->dn= $new_dn;
50     }
52     $ret= tabs::save();
54     return $ret;
55   }
57   function save_object($ignore_account= FALSE)
58   {
59     tabs::save_object();
60   }
61   
62   function execute()
63   {
64     $display= tabs::execute();
65     if($this->read_only){
66       $display.= "<p style=\"text-align:right\">\n";
67       $display.= "  <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
68       $display.= "</p>";
69     }elseif(!$this->by_object['aclrole']->dialog){
70       $display.= "<p style=\"text-align:right\">\n";
71       $display.= "  <input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
72       $display.= "  &nbsp;\n";
73       $display.= "  <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
74       $display.= "</p>";
75     }
76     return($display);
77   }
79 }
80 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
81 ?>