Exemple #1
0
    protected void SendSMS_Click(object sender, EventArgs e)
    {
        try
        {
            AppSettings.Proxy.Reload();
            Member User = new Member(Request.QueryString["username"].Replace("'", ""));

            if (User.UnconfirmedSMSSent > 0)
            {
                ErrorMessagePanel2.Visible = true;
                ErrorMessage2.Text         = L1.ALREADYSENT + "(+" + User.PhoneCountryCode + " " + User.PhoneNumber + ")";
            }
            else if (User.Status == MemberStatus.AwaitingSMSPIN)
            {
                string pin = ProxStop.SendSMSWithPIN(CC.Text, PHONE.Text);
                Session["HASHEDCODE"] = Prem.PTC.Members.MemberAuthenticationService.ComputeHash(pin.ToString());

                SMSPanel1.Visible = false;
                SMSPanel2.Visible = true;

                User.UnconfirmedSMSSent++;
                User.PhoneCountryCode = CC.Text.Trim();
                User.PhoneNumber      = PHONE.Text.Trim();
                User.Save();
            }
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
        }
    }
Exemple #2
0
    /// <summary>
    /// Checks if given IP is a Proxy or not
    /// </summary>
    /// <param name="ip"></param>
    /// <returns></returns>
    public static bool IsProxy(string ip)
    {
        if (AppSettings.Proxy.ProxyProviderType == ProxyProviderType.BlockedCom && !string.IsNullOrEmpty(AppSettings.Proxy.BlockScriptApiKey))
        {
            return(!BlockScript.IsIPOk(ip));
        }

        if (AppSettings.Proxy.ProxyProviderType == ProxyProviderType.ProxStop && !string.IsNullOrEmpty(AppSettings.Proxy.ProxStopApiKey))
        {
            return(!ProxStop.IsIPOk(ip));
        }

        if (AppSettings.Proxy.ProxyProviderType == ProxyProviderType.IpQualityScore && !string.IsNullOrEmpty(AppSettings.Proxy.IpQualityScoreKey))
        {
            return(!IpQualityScore.IsIPOk(ip));
        }

        //If no tools are available, we can't check it
        return(false);
    }
Exemple #3
0
    protected void TryValidateCryptocurrencyWithdrawalByEmailOrPhone()
    {
        if (AppSettings.Payments.WithdrawalEmailEnabled)
        {
            CryptoPINTextBox.Enabled = false;
            VerificationCode.Create(User.Id, Mailer.SendCodeVerificationEmail(Member.CurrentInCache.Email));
            ConfirmationCodePlaceHolder.Visible       = true;
            CryptocurrencySuccessMessagePanel.Visible = true;
            CryptocurrencySuccessMessageLiteral.Text  = string.Format(U6000.VERIFICATIONEMAILSENT, AppSettings.Payments.WithdrawalVerificationCodeValidForMinutes);
        }
        else if ((AppSettings.Proxy.SMSType == ProxySMSType.FirstCashout && !User.IsPhoneVerified) || AppSettings.Proxy.SMSType == ProxySMSType.EveryCashout)
        {
            if (!User.IsPhoneVerified)
            {
                User.RequireSMSPin();

                System.Web.Security.FormsAuthentication.SignOut();
                HttpContext.Current.Session.Abandon();
            }
            else
            {
                if (VerificationCode.ActiveCodeForUserExists(User.Id))
                {
                    CryptocurrencySuccessMessageLiteral.Text = L1.ALREADYSENT + "(+" + User.PhoneCountryCode + " " + User.PhoneNumber + ")";
                }
                else
                {
                    VerificationCode.Create(User.Id, Convert.ToInt32(ProxStop.SendSMSWithPIN(User.PhoneCountryCode, User.PhoneNumber)));
                    CryptocurrencySuccessMessageLiteral.Text = string.Format(U6000.VERIFICATIONSMSSENT, AppSettings.Payments.WithdrawalVerificationCodeValidForMinutes);
                    User.UnconfirmedSMSSent++;
                }
                ConfirmationCodePlaceHolder.Visible       = true;
                CryptocurrencySuccessMessagePanel.Visible = true;
                User.IsPhoneVerifiedBeforeCashout         = false;
                User.Save();
            }
        }
    }
Exemple #4
0
    protected void CashoutButton_Click(object sender, EventArgs e)
    {
        SuccMessagePanel.Visible  = false;
        ErrorMessagePanel.Visible = false;

        Member User = Member.Current;

        if (Page.IsValid)
        {
            try
            {
                AppSettings.DemoCheck();

                User.ValidatePIN(PIN.Text);

                if (AppSettings.Payments.WithdrawalEmailEnabled)
                {
                    VerificationCode.Create(User.Id, Mailer.SendCodeVerificationEmail(Member.CurrentInCache.Email));
                    ConfirmationCodePlaceHolder2.Visible = true;
                    CashoutButtonConfirm.Visible         = true;
                    SuccMessagePanel.Visible             = true;
                    SuccMessage.Text               = string.Format(U6000.VERIFICATIONEMAILSENT, AppSettings.Payments.WithdrawalVerificationCodeValidForMinutes);
                    CashoutButton.Visible          = false;
                    PIN.Enabled                    = false;
                    AmountToCashoutTextBox.Enabled = false;
                    Account.Enabled                = false;
                }
                else if ((AppSettings.Proxy.SMSType == ProxySMSType.FirstCashout && !User.IsPhoneVerified) ||
                         AppSettings.Proxy.SMSType == ProxySMSType.EveryCashout)
                {
                    if (!User.IsPhoneVerified)
                    {
                        User.RequireSMSPin();

                        System.Web.Security.FormsAuthentication.SignOut();
                        HttpContext.Current.Session.Abandon();
                    }
                    else
                    {
                        if (VerificationCode.ActiveCodeForUserExists(User.Id))
                        {
                            SuccMessage.Text = L1.ALREADYSENT + "(+" + User.PhoneCountryCode + " " + User.PhoneNumber +
                                               ")";
                        }
                        else
                        {
                            VerificationCode.Create(User.Id,
                                                    Convert.ToInt32(ProxStop.SendSMSWithPIN(User.PhoneCountryCode, User.PhoneNumber)));
                            SuccMessage.Text = string.Format(U6000.VERIFICATIONSMSSENT,
                                                             AppSettings.Payments.WithdrawalVerificationCodeValidForMinutes);
                            User.UnconfirmedSMSSent++;
                        }
                        ConfirmationCodePlaceHolder2.Visible = true;
                        CashoutButtonConfirm.Visible         = true;
                        SuccMessagePanel.Visible             = true;
                        User.IsPhoneVerifiedBeforeCashout    = false;
                        User.Save();
                    }
                    CashoutButton.Visible          = false;
                    PIN.Enabled                    = false;
                    AmountToCashoutTextBox.Enabled = false;
                    Account.Enabled                = false;
                }
                else
                {
                    CashoutButtonConfirm_Click(this, null);
                }
            }
            catch (Exception ex)
            {
                ErrorMessagePanel.Visible = true;
                ErrorMessage.Text         = ex.Message;
            }
        }
    }