Monotone-Parent: 7c43b14e9157686aa029894c48c4f5e4292832f7
Monotone-Revision: 9532f8c1461cc8a7c94898afe1a065fc1c66f2cd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-22T15:56:18 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
f694938fd1
commit
60a704190c
|
@ -1,5 +1,11 @@
|
|||
2008-05-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* 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.
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGObjWeb/WOApplication.h>
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
|
@ -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 */
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
><var:string var:value="doctype" const:escapeHTML="NO"/>
|
||||
<form id="connectForm" var:href="connectURL">
|
||||
<div id="loginScreen">
|
||||
<var:if condition="hasLoginSuffix"><script
|
||||
type="text/javascript">var loginSuffix = '<var:string value="loginSuffix"/>';</script
|
||||
></var:if>
|
||||
<img const:alt="*" id="splash" rsrc:src="lori-login.jpg"/><br/><br/>
|
||||
<var:if condition="shortUserNameForDisplay" const:value="wrongusernamepassword"
|
||||
><p class="error"><var:string label:value="Wrong username or password."/></p>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue