1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-17 21:32:26 -05:00

Pull destination url from OWA login page. Order of priority for destination is: User specified mailbox path, destination form value on OWA login page, "/" character.

This commit is contained in:
Matthew Brace 2009-02-19 04:35:15 +00:00
parent 7cd031e8ad
commit acea3ab3b5

View File

@ -479,6 +479,7 @@ public class WebDavStore extends Store {
String[] urlParts = url.split("/"); String[] urlParts = url.split("/");
String finalUrl = ""; String finalUrl = "";
String loginUrl = new String(); String loginUrl = new String();
String destinationUrl = new String();
if (this.mAuthPath != null && if (this.mAuthPath != null &&
!this.mAuthPath.equals("") && !this.mAuthPath.equals("") &&
@ -553,7 +554,15 @@ public class WebDavStore extends Store {
} else { } else {
loginUrl = finalUrl + tagParts[1]; loginUrl = finalUrl + tagParts[1];
} }
matched = true; }
if (tempText.indexOf("destination") >= 0) {
String[] tagParts = tempText.split("value");
if (tagParts[1] != null) {
String[] valueParts = tagParts[1].split("\"");
destinationUrl = valueParts[1];
matched = true;
}
} }
} }
istream.close(); istream.close();
@ -570,8 +579,11 @@ public class WebDavStore extends Store {
if (this.mMailboxPath != null && if (this.mMailboxPath != null &&
!this.mMailboxPath.equals("")) { !this.mMailboxPath.equals("")) {
pairs.add(new BasicNameValuePair("destination", finalUrl + this.mMailboxPath)); pairs.add(new BasicNameValuePair("destination", finalUrl + this.mMailboxPath));
} else if (destinationUrl != null &&
!destinationUrl.equals("")) {
pairs.add(new BasicNameValuePair("destination", destinationUrl));
} else { } else {
pairs.add(new BasicNameValuePair("destination", url)); pairs.add(new BasicNameValuePair("destination", "/"));
} }
pairs.add(new BasicNameValuePair("flags", "0")); pairs.add(new BasicNameValuePair("flags", "0"));
pairs.add(new BasicNameValuePair("SubmitCreds", "Log+On")); pairs.add(new BasicNameValuePair("SubmitCreds", "Log+On"));