1 | <?php |
||
41 | class NTLMSoapClient extends SoapClient |
||
42 | { |
||
43 | /** |
||
44 | * Username for authentication on the exchnage server |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $user; |
||
49 | |||
50 | /** |
||
51 | * Password for authentication on the exchnage server |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $password; |
||
56 | |||
57 | /** |
||
58 | * Whether or not to validate ssl certificates |
||
59 | * |
||
60 | * @var boolean |
||
61 | */ |
||
62 | protected $validate = false; |
||
63 | |||
64 | private $httpPlayback; |
||
65 | |||
66 | protected $__last_request_headers; |
||
67 | |||
68 | protected $_responseCode; |
||
69 | |||
70 | /** |
||
71 | * An array of headers for us to store or use. Since not all requests use all headers (DeleteItem and SyncItems |
||
72 | * don't allow you to pass a Timezone for example), we need to be able to smartly decide what headers to include |
||
73 | * and exclude from a request. Until we have propper selection (an array of all known operations and what headers |
||
74 | * are allowed for example), this seems like a decent solution for storing the headers before we decide if they |
||
75 | * belong in the request or not) |
||
76 | * |
||
77 | 18 | * @var array |
|
78 | */ |
||
79 | 18 | protected $ewsHeaders = array( |
|
80 | 'version' => null, |
||
81 | 'impersonation' => null, |
||
82 | 'timezone' => null |
||
83 | ); |
||
84 | 1 | ||
85 | protected $auth; |
||
86 | |||
87 | 1 | /** |
|
88 | * @TODO: Make this smarter. It should know and search what headers to remove on what actions |
||
89 | 18 | * |
|
90 | * @param string $name |
||
91 | * @param string $args |
||
92 | * @return mixed |
||
93 | */ |
||
94 | public function __call($name, $args) |
||
115 | 26 | ||
116 | 26 | /** |
|
117 | 26 | * @param mixed $location |
|
118 | * @param string $user |
||
119 | * @param string $password |
||
120 | 27 | * @param $wsdl |
|
121 | 2 | * @param array $options |
|
122 | 2 | */ |
|
123 | 2 | public function __construct($location, $auth, $wsdl, $options = array()) |
|
173 | |||
174 | 18 | /** |
|
175 | * Performs a SOAP request |
||
176 | 18 | * |
|
177 | * @link http://php.net/manual/en/function.soap-soapclient-dorequest.php |
||
178 | 18 | * |
|
179 | 18 | * @param string $request the xml soap request |
|
180 | * @param string $location the url to request |
||
181 | 18 | * @param string $action the soap action. |
|
182 | 18 | * @param integer $version the soap version |
|
183 | * @param integer $one_way |
||
184 | 18 | * @return string the xml soap response. |
|
185 | */ |
||
186 | public function __doRequest($request, $location, $action, $version, $one_way = 0) |
||
210 | |||
211 | /** |
||
212 | * Returns last SOAP request headers |
||
213 | * |
||
214 | * @link http://php.net/manual/en/function.soap-soapclient-getlastrequestheaders.php |
||
215 | * |
||
216 | * @return string the last soap request headers |
||
217 | 18 | */ |
|
218 | public function __getLastRequestHeaders() |
||
222 | |||
223 | /** |
||
224 | * Set validation certificate |
||
225 | * |
||
226 | * @param bool $validate |
||
227 | * @return $this |
||
228 | */ |
||
229 | public function validateCertificate($validate = true) |
||
235 | |||
236 | /** |
||
237 | * Returns the response code from the last request |
||
238 | * |
||
239 | * @return integer |
||
240 | */ |
||
241 | public function getResponseCode() |
||
245 | } |
||
246 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.