From: hickert Date: Mon, 8 Oct 2007 13:52:08 +0000 (+0000) Subject: Fixed removement of new kiosk service X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=86800de874a81365289aa38f587d0e857ba8267f;p=gosa.git Fixed removement of new kiosk service git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7460 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_goKioskService.inc b/plugins/admin/systems/class_goKioskService.inc index 63de7c2fe..cee4aa179 100644 --- a/plugins/admin/systems/class_goKioskService.inc +++ b/plugins/admin/systems/class_goKioskService.inc @@ -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 */ diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 84c2c6edf..13e4b3258 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -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)); } }