From b83739ac38af908474f48c8e8ee28de1b2881e51 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 8 May 2008 08:15:07 +0000 Subject: [PATCH] Updated kerberos service. Closes #460 -Added new "in use" message. -Added message if somebody tries to remove a still used policy git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10844 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/utils/class_msgPool.inc | 3 +++ .../services/kerberos/class_goKrbServer.inc | 20 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gosa-core/include/utils/class_msgPool.inc b/gosa-core/include/utils/class_msgPool.inc index 621f86c03..719744063 100644 --- a/gosa-core/include/utils/class_msgPool.inc +++ b/gosa-core/include/utils/class_msgPool.inc @@ -493,6 +493,9 @@ class msgPool if (count($objects) == 1){ return sprintf(_("This '%s' is still in use by this object: %s"), $type, "

".msgPool::buildList($objects)); } + if (count($objects) == 0){ + return sprintf(_("This '%s' is still in use."), $type); + } return sprintf(_("This '%s' is still in use by these objects: %s"), $type, "

".msgPool::buildList($objects)); } diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc index e90adde6c..397015786 100644 --- a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc +++ b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc @@ -142,7 +142,7 @@ class goKrbServer extends goService{ $action .= ""; foreach($this->policies as $key => $policy){ if($policy['STATUS'] == "REMOVED") continue; - + $actions = preg_replace("/%id/",$key,$action); $field1 = array("string" => $policy['NAME']); $field3 = array("string" => $actions, @@ -255,11 +255,21 @@ class goKrbServer extends goService{ */ public function RemovePolicy($id) { - if($this->policies[$id]['STATUS'] == "ADDED"){ - unset($this->policies[$id]); - }else{ - $this->policies[$id]['STATUS'] = "REMOVED"; + /* Load policy information, if not done before + */ + if($this->policies[$id]['STATUS'] == "LOADED" && empty($this->policies[$id]['DATA'])){ + $o = new gosaSupportDaemon(); + $this->policies[$id]['DATA'] = $o->krb5_get_policy($this->macAddress,$this->policies[$id]['NAME']); } + if($this->policies[$id]['DATA']['POLICY_REFCNT']){ + msg_dialog::display(_("Remove"),msgPool::stillInUse(_("Policy")),ERROR_DIALOG) ; + }else{ + if($this->policies[$id]['STATUS'] == "ADDED"){ + unset($this->policies[$id]); + }else{ + $this->policies[$id]['STATUS'] = "REMOVED"; + } + } } -- 2.30.2