Exemple #1
0
 /// <summary>
 /// Authorize the users access from application (Logout)
 /// </summary>
 public static void Authorize()
 {
     try
     {
         var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();
         if (ticket != null)
         {
             var idKey = ticket.IdKey();
             if (idKey != Guid.Empty)
             {
                 using (var db = new DbContextHelper())
                 {
                     User user = ManageUserModelHelper.GetUser(db, idKey);
                     if (user != null)
                     {
                         user.UserStatusEnum = UserStatus.Offline;
                         db.SaveChanges();
                     }
                 } //end using
             }     //end if
         }         //end if
         FormsAuthentication.SignOut();
     }
     catch (Exception ex)
     {
         LogHelper.LogFatalError("UserModelHelper.Authorize", ex);
         throw ex;
     }
 }
Exemple #2
0
        void AuthenticateRequest(object sender, EventArgs e)
        {
            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                HttpContext.Current.User = new GenericPrincipal(new FormsIdentity(ticket), ticket.Roles().ToArray());
            }
        }
        public static HomeModel GetHomeModel()
        {
            var model  = new HomeModel();
            var quotes = QuoteModelHelper.GetAll();

            model.Quote = quotes.GetRandom();

            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                model.UserIdKey = ticket.IdKey();
            }

            return(model);
        }
        public static EventModel GetEventCalendarModel()
        {
            var model  = new EventModel();
            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                model.UserIdKey = ticket.IdKey();
            }

            model.PageTitle       = "Holy Angels Event Calendar";
            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }
        public static HomeModel GetChristianityModel()
        {
            var model = GetHomeModel();

            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                model.UserIdKey = ticket.IdKey();
            }

            model.PageTitle       = "Holy Angels African-American Christianity";
            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }
        public static HomeModel GetAboutModel()
        {
            var model = GetHomeModel();

            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                model.UserIdKey = ticket.IdKey();
            }

            model.PageTitle       = "About Holy Angels Church";
            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }
        internal static object GetPrivacyModel()
        {
            var model = GetHomeModel();

            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                model.UserIdKey = ticket.IdKey();
            }

            model.PageTitle       = "Holy Angels Church Privacy Policy";
            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }
        public static PaginationModel <MinistryModel> GetMinistryModel()
        {
            var model = CommonModelHelper.GetPaginatedModel <MinistryModel>(Constants.Sort_Column_Name, MvcContrib.Sorting.SortDirection.Ascending);

            model.GetPaginatedMinistries();

            var ticket = ManageUserModelHelper.GetFormsAuthenticationTicket();

            if (ticket != null)
            {
                model.UserIdKey = ticket.IdKey();
            }

            model.PageTitle       = "Holy Angels Church Ministries";
            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";

            return(model);
        }