Beispiel #1
0
    protected void SubcriberClick(object sender, EventArgs e)
    {
        lblout.Text = "";
        SubscriberContent  newsub = new SubscriberContent();
        alamaat_subscriber user   = newsub.Getuserbyemail(tbemail.Text);

        if (user != null)
        {
            if (user.active)
            {
                lblout.Text = "Email already exist.";
                return;
            }
        }
        SubscriberInterface newitem = new SubscriberInterface();

        newitem.ID     = Guid.NewGuid();
        newitem.Email  = tbemail.Text;
        newitem.Active = false;
        if (newsub.InsertSubscriber(newitem))
        {
            if (SendEmail(tbemail.Text, newitem.ID.ToString()))
            {
                lblout.Text = "please verify your email account by clicking the activation link that has been send to your email.";
            }
            tbemail.Text = "";
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id  = Request.QueryString["id"];
        string sid = Request.QueryString["sid"];

        if (id != null)
        {
            UserContent  usercontent = new UserContent();
            alamaat_User currentuser = usercontent.GetuserById(id);
            if (currentuser != null)
            {
                if (currentuser.block == false)
                {
                    currentuser.active = true;
                    if (usercontent.UpdateUser(currentuser))
                    {
                        lblactivation.Text = "You have successfully activated your account.";
                    }
                }
                else
                {
                    lblactivation.Text = "User account is already activated.";
                }
            }
        }
        else if (sid != null)
        {
            SubscriberContent  usercontent = new SubscriberContent();
            alamaat_subscriber user        = usercontent.Getuserbyid(sid);
            if (user != null)
            {
                if (user.active == false)
                {
                    user.active = true;
                    if (usercontent.UpdateSubscriber(user))
                    {
                        lblactivation.Text = "You have successfully verified your email.";
                    }
                }
                else
                {
                    lblactivation.Text = "Email is already verified.";
                }
            }
        }
        else
        {
            Response.Redirect("~/Default.aspx");
        }
    }