From 60a704190ce31fc9993b7045ea6bbf93fc480689 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 22 May 2008 15:56:18 +0000 Subject: [PATCH] Monotone-Parent: 7c43b14e9157686aa029894c48c4f5e4292832f7 Monotone-Revision: 9532f8c1461cc8a7c94898afe1a065fc1c66f2cd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-22T15:56:18 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/MainUI/SOGoRootPage.m | 15 +++++++++++++++ UI/Templates/MainUI/SOGoRootPage.wox | 3 +++ UI/WebServerResources/SOGoRootPage.js | 7 +++++++ 4 files changed, 31 insertions(+) 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;