Ejemplo n.º 1
0
        public ActionResult ConfirmEmail(string code)
        {
            var text   = EmbedRsaCryptoService.XorDecryptSafeBase64(code);
            var frags  = text.Split('|');
            var userId = int.Parse(frags[0]);

            var  userSrv = StaticServiceFactory.Create <IAspNetUserService>();
            var  user    = userSrv.GetEntity(userId, null);
            bool result  = false;

            if (String.Compare(user.Email, frags[1], true) == 0)
            {
                user.EmailConfirmed = true;
                userSrv.Save(user);
                result = true;
            }
            var    msgSrv  = StaticServiceFactory.Create <ISystemMessageService>();
            string message = null;

            if (result)
            {
                message = msgSrv.GetByCode(SeatDomain.Constants.Messages.email_confirmed);
            }
            else
            {
                message = msgSrv.GetByCode(SeatDomain.Constants.Messages.email_not_confirmed);
            }

            return(View(message));
        }
Ejemplo n.º 2
0
        public Stream GetFile(string enc_file_path)
        {
            var file_path = EmbedRsaCryptoService.XorDecryptSafeBase64(enc_file_path);

            return(FileSystemProvider.Instance.FileStream(file_path, FileMode.Open, FileAccess.Read, FileShare.Read));
        }