コード例 #1
0
 public ActionResult Logout()
 {
     _authentication = new O7Authentication(Session);
     _authentication.RemoveUser();
     _authentication.RemoveMenus();
     return(Redirect(LinkHelper.SourceLink("Security", "Signout")));
 }
コード例 #2
0
        public ActionResult Access(string menuId, string credential)
        {
            if (string.IsNullOrEmpty(credential))
            {
                return(null);
            }

            _authentication = new O7Authentication(Session);

            var credentialCookie = make_credential_cookie(credential);

            authenticate_user(credentialCookie);

            var argDomain = new object[] { credentialCookie.Login, credentialCookie.Password };
            var argFlow   = new object[] { credentialCookie.Login };

            var domain = O7DomainInstanceMaker.MakeInstance <SecurityFlow, BasicFlow>(argDomain, argFlow);
            var menus  = domain.Menus(credentialCookie.CompanyId, credentialCookie.BranchId, menuId);

            var menusResult = menus as O7SuccessResponse <List <O7Menu> >;

            if (menusResult == null)
            {
                return(null);
            }

            _authentication.SetMenu(menusResult.Value1);

            return(RedirectToAction("Index", "Home"));
        }
コード例 #3
0
        public ActionResult Access(string menuId, string credential)
        {
            if (string.IsNullOrEmpty(credential))
            {
                return(null);
            }
            _authentication = new O7Authentication(Session);
            var credentialCookie = make_credential_cookie(credential);

            authenticate_user(credentialCookie);

            var domain = ProxyDomain.Instance.SecurityDomain(credentialCookie.Login, credentialCookie.Password);
            var menus  = domain.Menus(credentialCookie.CompanyId, credentialCookie.BranchId, menuId);

            var menusResult = menus as O7SuccessResponse <List <O7Menu> >;

            if (menusResult == null)
            {
                return(null);
            }

            _authentication.SetMenu(menusResult.Value1);

            var modules       = domain.AnotherModules(credentialCookie.CompanyId, credentialCookie.BranchId, menuId);
            var modulesResult = modules as O7SuccessResponse <List <O7Module> >;

            if (modulesResult == null)
            {
                return(null);
            }

            modulesResult.Value1.Append("Url", credential.ToUriPath());
            _authentication.SetModule(modulesResult.Value1);

            return(RedirectToAction("Index", "Home"));
        }