From f953a892ea4f9018f60dfdb4736cc3a4d3bf0719 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Apr 2008 05:50:21 +0000 Subject: [PATCH] Updated sudo stuff. -Renamed sudoOptions -Updated sudo base detection. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10178 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/sudo/class_sudoManagement.inc | 19 ++++++++++++++++--- .../plugins/admin/sudo/class_sudoOptions.inc | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gosa-core/plugins/admin/sudo/class_sudoManagement.inc b/gosa-core/plugins/admin/sudo/class_sudoManagement.inc index 19db54eb4..febf43b31 100644 --- a/gosa-core/plugins/admin/sudo/class_sudoManagement.inc +++ b/gosa-core/plugins/admin/sudo/class_sudoManagement.inc @@ -36,11 +36,24 @@ class sudoManagement extends plugin /* Save configuration for internal use */ $this->config = &$config; $this->ui = &$ui; - $this->base = get_ou("sudoou"); + $this->base = @get_ou("sudoou"); + /*** + GET sudo base + ***/ if(empty($this->base)){ - //FIXME Optimize this message, maybe with msgPool - msg_dialog::display(_("Configuration"),sprintf(_("The sudo object path is not configured."))); + /* Default is ou=sudoers,BASE */ + $this->base = "ou=sudoers,".$this->config->current['BASE']; + }else{ + + /* Append base to given sudoers ou if missing */ + if(!preg_match("/".normalizePreg($this->config->current['BASE'])."$/i",$this->base)){ + if(!preg_match("/,$/",$this->base)){ + $this->base = $this->base.",".$this->config->current['BASE']; + }else{ + $this->base = $this->base.$this->config->current['BASE']; + } + } } /* Create dialog object */ diff --git a/gosa-core/plugins/admin/sudo/class_sudoOptions.inc b/gosa-core/plugins/admin/sudo/class_sudoOptions.inc index 838dc138d..43a39b140 100644 --- a/gosa-core/plugins/admin/sudo/class_sudoOptions.inc +++ b/gosa-core/plugins/admin/sudo/class_sudoOptions.inc @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -class sudo_options extends plugin +class sudoOption extends plugin { /* Group attributes */ var $sudoOption = array(); @@ -30,7 +30,7 @@ class sudo_options extends plugin var $options = array(); - function sudo_options(&$config, $dn= NULL) + function sudoOption(&$config, $dn= NULL) { plugin::plugin ($config, $dn); -- 2.30.2