Browse Source

Show login page or cp

Vova Tkach 6 years ago
parent
commit
4c0c52697f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      engine/backend/backend.go

+ 6 - 1
engine/backend/backend.go

@@ -30,5 +30,10 @@ func (this *Backend) Run() bool {
 	}
 
 	// Login page
-	return this.wrapper.TmplBackEnd(templates.CpLogin, nil)
+	if this.wrapper.Session.GetIntDef("UserId", 0) <= 0 {
+		return this.wrapper.TmplBackEnd(templates.CpLogin, nil)
+	}
+
+	(*this.wrapper.W).Write([]byte(`Admin panel here...`))
+	return true
 }