=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2011-08-12 16:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2011-08-16 14:47:08 +0000
@@ -16,7 +16,7 @@
420
../dhis-web-commons/ouwt/ouwt.js,javascript/form.js,javascript/entry.js,javascript/history.js
style/dhis-web-dataentry.css
- true
+ false
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2011-08-16 13:48:25 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2011-08-16 14:47:08 +0000
@@ -204,6 +204,20 @@
return false;
}
+function ajax_login() {
+ $("#login_button").bind("click", function() {
+ var username = prompt("Please enter username");
+ var password = prompt("Please enter password");
+
+ $.post("../dhis-web-commons-security/login.action", {
+ "j_username": username,
+ "j_password": password
+ }).success(function() {
+ alert("login attempt successful, TODO check if login was successful with checkAvailability");
+ })
+ })
+}
+
$(document).ready(function() {
dhis2.availability.startAvailabilityCheck();
@@ -221,12 +235,10 @@
} else {
if(isHeaderMessageVisible()) {
updateHeaderMessage( "Successfully connected with server. Please " )
- $("#login_button").bind("click", function() {
- // TODO hack, please improve
- window.location.href = "../dhis-web-commons/security/login.html";
- })
+ ajax_login();
} else {
setHeaderMessage( "Successfully connected with server. Please " )
+ ajax_login();
}
}
})