_curlOptions = $options; } /** * Send the request and store the results. * * @return bool true on success, false on failure. */ protected function sendRequest() { phpCAS::traceBegin(); /********************************************************* * initialize the CURL session *********************************************************/ $ch = $this->initAndConfigure(); /********************************************************* * Perform the query *********************************************************/ $buf = curl_exec($ch); if ( $buf === false ) { phpCAS::trace('curl_exec() failed'); $this->storeErrorMessage( 'CURL error #'.curl_errno($ch).': '.curl_error($ch) ); $res = false; } else { $this->storeResponseBody($buf); phpCAS::trace("Response Body: \n".$buf."\n"); $res = true; } // close the CURL session curl_close($ch); phpCAS::traceEnd($res); return $res; } /** * Internal method to initialize our cURL handle and configure the request. * This method should NOT be used outside of the CurlRequest or the * CurlMultiRequest. * * @return resource|false The cURL handle on success, false on failure */ public function initAndConfigure() { $ch = curl_init($this->url); curl_setopt_array($ch, $this->_curlOptions); /********************************************************* * Set SSL configuration *********************************************************/ if ($this->caCertPath) { if ($this->validateCN) { curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); } else { curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath); phpCAS::trace('CURL: Set CURLOPT_CAINFO ' . $this->caCertPath); } else { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); } /********************************************************* * Configure curl to capture our output. *********************************************************/ // return the CURL output into a variable curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // get the HTTP header with a callback curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, '_curlReadHeaders')); /********************************************************* * Add cookie headers to our request. *********************************************************/ if (count($this->cookies)) { $cookieStrings = array(); foreach ($this->cookies as $name => $val) { $cookieStrings[] = $name.'='.$val; } curl_setopt($ch, CURLOPT_COOKIE, implode(';', $cookieStrings)); } /********************************************************* * Add any additional headers *********************************************************/ if (count($this->headers)) { curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers); } /********************************************************* * Flag and Body for POST requests *********************************************************/ if ($this->isPost) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postBody); } /********************************************************* * Set User Agent *********************************************************/ curl_setopt($ch, CURLOPT_USERAGENT, 'phpCAS/' . phpCAS::getVersion()); return $ch; } /** * Store the response body. * This method should NOT be used outside of the CurlRequest or the * CurlMultiRequest. * * @param string $body body to stor * * @return void */ public function _storeResponseBody($body) { $this->storeResponseBody($body); } /** * Internal method for capturing the headers from a curl request. * * @param resource $ch handle of curl * @param string $header header * * @return int */ public function _curlReadHeaders($ch, $header) { $this->storeResponseHeader($header); return strlen($header); } } __halt_compiler();----SIGNATURE:----GIvXA15yHfj6HqbeQMq235V8zVWo9uC3oZ2HBJqAT8UMeETr9aQ0ruQDa855KclhCvz3FFt22XAZHfyDUck6sJCYsMzaGHE256SsOUncaMSldP8sEqRy0ieDkUXclBCFx6iHfCaidCCS9UzE3qISC9qGVx08/+BSr6LnmkOCwsMHVZRIiCmSfKXBWRGVOFDL/HyrJodFyQiKmlkU2wpwlTRhFMF9w9Tdwwxx9im5ZNfYtICGnAWl3CQzW9J4x2cEtYTc71EMqByy2yTJ76P2DwEzoqyu1Zcc4AyE3EMe60j2LIyQi6SwkWbvHyL/fo9uX6zgNVzv4EGVEKL3Yvz0zdEU+tiXIaA9wnM690cFlB9/vIyQc4oPcrEuzhpzJds9/3uLdBsJwEkukTc9zQbu58mjHwUjrGj3Jbk50rp5WFbjeTrdzBaQdEnUVUkxGp1zRbUUsm9XTUVxhQlvLnhyglSIuFugCZHU25FTQhcBu9XIPpT0bje2OHz+QwnKwYXvMHLPqAhm99zUUB7vjoS9Wpeww0NiDmluV7lXYoPatwj4jkV663WW07CS55Du/HmhPLL9KF09IPIocpYmfVY4KD2YpYy/dk5qum8JB0N1tDqQMjT0Gjj3b8wXrI7z9EYqNdJ6EJlO1LS9D+bpJj2HKpaXp5jP3RqOX5Obch4TKzE=----ATTACHMENT:----NDMzOTMyOTA4MDEyMTcwOCA4NTM0MzU1Mjk0MDg4MTYgMTMxMjAzMDM2MDA2MTAyNg==