From 2b995de12607d97bbbfd3591599f2174ca0295ad Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Apr 2008 07:46:33 +0000 Subject: [PATCH] Updated sudo plugin. -Some comments -OO functions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10193 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../sudo/admin/sudo/class_divListSudo.inc | 2 +- .../sudo/admin/sudo/class_sudoManagement.inc | 50 +++++++++---------- .../sudo/admin/sudo/class_sudoOptions.inc | 2 +- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc index b83c7ba08..58936de89 100644 --- a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc +++ b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc @@ -83,7 +83,7 @@ class divListSudo extends MultiSelectWindow /* Prepare departments, which are shown in the listbox on top of the listbox */ - $base = $this->parent->base; + $base = sudo::get_sudoers_ou($this->config); $acl = $this->ui->get_category_permissions($base,"sudo"); /* Add default header */ diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc index fe78bd12a..4a082c1d0 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc @@ -20,18 +20,24 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*! \brief This is the sudo management class. \ + This class allows to add/remove/edit sudo roles with GOsa. \ + All roles will be listed by this plugin, the displayed objects \ + can also be filtered. +*/ class sudoManagement extends plugin { /* Definitions */ - var $plHeadline = "Sudo"; - var $plDescription = "Manage sudo roles"; + public $plHeadline = "Sudo"; + public $plDescription = "Manage sudo roles"; - var $DivListSudo = NULL; - var $base = ""; + private $DivListSudo = NULL; + private $sudotabs = NULL; + private $base = ""; + - var $sudotabs = NULL; - - function sudoManagement (&$config, &$ui) + + public function __construct(&$config, &$ui) { /* Save configuration for internal use */ $this->config = &$config; @@ -43,7 +49,7 @@ class sudoManagement extends plugin } - function execute() + public function execute() { /* Call parent execute */ plugin::execute(); @@ -136,6 +142,10 @@ class sudoManagement extends plugin unset ($this->sudotabs); $this->sudotabs= NULL; session::un_set('objectinfo'); + }else{ + $this->dn = $this->sudotabs->dn; + $this->sudotabs= new sudotabs($this->config, $this->config->data['TABS']['SUDOTABS'], $this->dn); + session::set('objectinfo',$this->dn); } } else { /* Ok. There seem to be errors regarding to the tab data, @@ -301,7 +311,7 @@ class sudoManagement extends plugin } - function list_get_selected_items() + private function list_get_selected_items() { $ids = array(); foreach($_POST as $name => $value){ @@ -314,7 +324,7 @@ class sudoManagement extends plugin } - function reload($CreatePosixsList=false) + private function reload($CreatePosixsList=false) { $this->list = array(); $base = $this->base; @@ -343,21 +353,12 @@ class sudoManagement extends plugin /* Save data to object */ - function save_object() + public function save_object() { $this->DivListSudo->save_object(); } - - function remove_lock() - { - if (isset($this->sudotabs->dn)){ - del_lock ($this->sudotabs->dn); - } - } - - - function remove_from_parent() + public function remove_from_parent() { /* Optionally execute a command after we're done */ $this->postremove(); @@ -365,16 +366,11 @@ class sudoManagement extends plugin /* Save to LDAP */ - function save() + public function save() { /* Optionally execute a command after we're done */ $this->postcreate(); } - - /* Unused functions */ - function check() { } - function adapt_from_template($dn, $skip= array()) { } - function password_change_needed() { } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoOptions.inc b/gosa-plugins/sudo/admin/sudo/class_sudoOptions.inc index b9954a503..3b6ad7c59 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoOptions.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoOptions.inc @@ -253,7 +253,7 @@ class sudoOption extends plugin $smarty = get_smarty(); $smarty->assign("map", array("STRING" => _("string"), "BOOLEAN" => _("bool"), "INTEGER" => _("integer") , "BOOL_INTEGER" => _("integer")."-"._("bool") , - "STRING_BOOL" => _("string")."-"._("bool"),"LISTS" => _("lists"))); + "STRING_BOOL" => _("string")."-"._("bool"),"LISTS" => _("list"))); $smarty->assign("sudoOption",$this->sudoOption); $smarty->assign("options",$this->options); return($smarty->fetch(get_template_path('options.tpl', TRUE))); -- 2.30.2