mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12:22 -05:00
Caldav: accept login as alias in caldav principals path
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1428 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
146790a237
commit
5911e0b431
@ -885,7 +885,8 @@ public class CaldavConnection extends AbstractConnection {
|
||||
public void sendPrincipal(CaldavRequest request, String prefix, String principal) throws IOException {
|
||||
// actual principal is email address
|
||||
String actualPrincipal = principal;
|
||||
if ("users".equals(prefix) && session.getAlias().equalsIgnoreCase(principal)) {
|
||||
if ("users".equals(prefix) &&
|
||||
(session.getAlias().equalsIgnoreCase(principal) || session.getAliasFromLogin().equalsIgnoreCase(principal))) {
|
||||
actualPrincipal = session.getEmail();
|
||||
}
|
||||
|
||||
|
@ -2663,14 +2663,14 @@ public abstract class ExchangeSession {
|
||||
*
|
||||
* @return user name
|
||||
*/
|
||||
protected String getAliasFromLogin() {
|
||||
public String getAliasFromLogin() {
|
||||
// login is email, not alias
|
||||
if (this.userName.indexOf('@') >= 0) {
|
||||
return null;
|
||||
}
|
||||
String result = this.userName;
|
||||
// remove domain name
|
||||
int index = result.indexOf('\\');
|
||||
int index = Math.max(result.indexOf('\\'), result.indexOf('/'));
|
||||
if (index >= 0) {
|
||||
result = result.substring(index + 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user