Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // This come from an anonymous browser
        try
        {
            Page.MetaKeywords    = "Register, Send Whatsapp message, Free";
            Page.MetaDescription = "Register to use the service.";
            NiceASP.KeywordLoader.Load(this, NiceASP.KeywordLoader.Which.Register);

            string          query     = Request.QueryString["ApiGuId"];
            IMyLog          log       = MyLog.GetLogger("Register");
            LogForEmailSend log4Email = new LogForEmailSend(MyLog.GetLogger("Email"));

            if (query != null)
            {
                // email validation callback
                query = EMail.Base64_URLDecoding(query);
                MessageProcessing_API api = new MessageProcessing_API(query);
                bool good;
                api.Process_Registration_JustVerified(NiceSystemInfo.DEFAULT, out good, false, true, log, log4Email);
                if (good)
                {
                    // good,
                    SessionData sd = ConstantStrings.GetSessionData(Session);
                    sd.QuickMessage     = "Your email is now verified. Please wait 48 hour for your account to become active.";
                    sd.QuickMessageGood = true;
                    Response.Redirect("~/Login.aspx");
                }
                else
                {
                    // bad
                    SessionData sd = ConstantStrings.GetSessionData(Session);
                    sd.QuickMessage     = "This token is expired.";
                    sd.QuickMessageGood = false;
                    Response.Redirect("~/");
                }
            }
        }
        catch (DataUnavailableException)
        {
            DSSwitch.OnDataUnavailableException(this);
        }
    }