Code

Fixed removement of new kiosk service
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Oct 2007 13:52:08 +0000 (13:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Oct 2007 13:52:08 +0000 (13:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7460 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_goKioskService.inc
plugins/personal/environment/class_environment.inc

index 63de7c2fe60243184a0422abb0e17f20b0c75348..cee4aa17989d21b8b61831a7142df308931e340e 100644 (file)
@@ -42,7 +42,27 @@ class goKioskService extends goService{
     }
   }
 
-    
+
+  function remove_from_parent()
+  {
+    $ldap = $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(&(objectClass=gotoEnvironment)(gotoKioskProfile=*/".$this->cn."/*))",array("cn"));
+    $str ="";
+    $cnt = 3;
+    while($cnt && $attrs = $ldap->fetch()){
+      $str .= $attrs['cn'][0].", ";
+      $cnt --;
+    }    
+    $str = preg_replace("/, $/","",$str);
+    if($cnt != 3){
+      print_red(sprintf(_("Can not remove kiosk profile service, it is currently in use by following user(s) : %s."),$str));
+    }else{
+      goService::remove_from_parent();
+    }
+  }
+  
+  
   function execute()
   { 
     /* log actions */
index 84c2c6edfca8fc55cfa834bd191874a17aaaeb1e..13e4b32580ee50f39fe53165015ae11e145ea6c2 100644 (file)
@@ -278,7 +278,7 @@ class environment extends plugin
       $error = true;
     }
     if($error && !empty($this->gotoKioskProfile)){
-      print_red(sprintf(_("The selected kiosk profile wasn't available anymore. Profile was set to %s.%s."),
+      print_red(sprintf(_("The selected kiosk profile wasn't available anymore. The current profile is now 'none'."),
             $this->gotoKioskProfile_Server,$this->gotoKioskProfile_Profile));
     }
   }