コード例 #1
0
ファイル: KickPage.cs プロジェクト: bsimser/dotnetkicks
        //  Private Methods

        /// <summary>
        /// Performs the security checks.
        /// </summary>
        private void PerformSecurityChecks()
        {
            if (IsMemberPage && !IsAuthenticated)
            {
                Response.Redirect(UrlFactory.CreateUrl(UrlFactory.PageName.Login, Request.Url.ToString()));
            }

            if (!KickUserProfile.HasRoles(RequiredRoles))
            {
                NotAuthorisedRedirect();
            }
        }
コード例 #2
0
        public void SaveColorPreferences(string kickItTextColor, string kickItBackgroundColor, string kickCountTextColor, string kickCountBackgroundColor, string borderColor)
        {
            if (!KickUserProfile.IsGuest)
            {
                KickUserProfile.KickItTextColor          = kickItTextColor;
                KickUserProfile.KickItBackgroundColor    = kickItBackgroundColor;
                KickUserProfile.KickCountTextColor       = kickCountTextColor;
                KickUserProfile.KickCountBackgroundColor = kickCountBackgroundColor;
                KickUserProfile.KickImageBorderColor     = borderColor;

                KickUserProfile.Save();
            }
        }