示例#1
0
        public ActionResult Unlock(UnlockerModel model)
        {
            var algorithm = new SHA256Cng();
            var unicoding = new UnicodeEncoding();
            var hashed    = unicoding.GetString(algorithm.ComputeHash(unicoding.GetBytes(model.Passphrase)));

            if (hashed == "嘃ᥐ倹⦦듑ꈳ囬쀺诫谾臭ᰠ屯")
            {
                FormsAuthentication.SetAuthCookie("Manager", false);
                var url = Handy.BaseUrl() + (model.ReturnUrl ?? Url.Action("Unlock"));
                return(Redirect(url));
            }
            ModelState.AddModelError("AuthenticationFailed", "Wrong Passphrase");
            return(View());
        }
示例#2
0
 public ActionResult Lock()
 {
     FormsAuthentication.SignOut();
     return(Redirect(Handy.BaseUrl() + "/Home"));
 }
示例#3
0
 public string Permalink(UrlHelper url)
 {
     return(string.Format("{0}{1}/{2}", Handy.BaseUrl(), url.Action("Post", "Blog"), Slug));
 }
示例#4
0
 public string ThumbnailLink(UrlHelper url)
 {
     return(string.Format("{0}{1}/{2}", Handy.BaseUrl(), url.Action("Thumbnail", "Blog"), Slug));
 }