src/Utils/Ntlm/NTLMSoapClient.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * To change this template, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. namespace App\Utils\Ntlm;
  7. use SoapClient;
  8. use App\Entity\Vars;
  9. /**
  10.  * Description of NTLMSoapClient
  11.  *
  12.  * @author caldero
  13.  */
  14. class NTLMSoapClient  extends SoapClient {
  15.     
  16.     private $__last_request_headers;
  17.     function __doRequest($request$location$action$version,$one_way=0) { 
  18.         $headers = array( 
  19.             'Method: POST'
  20.             'Connection: Keep-Alive'
  21.             'User-Agent: PHP-SOAP-CURL'
  22.             'Content-Type: text/xml; charset=utf-8'
  23.             'SOAPAction: "'.$action.'"'
  24.         ); 
  25.         $this->__last_request_headers $headers
  26.         $ch curl_init($location); 
  27.         curl_setopt($chCURLOPT_RETURNTRANSFERtrue); 
  28.         curl_setopt($chCURLOPT_HTTPHEADER$headers); 
  29.         curl_setopt($chCURLOPT_POSTtrue ); 
  30.         curl_setopt($chCURLOPT_POSTFIELDS$request); 
  31.         curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_1); 
  32.         curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_NTLM); 
  33.         //curl_setopt($ch, CURLOPT_USERPWD, USERPWD); 
  34.         curl_setopt($chCURLOPT_USERPWDVars::USERNTLM.":".Vars::PASSUSERNTLM); 
  35.         $response curl_exec($ch); 
  36.         return $response
  37.     }
  38.     function __getLastRequestHeaders() { 
  39.         return implode("\n"$this->__last_request_headers)."\n"
  40.     }
  41. }