From 02b598485cb0ca7df3592d6bb2df2adfb8eb6dd5 Mon Sep 17 00:00:00 2001 From: davidpanderson Date: Sun, 12 Apr 2020 15:26:31 -0700 Subject: [PATCH] Manager: don't let user attach to account manager as a project. --- clientgui/ProjectPropertiesPage.cpp | 36 ++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/clientgui/ProjectPropertiesPage.cpp b/clientgui/ProjectPropertiesPage.cpp index 2e1a689ddc..3c90fce6ce 100644 --- a/clientgui/ProjectPropertiesPage.cpp +++ b/clientgui/ProjectPropertiesPage.cpp @@ -420,19 +420,29 @@ void CProjectPropertiesPage::OnStateChange( CProjectPropertiesPageEvent& WXUNUSE if ( !iReturnValue && (!pc->error_num || pc->error_num == ERR_ACCT_CREATION_DISABLED) - ) { - // We either successfully retrieved the project's - // account creation policies or we were able to talk - // to the web server and found out they do not support - // account creation through the wizard. - // In either case, claim success and set the correct flags - // to show the correct 'next' page. - // - SetProjectPropertiesSucceeded(true); - SetProjectAccountCreationDisabled(pc->account_creation_disabled); - SetProjectClientAccountCreationDisabled(pc->client_account_creation_disabled); - SetTermsOfUseRequired(!pc->terms_of_use.empty()); - + ) { + if (pc->account_manager) { + // user tried to attach an account manager as a project + // + SetProjectPropertiesSucceeded(false); + SetServerReportedError(true); + strBuffer = pWAP->m_CompletionErrorPage->m_pServerMessagesCtrl->GetLabel(); + strBuffer += wxString(pc->name); + strBuffer += wxString(wxT(" is an account manager, not a project.\nSelect Tools / Use account manager.\n")); + pWAP->m_CompletionErrorPage->m_pServerMessagesCtrl->SetLabel(strBuffer); + } else { + // We either successfully retrieved the project's + // account creation policies or we were able to talk + // to the web server and found out they do not support + // account creation through the wizard. + // In either case, claim success and set the correct flags + // to show the correct 'next' page. + // + SetProjectPropertiesSucceeded(true); + SetProjectAccountCreationDisabled(pc->account_creation_disabled); + SetProjectClientAccountCreationDisabled(pc->client_account_creation_disabled); + SetTermsOfUseRequired(!pc->terms_of_use.empty()); + } } else { SetProjectPropertiesSucceeded(false);