Exemplo n.º 1
0
        public ActionResult RedirectToPhotoMan(string functionID)
        {
            Member member = new Member("users");
            Hashtable user = member.getBySession();
            bool passRoleChecking = false;
            string redirectURL = Url.Action("Logout", "Desktop");

            #region Check Role
            if (user != null)
            {
                int? typeID = (int?)user["type_id"];
                if (typeID.HasValue)
                {
                    Permission permission = new Permission(typeID.Value);
                    String[] permissionStringArray = permission.get();
                    if (permissionStringArray.Contains(functionID)) passRoleChecking = true;
                }
            }
            #endregion Check Role

            if (passRoleChecking)
            {
                int userID = (int)user["id"];
                string tokenID = TokenManager.Current.Add(userID.ToString());
                redirectURL = string.Format(@"{0}/PhotoManagement/Home/RedirectFromWom?userID={1}&tokenID={2}&functionID={3}",
                                            System.Configuration.ConfigurationManager.AppSettings["UriPhotoManUI"],
                                            userID,
                                            tokenID,
                                            functionID);
                //redirectURL = string.Format(@"{0}/PhotoManagement",
                //                            System.Configuration.ConfigurationManager.AppSettings["PhotoManUrl"]);
            }

            return Redirect(redirectURL);
        }
Exemplo n.º 2
0
 public ActionResult Index()
 {
     Member _member = new Member("users");
     Hashtable user = _member.getBySession();
     Permission _permission = new Permission(Convert.ToInt32(user["type_id"]));
     string[] permission = _permission.get();
     OrderedDictionary application = new OrderedDictionary();
     if(permission.Length > 0)
     {
         ArrayList apps = this.getApplication();
         if(apps.Count > 0)
         {
             foreach (Hashtable item in apps)
             {
                 if (permission.Contains(item["id"]))
                 {
                     application["app" + item["id"]] = new Hashtable() {
                         {"name",            item["title"]},
                         {"setting",         "/desktop/application/" + item["id"]},
                         {"path",            "/"},
                         {"showOnDesktop",    true}
                     };
                 }
             }
         }
     }
     ViewBag.application = application;
     return View();
 }