private void DoSignUp()
{
if (!_termsOfUseCheckBox.Checked)
{
MessageBox.Show(this,
LocalizationManager.GetString("PublishTab.Upload.Login.MustAgreeTerms",
"In order to sign up for a BloomLibrary.org account, you must check the box indicating that you agree to the BloomLibrary Terms of Use."),
LocalizationManager.GetString("PublishTab.Upload.Login.PleaseAgreeTerms", "Please agree to terms of use"),
MessageBoxButtons.OK);
return;
}
bool userExists;
try
{
userExists = _client.UserExists(_emailBox.Text);
}
catch (Exception e)
{
ErrorReport.NotifyUserOfProblem(e, LoginOrSignupConnectionFailedString);
return;
}
if (userExists)
{
if (
MessageBox.Show(this,
LocalizationManager.GetString("PublishTab.Upload.Login.AlreadyHaveAccount", "We cannot sign you up with that address, because we already have an account with that address. Would you like to log in instead?"),
LocalizationManager.GetString("PublishTab.Upload.Login.AccountAlreadyExists", "Account Already Exists"),
MessageBoxButtons.YesNo)
== DialogResult.Yes)
{
RestoreToLogin();
return;
}
}
try
{
_client.CreateUser(_emailBox.Text, _passwordBox.Text);
if (_client.LogIn(_emailBox.Text, _passwordBox.Text))
Close();
}
catch (Exception e)
{
ErrorReport.NotifyUserOfProblem(e, LoginOrSignupConnectionFailedString);
}
}