1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-02-28 09:21:49 -05:00

add exchangecookie to the list of authentication cookies for direct EWS access

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1836 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-10-27 17:50:04 +00:00
parent dcf7c93705
commit d303248af0

View File

@ -93,7 +93,7 @@ public abstract class ExchangeSession {
protected static final String PUBLIC_ROOT = "/public/"; protected static final String PUBLIC_ROOT = "/public/";
protected static final String CALENDAR = "calendar"; protected static final String CALENDAR = "calendar";
protected static final String TASKS = "tasks"; protected static final String TASKS = "tasks";
/** /**
* Contacts folder logical name * Contacts folder logical name
*/ */
@ -290,7 +290,7 @@ public abstract class ExchangeSession {
* @return true if basic authentication detected * @return true if basic authentication detected
* @throws IOException unable to connect to exchange * @throws IOException unable to connect to exchange
*/ */
protected boolean isBasicAuthentication(HttpClient httpClient, String url) { protected boolean isBasicAuthentication(HttpClient httpClient, String url) {
return DavGatewayHttpClientFacade.getHttpStatus(httpClient, url) == HttpStatus.SC_UNAUTHORIZED; return DavGatewayHttpClientFacade.getHttpStatus(httpClient, url) == HttpStatus.SC_UNAUTHORIZED;
} }
@ -602,7 +602,10 @@ public abstract class ExchangeSession {
// Exchange 2003 cookies // Exchange 2003 cookies
if (cookie.getName().startsWith("cadata") || "sessionid".equals(cookie.getName()) if (cookie.getName().startsWith("cadata") || "sessionid".equals(cookie.getName())
// Exchange 2007 cookie // Exchange 2007 cookie
|| "UserContext".equals(cookie.getName())) { || "UserContext".equals(cookie.getName())
// Direct EWS access
|| "exchangecookie".equals(cookie.getName())
) {
authenticated = true; authenticated = true;
break; break;
} }
@ -1325,8 +1328,8 @@ public abstract class ExchangeSession {
/** /**
* Update Exchange folder properties. * Update Exchange folder properties.
* *
* @param folderName logical folder name * @param folderName logical folder name
* @param properties folder properties * @param properties folder properties
* @return status * @return status
* @throws IOException on error * @throws IOException on error
*/ */
@ -2141,7 +2144,7 @@ public abstract class ExchangeSession {
fixICS(itemBody.getBytes("UTF-8"), false); fixICS(itemBody.getBytes("UTF-8"), false);
// fix task item name // fix task item name
if (vCalendar.isTodo() && this.itemName.endsWith(".ics")) { if (vCalendar.isTodo() && this.itemName.endsWith(".ics")) {
this.itemName = itemName.substring(0, itemName.length() - 3)+"EML"; this.itemName = itemName.substring(0, itemName.length() - 3) + "EML";
} }
} }
@ -2524,8 +2527,8 @@ public abstract class ExchangeSession {
protected abstract Condition getCalendarItemCondition(boolean excludeTasks, Condition dateCondition); protected abstract Condition getCalendarItemCondition(boolean excludeTasks, Condition dateCondition);
protected Condition getPastDelayCondition() { protected Condition getPastDelayCondition() {
int caldavPastDelay = Settings.getIntProperty("davmail.caldavPastDelay"); int caldavPastDelay = Settings.getIntProperty("davmail.caldavPastDelay");
Condition dateCondition = null; Condition dateCondition = null;
if (caldavPastDelay != 0) { if (caldavPastDelay != 0) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();