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'];
35 $cn = preg_replace('/,/', '\,', $baseobject->cn);
36 $cn = preg_replace('/"/', '\"', $cn);
38 /* Check for new 'dn', in order to propagate the
39 'dn' to all plugins */
40 $new_dn= @LDAP::convert('cn='.$cn.",".get_ou("aclrole", "aclRoleRDN").$baseobject->base);
42 if ($this->dn != $new_dn){
44 /* Write entry on new 'dn' */
45 if ($this->dn != "new"){
46 $baseobject->move($this->dn, $new_dn);
47 $this->by_object['aclrole']= $baseobject;
48 }
50 /* Happen to use the new one */
51 $this->dn= $new_dn;
52 }
54 $ret= tabs::save();
56 return $ret;
57 }
59 function save_object($ignore_account= FALSE)
60 {
61 tabs::save_object();
62 }
64 function execute()
65 {
66 $display= tabs::execute();
67 if($this->read_only){
68 $display.= "<div class='plugin-actions'>";
69 $display.= " <button type=submit name=\"edit_cancel\">".msgPool::cancelButton()."</button>\n";
70 $display.= "</div>";
71 }elseif(!$this->by_object['aclrole']->dialog){
72 $display.= "<p style=\"text-align:right\">\n";
73 $display.= " <button type=submit name=\"edit_finish\">".msgPool::okButton()."</button>\n";
74 $display.= " <button type=submit name=\"edit_cancel\">".msgPool::cancelButton()."</button>\n";
75 $display.= "</p>";
76 }
77 return($display);
78 }
79 }
80 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
81 ?>