org.openurp.starter.web.action.IndexAction.scala Maven / Gradle / Ivy
/*
* Copyright (C) 2014, The OpenURP Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
package org.openurp.starter.web.action
import org.beangle.ems.app.web.NavContext
import org.beangle.ems.app.{Ems, EmsApp}
import org.beangle.security.Securities
import org.beangle.security.realm.cas.{Cas, CasConfig}
import org.beangle.security.session.cache.CacheSessionRepo
import org.beangle.web.action.annotation.action
import org.beangle.web.action.context.ActionContext
import org.beangle.web.action.support.{ActionSupport, ServletSupport}
import org.beangle.web.action.view.View
import org.beangle.webmvc.support.action.EntityAction
import org.openurp.base.model.Project
/**
* @author chaostone
*/
@action("")
class IndexAction extends ActionSupport, ServletSupport {
var casConfig: CasConfig = _
var sessionRepo: CacheSessionRepo = _
def index(): View = {
put("nav", NavContext.get(request))
put("ems", Ems)
put("locale", ActionContext.current.locale)
forward()
}
def welcome(): View = {
redirect(to(Ems.portal + "/index/appNotice?app=" + EmsApp.name),"")
}
def logout(): View = {
Securities.session foreach { s =>
sessionRepo.evict(s.id)
}
redirect(to(Cas.cleanup(casConfig, ActionContext.current.request, ActionContext.current.response)), null)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy