index a630ab8a98b542655cc284c95024727e3c0fe61a..f3b8907ab2b98387ae6c67760f7bdfdfea61c0df 100644 (file)
}
- function getRpcHandle($connectUrl=NULL, $username=NULL, $userPassword=NULL, $authModeDigest=FALSE)
+ function getRpcHandle($connectUrl=NULL, $username=NULL, $userPassword=NULL, $authModeDigest=FALSE, $cache = TRUE)
{
// Get conenct information, if no info was given use the default values from gosa.conf
$connectUrl = ($connectUrl !== NULL) ? $connectUrl : $this->get_cfg_value('core','gosaRpcServer');
$authModeDigest = $authModeDigest;
// Create jsonRPC handle on demand.
- if(!isset($this->jsonRPChandle[$connectUrl][$username]) || !$this->jsonRPChandle[$connectUrl][$username]){
- $this->jsonRPChandle[$connectUrl][$username] = new jsonRPC($this, $connectUrl, $username, $userPassword, $authModeDigest);
+ if(!$cache){
+ return(new jsonRPC($this, $connectUrl, $username, $userPassword, $authModeDigest));
+ }else{
+
+ if(!isset($this->jsonRPChandle[$connectUrl][$username]) || !$this->jsonRPChandle[$connectUrl][$username]){
+ $this->jsonRPChandle[$connectUrl][$username] = new jsonRPC($this, $connectUrl, $username, $userPassword, $authModeDigest);
+ }
+ return($this->jsonRPChandle[$connectUrl][$username]);
}
- return($this->jsonRPChandle[$connectUrl][$username]);
}
/* Detect department type */
$type_data = array();
foreach($types as $t => $data){
- if(in_array($data['OC'],$attrs['objectClass'])){
+ if(in_array_strict($data['OC'],$attrs['objectClass'])){
$type_data = $data;
break;
}