index 70bba3876a304e8e73a260726a38424114068750..f3b8907ab2b98387ae6c67760f7bdfdfea61c0df 100644 (file)
var $filename = "";
var $last_modified = 0;
- var $gosaUUID = "";
+ var $instanceUUID = "";
private $jsonRPChandle = NULL;
$this->parser = xml_parser_create();
$this->basedir= $basedir;
- $this->gosaUUID = uniqid();
-
xml_set_object($this->parser, $this);
xml_set_element_handler($this->parser, "tag_open", "tag_close");
// Load configuration registry
$this->configRegistry = new configRegistry($this);
+ $this->registration = new GOsaRegistration($this);
}
- function getGOsaUUID()
+ function getInstanceUUID()
{
- return($this->gosaUUID);
+ return($this->instanceUUID);
}
if(isset($attrs['CONFIGVERSION'])){
$this->config_version = $attrs['CONFIGVERSION'];
}
+ if(isset($attrs['INSTANCEUUID'])){
+ $this->instanceUUID = $attrs['INSTANCEUUID'];
+ }
}
/* Return if we're not in config section */
}
- function getRpcHandle($url="", $user="", $pwd="", $digest = 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');
+ $username = ($username !== NULL) ? $username : $this->get_cfg_value('core','gosaRpcUser');
+ $userPassword = ($userPassword !== NULL) ? $userPassword : $this->get_cfg_value('core','gosaRpcPassword');
+ $authModeDigest = $authModeDigest;
+
// Create jsonRPC handle on demand.
- if(!isset($this->jsonRPChandle[$url][$user]) || !$this->jsonRPChandle[$url][$user]){
- $this->jsonRPChandle[$url][$user] = new jsonRPC($this, $url, $user, $pwd, $digest);
+ 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[$url][$user]);
}
/* If no samba servers are found, look for configured sid/ridbase */
if (count($this->data['SERVERS']['SAMBA']) == 0){
- if (!isset($this->current["SAMBASID"]) || !isset($this->current["SAMBARIDBASE"])){
- msg_dialog::display(_("Configuration error"), _("sambaSID and/or sambaRidBase missing in the configuration!"), ERROR_DIALOG);
+ $sambaSID = $this->get_cfg_value("core","sambaSID");
+ $sambaRIDBase = $this->get_cfg_value("core","sambaRidBase");
+ if (!isset($sambaSID) || !isset($sambaRIDBase)){
+ msg_dialog::display(_("Configuration error"),
+ _("sambaSID and/or sambaRidBase missing in the configuration!"), ERROR_DIALOG);
} else {
$this->data['SERVERS']['SAMBA']['DEFAULT']= array(
- "SID" => $this->current["SAMBASID"],
- "RIDBASE" => $this->current["SAMBARIDBASE"]);
+ "SID" => $sambaSID ,
+ "RIDBASE" => $sambaRIDBase);
}
}
/* 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;
}