deprecated-oc-search/controllers/user.go
2023-08-26 22:04:56 +02:00

26 lines
505 B
Go

package controllers
import (
beego "github.com/beego/beego/v2/server/web"
)
// UserController is the controller in chrage of solr
type UserController struct {
beego.Controller
}
// Prepare checks for logged in User
func (c *UserController) Prepare() {
login, _ := c.GetSession("login").(string)
if login == "" {
c.Ctx.Redirect(302, "/login")
}
}
// Get implements simple solr User
func (c *UserController) Get() {
c.Data["login"], _ = c.GetSession("login").(string)
c.TplName = "user.tpl"
}