示例#1
0
        private void createAccount()
        {
            String token = (_ticketRequired) ? ticketBox.Text : null;

            Tokens.IPAddress  = ServerDropDownList.SelectedValue.ToString();
            Tokens.ServerName = ServerDropDownList.SelectedItem.ToString();

            if (_modernAuthSupport == false)
            {
                ClassicAuth.Register(registerEmail.Text, SHA.HashPassword(registerPassword.Text), token);
            }
            else
            {
                ModernAuth.Register(registerEmail.Text, registerPassword.Text, token);
            }

            if (!String.IsNullOrEmpty(Tokens.Success))
            {
                MessageBox.Show(null, Tokens.Success, UserAgent.AgentAltName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                actionText.Text = Tokens.Success;

                tabControl1.Visible = true;
            }
            else
            {
                MessageBox.Show(null, Tokens.Error, UserAgent.AgentAltName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                actionText.Text = Tokens.Error;
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Tokens.Clear();
            if (!validateEmail(loginEmailBox.Text))
            {
                actionText.Text = "Please type your email!";
            }
            else if (String.IsNullOrEmpty(loginPasswordBox.Text))
            {
                actionText.Text = "Please type your password!";
            }
            else
            {
                Tokens.IPAddress  = ServerDropDownList.SelectedValue.ToString();
                Tokens.ServerName = ServerDropDownList.SelectedItem.ToString();

                if (_modernAuthSupport == false)
                {
                    ClassicAuth.Login(loginEmailBox.Text, SHA.HashPassword(loginPasswordBox.Text).ToLower());
                }
                else
                {
                    ModernAuth.Login(loginEmailBox.Text, loginPasswordBox.Text);
                }

                if (String.IsNullOrEmpty(Tokens.Error))
                {
                    if (!String.IsNullOrEmpty(Tokens.Warning))
                    {
                        MessageBox.Show(null, Tokens.Warning, UserAgent.AgentAltName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    //TODO: MODS GOES HERE
                    DoModNetJob();
                    //
                }
                else
                {
                    MessageBox.Show(null, Tokens.Error, UserAgent.AgentAltName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    actionText.Text = (String.IsNullOrEmpty(Tokens.Error)) ? "An error occurred." : Tokens.Error;
                }
            }
        }