← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3252: Fix for when referrer is the login page

 

------------------------------------------------------------
revno: 3252
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-04-01 12:19:39 +0200
message:
  Fix for when referrer is the login page
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-04-01 09:23:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-04-01 10:19:39 +0000
@@ -13,10 +13,13 @@
  */
 function referrerBack( defaultUrl ) {
 	if(document.referrer !== undefined && document.referrer != "") {
-		location.href = document.referrer;
-	} else {
-		location.href = defaultUrl;
+		if(document.referrer.indexOf("login.html") == -1) {
+			location.href = document.referrer;
+			return;
+		}
 	}
+
+	location.href = defaultUrl;
 }
 
 /**