Пример #1
0
        public void Submit()
        {
            if (Helpers.SessionVariables.Instance.LoggedIn == false)
            {
                return;
            }


            try
            {
                string subject = Helpers.GlobalHelper.RequestEncodedParam("subject");
                string message = Helpers.GlobalHelper.RequestEncodedParam("supportrequest");

                message = "User Id: " + Helpers.SessionVariables.Instance.UserId + System.Environment.NewLine +
                          "Email: " + Helpers.SessionVariables.Instance.Username + System.Environment.NewLine + System.Environment.NewLine +
                          message;

                var email = new LibLogic.Email.LiveEmail();
                email.SendMail_BackgroundThread(message, subject, "*****@*****.**", false, null, LibLogic.Email.EmailTemplates.None);

                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.OK;
                this.HttpContext.Response.Redirect("/support/thankyou", false);
            }
            catch (LibLogic.Exceptions.InvalidDataException ide)
            {
                LibLogic.Helpers.Logging.Log(ide);
                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
                this.HttpContext.Response.Write(ide.Message);
            }
            catch (Exception ex)
            {
                LibLogic.Helpers.Logging.Log(ex);
                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
            }
        }
Пример #2
0
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         var    email    = new LibLogic.Email.LiveEmail();
         string username = Helpers.GlobalHelper.RequestEncodedParam("username");
         var    resetPSW = new LibLogic.Accounts.ResetPassword(email);
         resetPSW.sendPasswordLink(username);
     }
     catch (LibLogic.Exceptions.InvalidDataException ide) {
         context.Response.StatusCode = (int)System.Net.HttpStatusCode.Forbidden;
         context.Response.Write(ide.Message);
     }
     catch (Exception ex) {
         context.Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
         context.Response.Write(ex.Message);
     }
 }
Пример #3
0
        public void CreateUser()
        {
            try
            {
                string password        = Helpers.GlobalHelper.RequestEncodedParam("password");
                string confirmPassword = Helpers.GlobalHelper.RequestEncodedParam("passwordconfirm");
                string email           = Helpers.GlobalHelper.RequestEncodedParam("email");
                string confirmEmail    = Helpers.GlobalHelper.RequestEncodedParam("emailconfirm");
                string firstname       = Helpers.GlobalHelper.RequestEncodedParam("firstname");
                string lastname        = Helpers.GlobalHelper.RequestEncodedParam("lastname");
                string betakey         = Helpers.GlobalHelper.RequestEncodedParam("betakey");

                var emailFake = new LibLogic.Email.LiveEmail();

                var account = new LibLogic.Accounts.CreateAccount(
                    new LibLogic.Accounts.CreateAccountInfo()
                {
                    Email           = email,
                    EmailConfirm    = confirmEmail,
                    Firstname       = firstname,
                    Lastname        = lastname,
                    Password        = password,
                    PasswordConfirm = confirmPassword,
                    BetaKey         = betakey
                },
                    emailFake
                    );
                account.Execute();

                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.OK;
            }
            catch (LibLogic.Exceptions.InvalidDataException ide)
            {
                LibLogic.Helpers.Logging.Log(ide);
                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
                this.HttpContext.Response.Write(ide.Message);
            }
            catch (Exception ex)
            {
                LibLogic.Helpers.Logging.Log(ex);
                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
            }
        }
Пример #4
0
        protected void Application_Start(object sender, EventArgs e)
        {
            RegisterWebFormRoutes(RouteTable.Routes);
            RegisterRazorRoutes(RouteTable.Routes);

            var mySqlInstance = System.Configuration.ConfigurationManager.AppSettings["MySqlInstance"].ToString();
            var mySqlDatabase = System.Configuration.ConfigurationManager.AppSettings["MySqlDatabase"].ToString();
            var email         = new LibLogic.Email.LiveEmail();
            var setup         = new LibLogic.Setup(mySqlInstance, mySqlDatabase, email, false);

            try
            {
                setup.Execute();
            }
            catch (Exception ex)
            {
                LibLogic.Helpers.Logging.Log(ex);
                email.SendMail_BackgroundThread("It appears the server setup failed: " + ex.Message,
                                                "MajorsilnceVPN setup failure on application_start", LibLogic.Helpers.SiteInfo.AdminEmail, false, null);
            }
        }
Пример #5
0
        public void ProcessRequest(HttpContext context)
        {
            string resetCode = Helpers.GlobalHelper.RequestEncodedParam("code");
            string cnewpsw   = Helpers.GlobalHelper.RequestEncodedParam("cnewpsw");
            string newpsw    = Helpers.GlobalHelper.RequestEncodedParam("newpsw");

            if (!string.IsNullOrEmpty(resetCode) && !string.IsNullOrEmpty(cnewpsw) && !string.IsNullOrEmpty(newpsw))
            {
                if (cnewpsw != newpsw)
                {
                    throw new HttpException(400, "Password and Confirm Password should match");
                }
                var email    = new LibLogic.Email.LiveEmail();
                var resetPSW = new LibLogic.Accounts.ResetPassword(email);
                resetPSW.validateCode(resetCode, newpsw);
                context.Response.StatusCode = 250;
            }
            else
            {
                throw new HttpException(400, "Invalid Data");
            }
        }