From 54d25c13d7a5f52d44680626c45d84d0193091a0 Mon Sep 17 00:00:00 2001
From: Unknwon <joe2010xtmf@163.com>
Date: Mon, 24 Nov 2014 18:47:59 -0500
Subject: Fix #543

---
 modules/middleware/auth.go | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'modules/middleware/auth.go')

diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index fc8e94bb..94bb1c14 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -29,6 +29,12 @@ func Toggle(options *ToggleOptions) macaron.Handler {
 			return
 		}
 
+		// Checking non-logged users landing page.
+		if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageUrl != setting.LANDING_PAGE_HOME {
+			ctx.Redirect(string(setting.LandingPageUrl))
+			return
+		}
+
 		// Redirect to dashboard if user tries to visit any non-login page.
 		if options.SignOutRequire && ctx.IsSigned && ctx.Req.RequestURI != "/" {
 			ctx.Redirect(setting.AppSubUrl + "/")
-- 
cgit v1.2.3