dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19577
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8595: mobile: redirect to login on index page, if we are not currently logged in
------------------------------------------------------------
revno: 8595
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-19 12:23:18 +0200
message:
mobile: redirect to login on index page, if we are not currently logged in
modified:
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm 2012-10-18 08:27:37 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm 2012-10-19 10:23:18 +0000
@@ -1,6 +1,6 @@
<!DOCTYPE html>
-<!-- <html manifest="../dhis-web-mobile-resources/manifest.appcache"> -->
-<html>
+<html manifest="../dhis-web-mobile-resources/manifest.appcache">
+<!-- <html> -->
<head>
<title>DHIS2</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2012-10-18 10:45:26 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2012-10-19 10:23:18 +0000
@@ -1,6 +1,17 @@
<script>
$(document).bind('pagebeforecreate',function(){
+ $.ajax({
+ url: '../mobile',
+ async: false
+ }).complete(function(e) {
+ var loginPage = e.getResponseHeader('Login-Page');
+
+ if( loginPage ) {
+ document.location = '../mobile';
+ }
+ });
+
$.mobile.showPageLoadingMsg();
$.ajax({