From c626f48aae2728b3ba5d1a8d99b0713bee678271 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 5 Mar 2009 21:36:35 +0000 Subject: [PATCH] - MGR: Newer versions of the server-side software publish their master url in the response to the get_project_config.php request. If it exists use it over what was specified by the user. Fixes #259 clientgui/ AccountManagerProcessingPage.cpp ProjectProcessingPage.cpp svn path=/trunk/boinc/; revision=17513 --- checkin_notes | 10 ++++++++++ clientgui/AccountManagerProcessingPage.cpp | 11 ++++++++++- clientgui/ProjectProcessingPage.cpp | 9 ++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 4a323cd6d8..61ecc97a07 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2741,3 +2741,13 @@ Rom 5 Mar 2009 clientgui/ AccountManagerPropertiesPage.cpp ProjectPropertiesPage.cpp + +Rom 5 Mar 2009 + - MGR: Newer versions of the server-side software publish their + master url in the response to the get_project_config.php + request. If it exists use it over what was specified + by the user. Fixes #259 + + clientgui/ + AccountManagerProcessingPage.cpp + ProjectProcessingPage.cpp diff --git a/clientgui/AccountManagerProcessingPage.cpp b/clientgui/AccountManagerProcessingPage.cpp index faf5504154..15036bd13f 100644 --- a/clientgui/AccountManagerProcessingPage.cpp +++ b/clientgui/AccountManagerProcessingPage.cpp @@ -257,7 +257,16 @@ void CAccountManagerProcessingPage::OnStateChange( CAccountManagerProcessingPage break; case ATTACHACCTMGR_ATTACHACCTMGR_EXECUTE: // Attempt to attach to the accout manager. - url = (const char*)pWAM->m_AccountManagerInfoPage->GetProjectURL().mb_str(); + + // Newer versions of the server-side software contain the correct + // master url in the get_project_config response. If it is available + // use it instead of what the user typed in. + if (!pWAM->project_config.master_url.empty()) { + url = pWAM->project_config.master_url; + } else { + url = (const char*)pWAM->m_AccountManagerInfoPage->GetProjectURL().mb_str(); + } + username = (const char*)pWAM->m_AccountInfoPage->GetAccountEmailAddress().mb_str(); password = (const char*)pWAM->m_AccountInfoPage->GetAccountPassword().mb_str(); pDoc->rpc.acct_mgr_rpc( diff --git a/clientgui/ProjectProcessingPage.cpp b/clientgui/ProjectProcessingPage.cpp index 2a9df607a1..e198df76e0 100644 --- a/clientgui/ProjectProcessingPage.cpp +++ b/clientgui/ProjectProcessingPage.cpp @@ -381,7 +381,14 @@ void CProjectProcessingPage::OnStateChange( CProjectProcessingPageEvent& WXUNUSE ai->clear(); ao->clear(); - ai->url = (const char*)pWAP->m_ProjectInfoPage->GetProjectURL().mb_str(); + // Newer versions of the server-side software contain the correct + // master url in the get_project_config response. If it is available + // use it instead of what the user typed in. + if (!pWAP->project_config.master_url.empty()) { + ai->url = pWAP->project_config.master_url; + } else { + ai->url = (const char*)pWAP->m_ProjectInfoPage->GetProjectURL().mb_str(); + } if (!pWAP->GetProjectAuthenticator().IsEmpty() || pWAP->m_bCredentialsCached ||