mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-22 02:58:11 +00:00
feat(openID): second part with a lot of fixes and cleaning
This commit is contained in:
1 parent
458d39d48a
commit
c3234882eb
34 files changed
+1539
-448
No files matched your search
+16
-11
@@ -488,14 +488,6 @@
|
||||
&& [user isSuperUser]);
|
||||
}
|
||||
|
||||
- (BOOL) usesCASAuthentication
|
||||
{
|
||||
SOGoSystemDefaults *sd;
|
||||
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
|
||||
return [[sd authenticationType] isEqualToString: @"cas"];
|
||||
}
|
||||
|
||||
- (BOOL) usesOpenIdAuthentication
|
||||
{
|
||||
@@ -546,19 +538,32 @@
|
||||
BOOL canLogoff;
|
||||
id auth;
|
||||
SOGoSystemDefaults *sd;
|
||||
NSString *authType;
|
||||
NSString *authType, *login, *loginDomain;
|
||||
NSRange r;
|
||||
|
||||
auth = [[self clientObject] authenticatorInContext: context];
|
||||
if ([auth respondsToSelector: @selector (cookieNameInContext:)])
|
||||
{
|
||||
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
authType = [sd authenticationType];
|
||||
|
||||
login = [[context activeUser] login];
|
||||
r = [login rangeOfString: @"@"];
|
||||
if (r.location != NSNotFound)
|
||||
loginDomain = [login substringFromIndex: r.location+1];
|
||||
else
|
||||
loginDomain = nil;
|
||||
if(loginDomain && [sd doesLoginTypeByDomain])
|
||||
authType = [sd getLoginTypeForDomain: loginDomain];
|
||||
else
|
||||
authType = [sd authenticationType];
|
||||
|
||||
if ([authType isEqualToString: @"cas"])
|
||||
canLogoff = [sd CASLogoutEnabled];
|
||||
else if ([authType isEqualToString: @"saml2"])
|
||||
canLogoff = [sd SAML2LogoutEnabled];
|
||||
else if ([authType isEqualToString: @"openid"])
|
||||
canLogoff = [sd openIdLogoutEnabled];
|
||||
canLogoff = [sd openIdLogoutEnabled: loginDomain];
|
||||
else
|
||||
canLogoff = [[auth cookieNameInContext: context] length] > 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user