예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Request.QueryString["code"] != null) && (Request.QueryString["code"] != ""))
            {
                //a code is present
                string code = Request.QueryString["code"].ToString();
                DataSet dstemp = Peerfx_DB.SPs.ViewUsersVerifiedByCodeNouserkey(code, 1).GetDataSet();
                if (dstemp.Tables[0].Rows.Count > 0)
                {
                    //code is correct
                    int user_key = Convert.ToInt32(dstemp.Tables[0].Rows[0]["user_key"]);
                    Site sitetemp = new Site();
                    Peerfx_DB.SPs.UpdateVerificationEmail(user_key, true, sitetemp.get_ipaddress(), code).Execute();

                    Users currentuser = sitetemp.get_user_info(user_key);

                    lblverificationresposne.Text = "Thank you " + currentuser.Full_name + ", your email (" + currentuser.Email + ") has been verified. Your account is now Active.";

                    //For now change user's status to Active
                    Peerfx_DB.SPs.UpdateUsersStatus(user_key, 5).Execute();

                    //Send email to confirm validation
                    Peerfx.External_APIs.SendGrid se = new External_APIs.SendGrid();
                    se.Send_Email_Verification_Confirmed(user_key);

                    sitetemp.VerificationReward(1, user_key);
                    mx.TrackEvent("Verification - Email Connected", user_key, null);
                }
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataSet dstemp = Peerfx_DB.SPs.ViewErrorsLastone().GetDataSet();
            string strEventTime = "Time";
            if (dstemp.Tables[0].Rows[0]["EventTime"] != DBNull.Value)
            {
                strEventTime = dstemp.Tables[0].Rows[0]["EventTime"].ToString();
            }
            string strRequestURL = "URL";
            if (dstemp.Tables[0].Rows[0]["RequestURL"] != DBNull.Value)
            {
                strRequestURL = dstemp.Tables[0].Rows[0]["RequestURL"].ToString();
            }
            string strDetails = "Details";
            if (dstemp.Tables[0].Rows[0]["Details"] != DBNull.Value)
            {
                strDetails = dstemp.Tables[0].Rows[0]["Details"].ToString();
            }

            string thebody = System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/Emails/ErrorEmail.txt"));
            thebody = thebody.Replace("TIMEERROR", strEventTime);
            thebody = thebody.Replace("URLERROR", strRequestURL);
            thebody = thebody.Replace("DETAILSERROR", strDetails);
            string Toemail = System.Configuration.ConfigurationSettings.AppSettings.Get("ErrorToEmail").ToString();

            SendGrid sg = new SendGrid();
            sg.SimpleEmail("Lorne", "Passportfx Error", Toemail, "*****@*****.**", thebody, "Passportfx Error");
        }
예제 #3
0
        protected void btnsignup_Click(object sender, EventArgs e)
        {
            //check if email exists
            DataTable dttemp = Peerfx_DB.SPs.ViewUsersEmail(txtemail.Text).GetDataSet().Tables[0];
            if (dttemp.Rows.Count > 0)
            {
                //user exists
                lblerror.Text = "Email address already Signed Up";
            }
            else if (txtemail.Text == "")
            {
                lblerror.Text = "Please enter email address";
            }
            else if (!sitetemp.IsValidEmail(txtemail.Text))
            {
                lblerror.Text = "Please enter a valid email address";
            }
            else if (txtfirstname.Text == "")
            {
                lblerror.Text = "Please enter first name";
            }
            else if (txtlastname.Text == "")
            {
                lblerror.Text = "Please enter last name";
            }
            else if (txtpassword.Text == "")
            {
                lblerror.Text = "Please enter password";
            }
            else
            {
                //sign up user & log them in
                StoredProcedure sp_UpdateSignup1 = Peerfx_DB.SPs.UpdateUsers(0, "", txtfirstname.Text, "", txtlastname.Text, null, null, txtemail.Text, HttpContext.Current.Request.UserHostAddress, 0);
                sp_UpdateSignup1.Execute();

                int temp_user_key = Convert.ToInt32(sp_UpdateSignup1.Command.Parameters[9].ParameterValue.ToString());

                Peerfx_DB.SPs.UpdateUsersInfo(temp_user_key, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null).Execute();

                Peerfx_DB.SPs.UpdateUsersInfoSignupTab3(temp_user_key, "", txtpassword.Text).Execute();

                mx.TrackEvent("Sign Up", temp_user_key, null);

                Users user = sitetemp.view_users_info_email(txtemail.Text);
                HttpContext.Current.Session["currentuser"] = user;
                //Response.Redirect("/User/Dashboard.aspx");

                //send verification email
                External_APIs.SendGrid sg = new External_APIs.SendGrid();
                sg.Send_Email_Verification(temp_user_key);

                Page.ClientScript.RegisterStartupScript(GetType(), "h", "Loginuser();", true);
            }
        }
예제 #4
0
파일: Mixpanel.cs 프로젝트: Lornestar/pfx
        private string Web_Request(Hashtable hstemp)
        {
            string url = ConfigurationSettings.AppSettings["Mixpanelurl"];

            HttpWebResponse webResponse;

            string request = JsonConvert.SerializeObject(hstemp);
            request = sitetemp.EncodeTo64(request).ToString();
            url += request;

            // Create request object
            HttpWebRequest webRequest = WebRequest.Create(url) as HttpWebRequest;
            webRequest.ContentType = "application/x-www-form-urlencoded";
            webRequest.MediaType = "application/x-www-form-urlencoded";
            webRequest.Method = "GET";

            string responseString = "";
            try
            {

                // Get the response from the request object and verify the status
                webResponse = webRequest.GetResponse() as HttpWebResponse;
                if (!webRequest.HaveResponse)
                {
                    throw new Exception();
                }
                if (webResponse.StatusCode != HttpStatusCode.OK && webResponse.StatusCode != HttpStatusCode.Accepted)
                {
                    throw new Exception();
                }

                // Read the response string
                StreamReader reader = new StreamReader(webResponse.GetResponseStream());
                responseString = reader.ReadToEnd();
                reader.Close();
            }
            catch (Exception e)
            {
                Peerfx_DB.SPs.UpdateApiErrors(2, request, e.Message, url).Execute();
                string Toemail = System.Configuration.ConfigurationSettings.AppSettings.Get("ErrorToEmail").ToString();
                SendGrid sg = new SendGrid();
                sg.SimpleEmail("Lorne", "Passportfx API Error", Toemail, "*****@*****.**", e.Message, "Mixpanel Error");
            }

            return responseString;
        }
예제 #5
0
        protected void btnContinue3_Click(object sender, EventArgs e)
        {
            //check captcha
            RadCaptcha1.Validate();
            if (RadCaptcha1.IsValid)
            {
                //save to db
                Peerfx_DB.SPs.UpdateUsersSecurityAnswers(user_key, Convert.ToInt32(ddlSecurityQuestion1.SelectedValue), txtSecurityAnswer1.Text).Execute();
                Peerfx_DB.SPs.UpdateUsersSecurityAnswers(user_key, Convert.ToInt32(ddlSecurityQuestion2.SelectedValue), txtSecurityAnswer2.Text).Execute();
                Peerfx_DB.SPs.UpdateUsersSecurityAnswers(user_key, Convert.ToInt32(ddlSecurityQuestion3.SelectedValue), txtSecurityAnswer3.Text).Execute();

                Peerfx_DB.SPs.UpdateUsersInfoSignupTab3(user_key, txtUsername.Text, txtPassword.Text).Execute();

                //mixpanel

                //go to next screen
                changetab(3);

                //made it to confirmation screen
                DataTable dtuserinfo = Master.view_users_info_dt(user_key);
                lblemailaddress.Text = dtuserinfo.Rows[0]["email"].ToString();
                lblemailaddress2.Text = lblemailaddress.Text;
                lblclientnumber.Text = dtuserinfo.Rows[0]["user_key"].ToString();

                //send verification email
                External_APIs.SendGrid sg = new External_APIs.SendGrid();
                sg.Send_Email_Verification(user_key);
            }
            else
            {
            }
        }