From c70a046a02aa11f54b48898cf1bf091753de1744 Mon Sep 17 00:00:00 2001 From: hzerres Date: Thu, 9 Sep 2010 13:53:00 +0000 Subject: [PATCH] implemented Dao get - fetched the primary Email Address. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19589 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_groupware.inc | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_groupware.inc b/gosa-plugins/groupware/personal/groupware/class_groupware.inc index a6611657d..876374fa4 100644 --- a/gosa-plugins/groupware/personal/groupware/class_groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_groupware.inc @@ -109,9 +109,9 @@ class groupware extends plugin */ function rpcExec($function) { - echo "Calling function:".$function."
"; $params = func_get_args(); unset($params[0]); + echo "Calling function:".$function." Params".var_dump($params)."
"; $rpc = $this->config->getRpcHandle(); $res = call_user_func_array(array($rpc,$function),array_values($params)); @@ -142,7 +142,7 @@ class groupware extends plugin $features = array(); $featureReq = array( "primaryMail" => array( - 'acctGetPrimaryMail'), + 'acctGetPrimaryMailAddress'), "quotaUsage" => array( 'acctGetQuota'), "quotaSize" => array( @@ -819,9 +819,8 @@ class groupware_dao{ private static $gwFeatures = array( - "primaryAddress" => array( "get"=>"acctGetUser", - "save"=>"acctSetUser", - "delete"=>"acctDelUser") + "primaryMail" => array( "get"=>"gwAcctGetPrimaryMailAddress", + "save"=>"gwAcctSetPrimaryMailAddress") ); @@ -865,12 +864,17 @@ class groupware_dao{ * check if feture available * get and return the result. */ - - if($this->gwFeatureAvailable($feature)){ - $result = $this->availableMethods = $this->groupwarePluginRef->rpcExec('gwGetCapabilities'); + $function = groupware_dao::$gwFeatures[$feature]["get"]; + if(true){ + $valueArray = array_merge(array($function), $valueArray); + $result = call_user_func_array(array($this->groupwarePluginRef, 'rpcExec'), $valueArray); return $result; } + else{ + echo "Feature not available."; + } + //Throw an error? return false; } public function del($feature, $valueArray){ @@ -891,7 +895,9 @@ class groupware_dao{ public function getComprehensiverUser($uid){ //$hi = $this->groupwarePluginRef->rpcExec('gwGetCapabilities'); if($this->groupwarePluginRef->isFeatureEnabled("primaryMail")){ - $pMail = $this->groupwarePluginRef->rpcExec("gwAcctGetPrimaryMailAddress",$uid); + $pMail = $this->get("primaryMail", array($uid)); + + //= $this->groupwarePluginRef->rpcExec("gwAcctGetPrimaryMailAddress",$uid); echo "pMail for $uid
";
 			print_r($pMail);
 			echo "
"; -- 2.30.2