Esempio n. 1
0
        //[Authorize()]
        public ActionResult Index()
        {
            //if (String.IsNullOrEmpty(Beyondbit.SingleSignOn.ClientForAspNet20.SSOClient.UserUid))
            //{
            //    string SSO_SignOnUrl = ConfigurationManager.AppSettings["SSO_SignOnUrl"];
            //    return Redirect(SSO_SignOnUrl);
            //}
            const string menucachekey = "__UserMenu";

            List <AccordionItem> menuList;

            SessionCache.Clear();
            if (SessionCache.Contains(menucachekey))
            {
                menuList = SessionCache.Get(menucachekey) as List <AccordionItem>;
                if (menuList == null)
                {
                    menuList = new List <AccordionItem>();
                }
            }
            else
            {
                if (Beyondbit.SingleSignOn.ClientForAspNet20.SSOClient.UserUid == null)
                {
                    menuList = SmartBox.Console.UserMenu.UserMenuFactory.GetUserMenuBO.GetCurrentUserMenu(this);
                    //menuList = GetCurrentUserMenu();
                }
                else
                {
                    menuList = GetCurrentUserMenuByBUA();
                }
                SessionCache.AddItem(menucachekey, menuList);
            }
            ViewData["CurrentUser"] = base.CurrentUser.FullName;
            ViewData["UserOrg"]     = base.CurrentUser.OrgName;

            return(View(menuList));
        }