1 | <?php |
||
29 | class ExchangeWebServices |
||
30 | { |
||
31 | /** |
||
32 | * Microsoft Exchange 2007 |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | const VERSION_2007 = 'Exchange2007'; |
||
37 | |||
38 | /** |
||
39 | * Microsoft Exchange 2007 SP1 |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | const VERSION_2007_SP1 = 'Exchange2007_SP1'; |
||
44 | |||
45 | /** |
||
46 | * Microsoft Exchange 2007 SP2 |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | const VERSION_2007_SP2 = 'Exchange2007_SP2'; |
||
51 | |||
52 | /** |
||
53 | * Microsoft Exchange 2007 SP3 |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | const VERSION_2007_SP3 = 'Exchange2007_SP3'; |
||
58 | |||
59 | /** |
||
60 | * Microsoft Exchange 2010 |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | const VERSION_2010 = 'Exchange2010'; |
||
65 | |||
66 | /** |
||
67 | * Microsoft Exchange 2010 SP1 |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | const VERSION_2010_SP1 = 'Exchange2010_SP1'; |
||
72 | |||
73 | /** |
||
74 | * Microsoft Exchange 2010 SP2 |
||
75 | * |
||
76 | * @var string |
||
77 | */ |
||
78 | const VERSION_2010_SP2 = 'Exchange2010_SP2'; |
||
79 | |||
80 | /** |
||
81 | * Password to use when connecting to the Exchange server. |
||
82 | * |
||
83 | * @var string |
||
84 | */ |
||
85 | protected $password; |
||
86 | |||
87 | /** |
||
88 | * Location of the Exchange server. |
||
89 | * |
||
90 | * @var string |
||
91 | */ |
||
92 | protected $server; |
||
93 | |||
94 | /** |
||
95 | * SOAP client used to make the request |
||
96 | * |
||
97 | * @var NTLMSoapClient |
||
98 | */ |
||
99 | protected $soap; |
||
100 | |||
101 | /** |
||
102 | * Username to use when connecting to the Exchange server. |
||
103 | * |
||
104 | * @var string |
||
105 | */ |
||
106 | protected $username; |
||
107 | |||
108 | /** |
||
109 | * @var EmailAddressType |
||
110 | */ |
||
111 | protected $primarySmtpMailbox; |
||
112 | |||
113 | /** |
||
114 | * A setting to check whether or not responses should be drilled down before being returned. Setting this to false |
||
115 | * will return the raw responses without any filtering |
||
116 | * |
||
117 | * @var bool |
||
118 | */ |
||
119 | protected $drillDownResponses = true; |
||
120 | |||
121 | 16 | /** |
|
122 | * @return EmailAddressType |
||
123 | 16 | */ |
|
124 | public function getPrimarySmtpMailbox() |
||
128 | 1 | ||
129 | 1 | public function getPrimarySmtpEmailAddress() |
|
137 | 1 | ||
138 | 1 | public function setPrimarySmtpEmailAddress($emailAddress) |
|
146 | |||
147 | /** |
||
148 | * Miscrosoft Exchange version that we are going to connect to |
||
149 | * |
||
150 | * @var string |
||
151 | * |
||
152 | * @see ExchangeWebServices::VERSION_2007 |
||
153 | * @see ExchangeWebServices::VERSION_2007_SP1 |
||
154 | * @see ExchangeWebServices::VERSION_2010 |
||
155 | * @see ExchangeWebServices::VERSION_2010_SP1 |
||
156 | */ |
||
157 | protected $version; |
||
158 | |||
159 | protected $options; |
||
160 | |||
161 | /** |
||
162 | * The timezone for the client |
||
163 | * |
||
164 | * @var bool |
||
165 | */ |
||
166 | protected $timezone = false; |
||
167 | |||
168 | /** |
||
169 | * @param boolean $timezone |
||
170 | */ |
||
171 | public function setTimezone($timezone) |
||
175 | |||
176 | /** |
||
177 | * Constructor for the ExchangeWebServices class |
||
178 | * |
||
179 | * @deprecated Since 0.6.3 |
||
180 | * @param string $server |
||
181 | * @param string $username |
||
182 | * @param string $password |
||
183 | * @param array $options |
||
184 | */ |
||
185 | public function __construct( |
||
199 | 22 | ||
200 | 22 | public static function fromUsernameAndPassword($server, $username, $password, $options) |
|
207 | 1 | ||
208 | 1 | public static function fromCallbackToken($server, $token, $options) |
|
215 | 25 | ||
216 | protected function createClient($server, $auth, $options) |
||
245 | |||
246 | /** |
||
247 | * @codeCoverageIgnore |
||
248 | * |
||
249 | * @param $name |
||
250 | * @param $arguments |
||
251 | * @return Type |
||
252 | * @throws \jamesiarmes\PEWS\API\Exception |
||
253 | */ |
||
254 | public function __call($name, $arguments) |
||
260 | |||
261 | /** |
||
262 | * Returns the SOAP Client that may be used to make calls against the server |
||
263 | 21 | * |
|
264 | * @return NTLMSoapClient |
||
265 | 21 | */ |
|
266 | public function getClient() |
||
270 | |||
271 | /** |
||
272 | * Sets the client |
||
273 | * |
||
274 | 2 | * @param NTLMSoapClient $client |
|
275 | * @return $this |
||
276 | 2 | */ |
|
277 | public function setClient($client) |
||
283 | |||
284 | /** |
||
285 | * Cleans the server URL for usage |
||
286 | * |
||
287 | 32 | * @param $server |
|
288 | * @return string |
||
289 | 32 | */ |
|
290 | 32 | public function cleanServerUrl($server) |
|
311 | |||
312 | /** |
||
313 | * Process a response to verify that it succeeded and take the appropriate |
||
314 | * action |
||
315 | * |
||
316 | * @param \jamesiarmes\PEWS\API\Message\BaseResponseMessageType $response |
||
317 | * @return \jamesiarmes\PEWS\API\Message\ArrayOfResponseMessageType|\jamesiarmes\PEWS\API\Message\ResponseMessageType |
||
318 | 20 | * @throws \jamesiarmes\PEWS\API\Exception |
|
319 | */ |
||
320 | protected function processResponse($response) |
||
355 | 18 | ||
356 | 18 | /** |
|
357 | 1 | * @param $response |
|
358 | 1 | * @return array |
|
359 | * @throws \jamesiarmes\PEWS\API\Exception |
||
360 | 18 | */ |
|
361 | 18 | public function drillDownResponseLevels($response) |
|
395 | } |
||
396 |