Merge branch 'fix/cas-service-names'
This commit is contained in:
commit
f24e65b6d8
|
@ -132,7 +132,9 @@
|
||||||
|
|
||||||
if (renew)
|
if (renew)
|
||||||
[session invalidateTicketForService: service];
|
[session invalidateTicketForService: service];
|
||||||
|
|
||||||
password = [session ticketForService: service];
|
password = [session ticketForService: service];
|
||||||
|
|
||||||
if ([password length] || renew)
|
if ([password length] || renew)
|
||||||
[session updateCache];
|
[session updateCache];
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
- (NSString *) mailDomain;
|
- (NSString *) mailDomain;
|
||||||
- (NSString *) imapServer;
|
- (NSString *) imapServer;
|
||||||
- (NSString *) sieveServer;
|
- (NSString *) sieveServer;
|
||||||
|
- (NSString *) imapCASServiceName;
|
||||||
- (NSString *) imapAclStyle;
|
- (NSString *) imapAclStyle;
|
||||||
- (NSString *) imapAclGroupIdPrefix;
|
- (NSString *) imapAclGroupIdPrefix;
|
||||||
- (NSString *) imapFolderSeparator;
|
- (NSString *) imapFolderSeparator;
|
||||||
|
|
|
@ -123,6 +123,11 @@
|
||||||
return [self stringForKey: @"SOGoSieveServer"];
|
return [self stringForKey: @"SOGoSieveServer"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) imapCASServiceName
|
||||||
|
{
|
||||||
|
return [self objectForKey: @"SOGoIMAPCASServiceName"];
|
||||||
|
}
|
||||||
|
|
||||||
#warning should be removed when we make use of imap namespace
|
#warning should be removed when we make use of imap namespace
|
||||||
- (NSString *) imapAclStyle
|
- (NSString *) imapAclStyle
|
||||||
{
|
{
|
||||||
|
|
|
@ -269,12 +269,13 @@
|
||||||
forceRenew: (BOOL) renew
|
forceRenew: (BOOL) renew
|
||||||
{
|
{
|
||||||
NSString *authType, *password;
|
NSString *authType, *password;
|
||||||
|
SOGoSystemDefaults *sd;
|
||||||
|
|
||||||
password = [self passwordInContext: context];
|
password = [self passwordInContext: context];
|
||||||
if ([password length])
|
if ([password length])
|
||||||
{
|
{
|
||||||
authType = [[SOGoSystemDefaults sharedSystemDefaults]
|
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||||
authenticationType];
|
authType = [sd authenticationType];
|
||||||
if ([authType isEqualToString: @"cas"])
|
if ([authType isEqualToString: @"cas"])
|
||||||
{
|
{
|
||||||
SOGoCASSession *session;
|
SOGoCASSession *session;
|
||||||
|
@ -283,17 +284,24 @@
|
||||||
session = [SOGoCASSession CASSessionWithIdentifier: password
|
session = [SOGoCASSession CASSessionWithIdentifier: password
|
||||||
fromProxy: NO];
|
fromProxy: NO];
|
||||||
|
|
||||||
|
service = [sd imapCASServiceName]; // try configured service first
|
||||||
|
if (!service)
|
||||||
|
{
|
||||||
// We must NOT assume the scheme exists
|
// We must NOT assume the scheme exists
|
||||||
scheme = [server scheme];
|
scheme = [server scheme];
|
||||||
|
|
||||||
if (!scheme)
|
if (!scheme)
|
||||||
scheme = @"imap";
|
scheme = @"imap";
|
||||||
|
|
||||||
service = [NSString stringWithFormat: @"%@://%@", scheme, [server host]];
|
service = [NSString stringWithFormat: @"%@://%@",
|
||||||
|
scheme, [server host]];
|
||||||
|
}
|
||||||
|
|
||||||
if (renew)
|
if (renew)
|
||||||
[session invalidateTicketForService: service];
|
[session invalidateTicketForService: service];
|
||||||
|
|
||||||
password = [session ticketForService: service];
|
password = [session ticketForService: service];
|
||||||
|
|
||||||
if ([password length] || renew)
|
if ([password length] || renew)
|
||||||
[session updateCache];
|
[session updateCache];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue