From eccff147ffff6956b31ad1ff09eb53c059ebe4ff Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 3 Aug 2010 10:39:15 +0000 Subject: [PATCH] Updated stats git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19357 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 2 -- gosa-core/include/class_jsonRPC.inc | 31 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index fe82c2cfe..254d4de49 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -487,8 +487,6 @@ if($config->get_cfg_value("core","storeFilterSettings") == "true"){ @setcookie("GOsa_Filter_Settings",base64_encode(serialize($cookie)),time() + (60*60*24)); } -stats::show(); - /* Show page... */ echo $display; diff --git a/gosa-core/include/class_jsonRPC.inc b/gosa-core/include/class_jsonRPC.inc index 041babce5..d29f47f64 100644 --- a/gosa-core/include/class_jsonRPC.inc +++ b/gosa-core/include/class_jsonRPC.inc @@ -8,27 +8,26 @@ class jsonRPC { private $lastAction = "none"; - private $url = ""; - private $user = ""; - private $password = ""; - + private $connectUrl = ""; + private $username = ""; + private $userPassword = ""; private $authModeDigest = FALSE; - public function __construct($config, $url = "", $user = "", $password = "", $digest = FALSE) + public function __construct($config, $connectUrl="", $username="", $userPassword="", $authModeDigest=FALSE) { $this->config = $config; $this->id = 0; // Get connection data - $this->url = (!empty($url)) ? $url : $this->config->get_cfg_value('core','gosaRpcServer'); - $this->user = (!empty($user)) ? $user : $this->config->get_cfg_value('core','gosaRpcUser'); - $this->passwd = (!empty($password)) ? $password : $this->config->get_cfg_value('core','gosaRpcPassword'); - $this->authModeDigest = $digest; + $this->connectUrl = (!empty($connectUrl)) ? $connectUrl : $this->config->get_cfg_value('core','gosaRpcServer'); + $this->username = (!empty($username)) ? $username : $this->config->get_cfg_value('core','gosaRpcUser'); + $this->userPassword = (!empty($userPassword)) ? $userPassword : $this->config->get_cfg_value('core','gosaRpcPassword'); + $this->authModeDigest = $authModeDigest; // Put some usefull info in the logs - DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->url), "Initiated RPC "); - DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->user), "RPC user: "); - DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->passwd),"RPC password: "); + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->connectUrl), "Initiated RPC "); + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->username), "RPC user: "); + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->userPassword),"RPC password: "); DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->authModeDigest),"Digest Auth (0: No, 1: Yes): "); $this->__login(); @@ -37,10 +36,10 @@ class jsonRPC { private function __login() { // Init Curl handler - $this->curlHandler = curl_init($this->url); + $this->curlHandler = curl_init($this->connectUrl); // Set curl options - curl_setopt($this->curlHandler, CURLOPT_URL , $this->url); + curl_setopt($this->curlHandler, CURLOPT_URL , $this->connectUrl); curl_setopt($this->curlHandler, CURLOPT_POST , TRUE); curl_setopt($this->curlHandler, CURLOPT_RETURNTRANSFER ,TRUE); curl_setopt($this->curlHandler, CURLOPT_HTTPHEADER , array('Content-Type: application/json')); @@ -48,12 +47,12 @@ class jsonRPC { // Try to login if($this->authModeDigest){ - curl_setopt($this->curlHandler, CURLOPT_USERPWD , "{$this->user}:{$this->passwd}"); + 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); curl_setopt($this->curlHandler, CURLOPT_COOKIEFILE, 'cookiefile.txt'); - $this->login($this->user, $this->passwd); + $this->login($this->username, $this->userPassword); } } -- 2.30.2