diff --git a/ChangeLog b/ChangeLog index 1bdb0ec27..df53d5294 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-05-22 Wolfgang Sourdeau + * UI/MainUI/SOGoRootPage.m ([SOGoRootPage -loginSuffix]): new + method that returns the login suffix configured in the user + defaults. + ([SOGoRootPage -hasLoginSuffix]): returns whether a login suffix + has been configured in the user defaults. + * SoObjects/SOGo/SOGoUser.m ([SOGoUser -mailAccounts]): request the user login to the imap server from the LDAP user manager. diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index cf295538b..c47d8c8dc 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -20,6 +20,7 @@ */ #import +#import #import #import @@ -141,4 +142,18 @@ return nil; } +- (NSString *) loginSuffix +{ + NSUserDefaults *ud; + + ud = [NSUserDefaults standardUserDefaults]; + + return [ud stringForKey: @"SOGoLoginSuffix"]; +} + +- (BOOL) hasLoginSuffix +{ + return ([[self loginSuffix] length]); +} + @end /* SOGoRootPage */ diff --git a/UI/Templates/MainUI/SOGoRootPage.wox b/UI/Templates/MainUI/SOGoRootPage.wox index 00590eac3..fd37387d3 100644 --- a/UI/Templates/MainUI/SOGoRootPage.wox +++ b/UI/Templates/MainUI/SOGoRootPage.wox @@ -10,6 +10,9 @@ >
+

diff --git a/UI/WebServerResources/SOGoRootPage.js b/UI/WebServerResources/SOGoRootPage.js index a6ea9239b..b6ea6be28 100644 --- a/UI/WebServerResources/SOGoRootPage.js +++ b/UI/WebServerResources/SOGoRootPage.js @@ -20,6 +20,9 @@ function onLoginClick(event) { var password = $("password").value; if (userName.length > 0) { + if (loginSuffix && loginSuffix.length > 0 + && !userName.endsWith(loginSuffix)) + userName += loginSuffix; var url = $("connectForm").getAttribute("action"); var parameters = ("userName=" + encodeURI(userName) + "&password=" + encodeURI(password)); document.cookie = ""; @@ -36,6 +39,10 @@ function onLoginCallback(http) { if (http.readyState == 4) { if (isHttpStatus204(http.status)) { var userName = $("userName").value; + if (loginSuffix + && loginSuffix.length > 0 + && !userName.endsWith(loginSuffix)) + userName += loginSuffix; var address = "" + window.location.href; var baseAddress = ApplicationBaseURL + encodeURI(userName); var altBaseAddress;