Merge branch 'fix/cas-service-names'

pull/12/head
Jean Raby 2013-06-18 16:44:05 -04:00
commit f24e65b6d8
5 changed files with 39 additions and 23 deletions

View File

@ -132,7 +132,9 @@
if (renew)
[session invalidateTicketForService: service];
password = [session ticketForService: service];
if ([password length] || renew)
[session updateCache];
}

View File

@ -43,6 +43,7 @@
- (NSString *) mailDomain;
- (NSString *) imapServer;
- (NSString *) sieveServer;
- (NSString *) imapCASServiceName;
- (NSString *) imapAclStyle;
- (NSString *) imapAclGroupIdPrefix;
- (NSString *) imapFolderSeparator;

View File

@ -123,6 +123,11 @@
return [self stringForKey: @"SOGoSieveServer"];
}
- (NSString *) imapCASServiceName
{
return [self objectForKey: @"SOGoIMAPCASServiceName"];
}
#warning should be removed when we make use of imap namespace
- (NSString *) imapAclStyle
{

View File

@ -269,12 +269,13 @@
forceRenew: (BOOL) renew
{
NSString *authType, *password;
SOGoSystemDefaults *sd;
password = [self passwordInContext: context];
if ([password length])
{
authType = [[SOGoSystemDefaults sharedSystemDefaults]
authenticationType];
sd = [SOGoSystemDefaults sharedSystemDefaults];
authType = [sd authenticationType];
if ([authType isEqualToString: @"cas"])
{
SOGoCASSession *session;
@ -283,17 +284,24 @@
session = [SOGoCASSession CASSessionWithIdentifier: password
fromProxy: NO];
service = [sd imapCASServiceName]; // try configured service first
if (!service)
{
// We must NOT assume the scheme exists
scheme = [server scheme];
if (!scheme)
scheme = @"imap";
service = [NSString stringWithFormat: @"%@://%@", scheme, [server host]];
service = [NSString stringWithFormat: @"%@://%@",
scheme, [server host]];
}
if (renew)
[session invalidateTicketForService: service];
password = [session ticketForService: service];
if ([password length] || renew)
[session updateCache];
}