Skip to content

Commit

Permalink
Multiple Fixes (See Change Log)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksainc committed Oct 6, 2023
1 parent 72476c3 commit 2c4b0d8
Show file tree
Hide file tree
Showing 12 changed files with 35,947 additions and 17,936 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file.

## 1.0.9 - 2023-10-05
### Additions
- Implemented Support for EXPR protocol definition in auto discovery
### Modifications
- Modified auto discovery logic to include EXPR
- Modified default protocol version to Exchange2007_SP1
- Modified messaging protocol version discovery regex
- Modified user email discovery to use UserSMTPAddress
- Modified connection verification to use "msgfolderroot" instead of "root"
- Updated soap definitiions - Service.wsdl, Messages.xsd, Types.xsd
- Fixed connectAccountAlternate result handler logic in User Configuration Controller

## 1.0.8 - 2023-10-02
### Additions
- Implemented Support for EXHTTP definition in auto discovery
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Exchange EWS Connector (Exchange Web Services)</name>
<summary>Exchange Server data sync with Nextcloud</summary>
<description><![CDATA[Exchange EWS Connector (Exchange Web Services) allows you to automatically sync your calendars and contacts from any EWS compatible service with Nextcloud.]]></description>
<version>1.0.8-beta</version>
<version>1.0.9-beta</version>
<licence>agpl</licence>
<author mail="[email protected]">Sebastian Krupinski</author>
<namespace>EWS</namespace>
Expand Down
9,063 changes: 4,540 additions & 4,523 deletions lib/Components/EWS/Assets/messages.xsd

Large diffs are not rendered by default.

4,523 changes: 4,523 additions & 0 deletions lib/Components/EWS/Assets/messages.xsd-old

Large diffs are not rendered by default.

7,245 changes: 3,621 additions & 3,624 deletions lib/Components/EWS/Assets/services.wsdl

Large diffs are not rendered by default.

3,624 changes: 3,624 additions & 0 deletions lib/Components/EWS/Assets/services.wsdl-old

Large diffs are not rendered by default.

19,605 changes: 9,826 additions & 9,779 deletions lib/Components/EWS/Assets/types.xsd

Large diffs are not rendered by default.

9,779 changes: 9,779 additions & 0 deletions lib/Components/EWS/Assets/types.xsd-old

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Controller/UserConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function ConnectAlternate(string $account_id, string $account_secret, str
// execute command
$rs = $this->CoreService->connectAccountAlternate($this->userId, $account_id, $account_secret, $account_server, $flags);
// return response
if (isset($rs)) {
if ($rs) {
return new DataResponse('success');
} else {
return new DataResponse($rs['error'], 401);
Expand Down
22 changes: 17 additions & 5 deletions lib/Service/CoreService.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ public function locateAccount(string $account_bauth_id, string $account_bauth_se
$o->EXHTTP->EwsUrl = $entry['EwsUrl'];
$o->EXHTTP->OOFUrl = $entry['OOFUrl'];
}
// evaluate if type is EXPR
elseif ($entry['Type'] == 'EXPR') {
$o->EXCH = new \stdClass();
$o->EXCH->Server = $entry['Server'];
$o->EXCH->AD = $entry['AD'];
$o->EXCH->ASUrl = $entry['ASUrl'];
$o->EXCH->EwsUrl = $entry['EwsUrl'];
$o->EXCH->OOFUrl = $entry['OOFUrl'];
}
// evaluate if type is EXCH
elseif ($entry['Type'] == 'EXCH') {
$o->EXCH = new \stdClass();
Expand Down Expand Up @@ -297,12 +306,15 @@ public function connectAccountAlternate(string $uid, string $account_bauth_id, s
if (isset($service_configuration->EXHTTP->Server)) {
$account_server = $service_configuration->EXHTTP->Server;
}
elseif (isset($service_configuration->EXPR->Server)) {
$account_server = $service_configuration->EXPR->Server;
}
elseif (isset($service_configuration->EXCH->Server)) {
$account_server = $service_configuration->EXCH->Server;
}
// evaluate, if account id information exists in the located service information
if (isset($service_configuration->UserEMailAddress)) {
$account_id = $service_configuration->UserEMailAddress;
if (isset($service_configuration->UserSMTPAddress)) {
$account_id = $service_configuration->UserSMTPAddress;
}
// evaluate, if account name information exists in the located service information
if (isset($service_configuration->UserDisplayName)) {
Expand All @@ -327,7 +339,7 @@ public function connectAccountAlternate(string $uid, string $account_bauth_id, s
$RemoteStore = new EWSClient(
$account_server,
new \OCA\EWS\Components\EWS\AuthenticationBasic($account_bauth_id, $account_bauth_secret),
'Exchange2007'
'Exchange2007_SP1'
);
// retrieve and evaluate transport verification option
if ($this->ConfigurationService->retrieveSystemValue('transport_verification') == '0') {
Expand All @@ -336,12 +348,12 @@ public function connectAccountAlternate(string $uid, string $account_bauth_id, s
// enable transport body retention
$RemoteStore->retainTransportResponseBody(true);
// retrieve root folder attributes
$rs = $this->RemoteCommonService->fetchFolder($RemoteStore, 'root', true, 'A');
$rs = $this->RemoteCommonService->fetchFolder($RemoteStore, 'msgfolderroot', true, 'A');
// evaluate server response
if (isset($rs)) {
// extract server version from response body message
preg_match_all(
'/<ServerVersionInfo[^>]*?\sVersion=(["\'])?((?:.(?!\1|>))*.?)\1?/',
'/ServerVersionInfo[^>]*?\sVersion=(["\'])?((?:.(?!\1|>))*.?)\1?/',
$RemoteStore->discloseTransportResponseBody(),
$match
);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "integration_ews",
"description": "Exchange EWS Connector (Exchange Web Services)",
"version": "1.0.8-beta",
"version": "1.0.9-beta",
"author": "Sebastian Krupinski <[email protected]> (https://github.com/ksainc/)",
"license": "AGPL-3.0",
"private": true,
Expand Down

0 comments on commit 2c4b0d8

Please sign in to comment.