Monotone-Parent: 555ffbaeafab3a0a23649acb1714e47a78d35d81
Monotone-Revision: c7c2186348790bb64c08730ba255f908ac68cfa9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-21T16:42:58 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
ac37cfc054
commit
3391161a12
|
@ -1,3 +1,9 @@
|
||||||
|
2007-11-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* UI/MainUI/SOGoRootPage.m ([SOGoRootPage -connectAction]): the
|
||||||
|
user infos are now posted as "application/x-www-form-urlencoded".
|
||||||
|
So we have to have like a form has been posted.
|
||||||
|
|
||||||
2007-11-21 Francis Lachapelle <flachapelle@inverse.ca>
|
2007-11-21 Francis Lachapelle <flachapelle@inverse.ca>
|
||||||
|
|
||||||
* UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
|
* UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
|
||||||
|
|
|
@ -63,16 +63,18 @@
|
||||||
- (id <WOActionResults>) connectAction
|
- (id <WOActionResults>) connectAction
|
||||||
{
|
{
|
||||||
WOResponse *response;
|
WOResponse *response;
|
||||||
|
WORequest *request;
|
||||||
WOCookie *authCookie;
|
WOCookie *authCookie;
|
||||||
SOGoWebAuthenticator *auth;
|
SOGoWebAuthenticator *auth;
|
||||||
NSString *cookieValue, *cookieString;
|
NSString *cookieValue, *cookieString;
|
||||||
|
|
||||||
auth = [[WOApplication application]
|
auth = [[WOApplication application]
|
||||||
authenticatorInContext: context];
|
authenticatorInContext: context];
|
||||||
|
request = [context request];
|
||||||
response = [self responseWith204];
|
response = [self responseWith204];
|
||||||
cookieString = [NSString stringWithFormat: @"%@:%@",
|
cookieString = [NSString stringWithFormat: @"%@:%@",
|
||||||
[self queryParameterForKey: @"userName"],
|
[request formValueForKey: @"userName"],
|
||||||
[self queryParameterForKey: @"password"]];
|
[request formValueForKey: @"password"]];
|
||||||
cookieValue = [NSString stringWithFormat: @"basic %@",
|
cookieValue = [NSString stringWithFormat: @"basic %@",
|
||||||
[cookieString stringByEncodingBase64]];
|
[cookieString stringByEncodingBase64]];
|
||||||
authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context]
|
authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context]
|
||||||
|
|
|
@ -20,11 +20,13 @@ function onLoginClick(event) {
|
||||||
var password = $("password").value;
|
var password = $("password").value;
|
||||||
|
|
||||||
if (userName.length > 0) {
|
if (userName.length > 0) {
|
||||||
var url = ($("connectForm").getAttribute("action")
|
var url = $("connectForm").getAttribute("action");
|
||||||
+ "?userName=" + userName
|
var parameters = ("userName=" + userName + "&password=" + password);
|
||||||
+ "&password=" + password);
|
|
||||||
document.cookie = "";
|
document.cookie = "";
|
||||||
triggerAjaxRequest(url, onLoginCallback);
|
triggerAjaxRequest(url, onLoginCallback, null, parameters,
|
||||||
|
{ "Content-type": "application/x-www-form-urlencoded",
|
||||||
|
"Content-length": parameters.length,
|
||||||
|
"Connection": "close" });
|
||||||
}
|
}
|
||||||
|
|
||||||
preventDefault(event);
|
preventDefault(event);
|
||||||
|
@ -32,9 +34,8 @@ function onLoginClick(event) {
|
||||||
|
|
||||||
function onLoginCallback(http) {
|
function onLoginCallback(http) {
|
||||||
if (http.readyState == 4) {
|
if (http.readyState == 4) {
|
||||||
if (isHttpStatus204(http.status)) {
|
if (isHttpStatus204(http.status))
|
||||||
window.location.href = ApplicationBaseURL + $("userName").value;
|
window.location.href = ApplicationBaseURL + $("userName").value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ function appendDifferentiator(url) {
|
||||||
return url_nocache;
|
return url_nocache;
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerAjaxRequest(url, callback, userdata) {
|
function triggerAjaxRequest(url, callback, userdata, content, headers) {
|
||||||
var http = createHTTPClient();
|
var http = createHTTPClient();
|
||||||
|
|
||||||
activeAjaxRequests += 1;
|
activeAjaxRequests += 1;
|
||||||
|
@ -323,7 +323,11 @@ function triggerAjaxRequest(url, callback, userdata) {
|
||||||
log(backtrace());
|
log(backtrace());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
http.send(null);
|
if (headers) {
|
||||||
|
for (var i in headers)
|
||||||
|
http.setRequestHeader(i, headers[i]);
|
||||||
|
}
|
||||||
|
http.send(content);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log("triggerAjaxRequest: error creating HTTP Client!");
|
log("triggerAjaxRequest: error creating HTTP Client!");
|
||||||
|
|
Loading…
Reference in New Issue