From 112f42c03ce4624c0620dcd908f712729693adfd Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 9 Jan 2007 04:45:54 +0000 Subject: [PATCH] Avoid setting visible falg to false if phone macro is still in use. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5485 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/gofon/macro/class_gofonMacro.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index 6f464c9d2..93c0859ad 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -404,6 +404,18 @@ class macro extends plugin } } + /* If this macro is still in use we should not change the visible for user flag to invisible */ + if(!$this->goFonMacroVisible){ + $ldap = $this->config->get_ldap_link(); + $res = $ldap->search("(&(objectClass=goFonAccount)(objectClass=gosaAccount)(goFonMacro=*))", array("goFonMacro")); + while ($val = $ldap->fetch()){ + if(strstr($val['goFonMacro'][0],$this->dn)){ + $message[] = _("This macro is still in use. It is necessary to mark this macro as visible for users."); + return($message); + } + } + } + /* Macro content must be smaller than 100 lines */ if(count(split("\n",$this->goFonMacroContent))>100){ $message[] = _("Makro length must be lower than 100 lines"); -- 2.30.2