Code

Updated kerberos service. Closes #460
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 May 2008 08:15:07 +0000 (08:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 May 2008 08:15:07 +0000 (08:15 +0000)
-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
gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc

index 621f86c03461d56fedb93d3904e411f3ce7de8b1..719744063f3101f2515df1975a87fca0aa341bc7 100644 (file)
@@ -493,6 +493,9 @@ class msgPool
     if (count($objects) == 1){
       return sprintf(_("This '%s' is still in use by this object: %s"), $type, "<br><br>".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, "<br><br>".msgPool::buildList($objects));
   }
 
index e90adde6cca39dbfef1f53a6f8140462fdc983e7..39701578657e262ea5cccaeda18ce8103ca003d7 100644 (file)
@@ -142,7 +142,7 @@ class goKrbServer extends goService{
     $action .= "<input type='image' src='images/lists/trash.png' class='center' name='policy_del_%id'>";
     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";
+      }
+    } 
   }