summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1db5e99)
raw | patch | inline | side by side (parent: 1db5e99)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Nov 2010 15:11:37 +0000 (15:11 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Nov 2010 15:11:37 +0000 (15:11 +0000) |
-Allow to disable connection caching.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20205 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20205 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_GOsaRegistration.inc | patch | blob | history | |
gosa-core/include/class_config.inc | patch | blob | history | |
gosa-core/include/class_jsonRPC.inc | patch | blob | history |
diff --git a/gosa-core/include/class_GOsaRegistration.inc b/gosa-core/include/class_GOsaRegistration.inc
index 2685bcabb311f9eac5b009c38ebb7dd3850163ad..efadc48b380a08f8a6d0fe5f3e906a91aa768cf6 100644 (file)
<?php
-
class GOsaRegistration
{
-
+ private $config;
-}
+ function __construct(&$config)
+ {
+ $this->config = $config;
+ }
+
+ function isInstanceRegistered()
+ {
+ return(FALSE);
+ }
+}
?>
index a630ab8a98b542655cc284c95024727e3c0fe61a..ad4d2fc7cb21fb67596d168c141053d2477d548d 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]);
}
index e65cfbdc914619b341bc57d0c56c2a5cc49a290c..b9ded4fe3c851def5c1709bc11559c9e70f5df04 100644 (file)
// Try to login
if($this->authModeDigest){
- if(!empty($this->username))
+ if(!empty($this->username)){
curl_setopt($this->curlHandler, CURLOPT_USERPWD , "{$this->username}:{$this->userPassword}");
+ }
+
curl_setopt($this->curlHandler, CURLOPT_HTTPAUTH , CURLAUTH_ANYSAFE);
}else{
curl_setopt($this->curlHandler, CURLOPT_COOKIESESSION , TRUE);
*/
public function success()
{
- return(curl_errno($this->curlHandler) == 0 && $this->lastStats['http_code'] == 200);
+ return(curl_errno($this->curlHandler) == 0 ||
+ (isset($this->lastStats['http_code']) && $this->lastStats['http_code'] == 200));
}