Esempio n. 1
0
        public ActionResult EditUser(string id)
        {
            var principal = System.Security.Claims.ClaimsPrincipal.Current;
            var isAdmin   = principal.HasClaim(ClaimTypes.Role, "admin");

            WWIDal dal = new WWIDal();

            return(View(dal.GetUser(id)));
        }
Esempio n. 2
0
        public ActionResult SendConfirmEmail(string id)
        {
            string stamp = Guid.NewGuid().ToString();
            string body  = string.Format(@"http://localhost:62844/Administration/ConfirmEmail?Id={0}&stamp={1}", id, stamp);

            if (WWIDal.UpdateSecurityStamp(id, stamp))
            {
                WWIDal dal = new WWIDal();
                AspNetEditUserModel model = dal.GetUser(id);
                MailHelper.SendMail(WWIDal.GetUserEmail(id), body, "Email Confirmation for " + model.UserName);
            }
            return(RedirectToAction("EditUser", new { Id = id }));
        }