From 8bf17ef03518392e5a431d3852a7d7563e71f151 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 8 Aug 2005 13:07:16 +0000 Subject: [PATCH] Fixed %telephoneNumber replacedment git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1079 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/gofon/phoneaccount/class_phoneAccount.inc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index aa9798a2a..5fd9f63a2 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -132,9 +132,10 @@ class phoneAccount extends plugin /* Set all attrs */ $id = $data[0]; $this->macroarray[$attrs['dn']][$id]['var'] ="var".$id; - $string = preg_replace("/%uid/",$this->attrs['uid'][0],$data[3]); - $string = preg_replace("/%telephoneNumber/",$this->attrs['telephoneNumber'][0],$string); - $string = preg_replace("/%cn/",$this->attrs['cn'][0],$string); + $string= $data[3]; +// $string = preg_replace("/%uid/",$this->attrs['uid'][0],$data[3]); +// $string = preg_replace("/%telephoneNumber/",$this->attrs['telephoneNumber'][0],$string); +// $string = preg_replace("/%cn/",$this->attrs['cn'][0],$string); $this->macroarray[$attrs['dn']][$id]['choosen']= $string; $this->macroarray[$attrs['dn']][$id]['id'] = $id; @@ -540,6 +541,14 @@ class phoneAccount extends plugin break; case "string": + $choosen = preg_replace("/%uid/",$this->attrs['uid'][0],$choosen); + foreach($this->phoneNumbers as $phone){ + $tmp_phone[] = $phone; + } + + $choosen = preg_replace("/%telephoneNumber/",$tmp_phone[0],$choosen); + $choosen = preg_replace("/%cn/",$this->attrs['cn'][0],$choosen); + $str="acl, "goFonMacro").">"; $macrotab.= "$name$str"; break; -- 2.30.2