mirror of https://github.com/BOINC/boinc.git
- MGR: Introduce the cookie detection failure URL to the
acct_mgr_logon.xml file. If the cookies cannot be found provide a hyperlink control on the AcctountInfo page in the wizard which will point to a fallback URL the user can go to to find out what logon credentials to use. client/ acct_mgr.cpp, .h gui_rpc_server_ops.cpp clientgui/ AccountInfoPage.cpp, .h BOINCWizards.h WizardAttachProject.cpp, .h lib/ gui_rpc_client.h gui_rpc_client_ops.cpp svn path=/trunk/boinc/; revision=18400
This commit is contained in:
parent
06da777ef5
commit
674437a3bc
|
@ -5557,3 +5557,21 @@ Rom 11 June 2009
|
|||
browser.cpp, .h
|
||||
CompletionPage.cpp
|
||||
WizardAttachProject.cpp, .h
|
||||
|
||||
Rom 11 June 2009
|
||||
- MGR: Introduce the cookie detection failure URL to the
|
||||
acct_mgr_logon.xml file. If the cookies cannot be found provide
|
||||
a hyperlink control on the AcctountInfo page in the wizard
|
||||
which will point to a fallback URL the user can go to to
|
||||
find out what logon credentials to use.
|
||||
|
||||
client/
|
||||
acct_mgr.cpp, .h
|
||||
gui_rpc_server_ops.cpp
|
||||
clientgui/
|
||||
AccountInfoPage.cpp, .h
|
||||
BOINCWizards.h
|
||||
WizardAttachProject.cpp, .h
|
||||
lib/
|
||||
gui_rpc_client.h
|
||||
gui_rpc_client_ops.cpp
|
||||
|
|
|
@ -654,6 +654,8 @@ int ACCT_MGR_INFO::init() {
|
|||
retval = xp.element_contents("</signing_key>", signing_key, sizeof(signing_key));
|
||||
continue;
|
||||
}
|
||||
else if (xp.parse_bool(tag, "cookie_required", cookie_required)) continue;
|
||||
else if (xp.parse_str(tag, "cookie_failure_url", cookie_failure_url, 256)) continue;
|
||||
if (log_flags.unparsed_xml) {
|
||||
msg_printf(NULL, MSG_INFO,
|
||||
"[unparsed_xml] ACCT_MGR_INFO::init: unrecognized %s", tag
|
||||
|
|
|
@ -46,6 +46,16 @@ struct ACCT_MGR_INFO {
|
|||
/// whether to include GUI RPC port and password hash
|
||||
/// in AM RPCs (used for "farm management")
|
||||
bool send_gui_rpc_info;
|
||||
/// use of cookies are required during initial signup
|
||||
/// NOTE: This bool gets dropped after the client has
|
||||
/// successfully attached to an account manager
|
||||
bool cookie_required;
|
||||
/// if the cookies could not be detected, provide a
|
||||
/// link to a website to go to so the user can find
|
||||
/// what login name and password they have been assigned
|
||||
/// NOTE: This bool gets dropped after the client has
|
||||
/// successfully attached to an account manager
|
||||
char cookie_failure_url[256];
|
||||
bool password_error;
|
||||
|
||||
ACCT_MGR_INFO();
|
||||
|
|
|
@ -527,13 +527,24 @@ static void handle_acct_mgr_info(char*, MIOFILE& fout) {
|
|||
fout.printf(
|
||||
"<acct_mgr_info>\n"
|
||||
" <acct_mgr_url>%s</acct_mgr_url>\n"
|
||||
" <acct_mgr_name>%s</acct_mgr_name>\n"
|
||||
" %s\n"
|
||||
"</acct_mgr_info>\n",
|
||||
" <acct_mgr_name>%s</acct_mgr_name>\n",
|
||||
gstate.acct_mgr_info.acct_mgr_url,
|
||||
gstate.acct_mgr_info.acct_mgr_name,
|
||||
strlen(gstate.acct_mgr_info.login_name)?"<have_credentials/>":""
|
||||
gstate.acct_mgr_info.acct_mgr_name
|
||||
);
|
||||
|
||||
if (strlen(gstate.acct_mgr_info.login_name)) {
|
||||
fout.printf(" <have_credentials/>\n");
|
||||
}
|
||||
|
||||
if (gstate.acct_mgr_info.cookie_required) {
|
||||
fout.printf(" <cookie_required/>\n");
|
||||
fout.printf(
|
||||
" <cookie_failure_url>%s</cookie_failure_url>\n",
|
||||
gstate.acct_mgr_info.cookie_failure_url
|
||||
);
|
||||
}
|
||||
|
||||
fout.printf("</acct_mgr_info>\n");
|
||||
}
|
||||
|
||||
static void handle_get_statistics(char*, MIOFILE& fout) {
|
||||
|
|
|
@ -87,6 +87,8 @@ bool CAccountInfoPage::Create( CBOINCBaseWizard* parent )
|
|||
|
||||
////@begin CAccountInfoPage member initialisation
|
||||
m_pTitleStaticCtrl = NULL;
|
||||
m_pCookieDetectionFailedStaticCtrl = NULL;
|
||||
m_pCookieDetectionFailedCtrl = NULL;
|
||||
m_pAccountQuestionStaticCtrl = NULL;
|
||||
m_pAccountInformationStaticCtrl = NULL;
|
||||
m_pAccountCreateCtrl = NULL;
|
||||
|
@ -131,6 +133,14 @@ void CAccountInfoPage::CreateControls()
|
|||
m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
|
||||
itemBoxSizer57->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxGROW|wxALL, 5);
|
||||
|
||||
m_pCookieDetectionFailedStaticCtrl = new wxStaticText;
|
||||
m_pCookieDetectionFailedStaticCtrl->Create( itemWizardPage56, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer57->Add(m_pCookieDetectionFailedStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
|
||||
m_pCookieDetectionFailedCtrl = new wxHyperLink;
|
||||
m_pCookieDetectionFailedCtrl->Create( itemWizardPage56, ID_ACCOUNTCOOKIEDETECTIONFAILEDCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer57->Add(m_pCookieDetectionFailedCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
|
||||
m_pAccountQuestionStaticCtrl = new wxStaticText;
|
||||
m_pAccountQuestionStaticCtrl->Create( itemWizardPage56, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer57->Add(m_pAccountQuestionStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
|
@ -282,6 +292,8 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) {
|
|||
wxASSERT(pSkinWizardATAM);
|
||||
wxASSERT(pWAP);
|
||||
wxASSERT(m_pTitleStaticCtrl);
|
||||
wxASSERT(m_pCookieDetectionFailedStaticCtrl);
|
||||
wxASSERT(m_pCookieDetectionFailedCtrl);
|
||||
wxASSERT(m_pAccountQuestionStaticCtrl);
|
||||
wxASSERT(m_pAccountInformationStaticCtrl);
|
||||
wxASSERT(m_pAccountCreateCtrl);
|
||||
|
@ -315,6 +327,11 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) {
|
|||
}
|
||||
|
||||
if (IS_ACCOUNTMANAGERWIZARD()) {
|
||||
if (!(pWAP->m_bCookieRequired && !pWAP->m_bCredentialsDetected)) {
|
||||
m_pCookieDetectionFailedStaticCtrl->Hide();
|
||||
m_pCookieDetectionFailedCtrl->Hide();
|
||||
}
|
||||
|
||||
m_pAccountQuestionStaticCtrl->Hide();
|
||||
m_pAccountCreateCtrl->SetValue(false);
|
||||
m_pAccountCreateCtrl->Hide();
|
||||
|
@ -323,9 +340,14 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) {
|
|||
m_pAccountConfirmPasswordStaticCtrl->Hide();
|
||||
m_pAccountConfirmPasswordCtrl->Hide();
|
||||
m_pAccountPasswordRequirmentsStaticCtrl->Hide();
|
||||
m_pAccountManagerLinkLabelStaticCtrl->Show();
|
||||
|
||||
if (pWAP->m_bCookieRequired && !pWAP->m_bCredentialsDetected) {
|
||||
m_pAccountManagerLinkLabelStaticCtrl->Hide();
|
||||
m_pAccountForgotPasswordCtrl->Hide();
|
||||
}
|
||||
} else {
|
||||
m_pAccountManagerLinkLabelStaticCtrl->Hide();
|
||||
m_pCookieDetectionFailedStaticCtrl->Hide();
|
||||
m_pCookieDetectionFailedCtrl->Hide();
|
||||
if (pc.account_creation_disabled || pc.client_account_creation_disabled) {
|
||||
m_pAccountCreateCtrl->SetValue(false);
|
||||
m_pAccountCreateCtrl->Hide();
|
||||
|
@ -336,6 +358,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) {
|
|||
m_pAccountCreateCtrl->Enable();
|
||||
m_pAccountUseExistingCtrl->Show();
|
||||
}
|
||||
m_pAccountManagerLinkLabelStaticCtrl->Hide();
|
||||
}
|
||||
|
||||
m_pTitleStaticCtrl->SetLabel(
|
||||
|
@ -363,6 +386,18 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& event ) {
|
|||
_("&Yes, existing user")
|
||||
);
|
||||
} else {
|
||||
if (pWAP->m_bCookieRequired && !pWAP->m_bCredentialsDetected) {
|
||||
m_pCookieDetectionFailedStaticCtrl->SetLabel(
|
||||
_("Your web browser does not support automatic logon detection.\nPlease click on the 'Find logon information' link\nbelow to find out what to put in the email address and\npassword fields.")
|
||||
);
|
||||
m_pCookieDetectionFailedCtrl->SetLabel(
|
||||
_("Find logon information")
|
||||
);
|
||||
m_pCookieDetectionFailedCtrl->SetURL(
|
||||
pWAP->m_strCookieFailureURL
|
||||
);
|
||||
}
|
||||
|
||||
if (pSkinAdvanced->IsBranded() &&
|
||||
!pSkinWizardATAM->GetAccountInfoMessage().IsEmpty()) {
|
||||
m_pAccountInformationStaticCtrl->SetLabel(
|
||||
|
|
|
@ -92,6 +92,8 @@ public:
|
|||
|
||||
////@begin CAccountInfoPage member variables
|
||||
wxStaticText* m_pTitleStaticCtrl;
|
||||
wxStaticText* m_pCookieDetectionFailedStaticCtrl;
|
||||
wxHyperLink* m_pCookieDetectionFailedCtrl;
|
||||
wxStaticText* m_pAccountQuestionStaticCtrl;
|
||||
wxRadioButton* m_pAccountCreateCtrl;
|
||||
wxRadioButton* m_pAccountUseExistingCtrl;
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
#define ID_ACCOUNTREQUIREMENTSSTATICCTRL 11408
|
||||
#define ID_ACCOUNTLINKLABELSTATICCTRL 11409
|
||||
#define ID_ACCOUNTFORGOTPASSWORDCTRL 11410
|
||||
#define ID_ACCOUNTCOOKIEDETECTIONFAILEDCTRL 11411
|
||||
|
||||
// Proxy Page Controls
|
||||
#define ID_PROXYHTTPSERVERSTATICCTRL 11500
|
||||
|
|
|
@ -140,13 +140,15 @@ bool CWizardAttachProject::Create( wxWindow* parent, wxWindowID id, const wxPoin
|
|||
account_out.clear();
|
||||
account_created_successfully = false;
|
||||
attached_to_project_successfully = false;
|
||||
project_url = wxEmptyString;
|
||||
project_authenticator = wxEmptyString;
|
||||
project_name = wxEmptyString;
|
||||
project_url.Empty();
|
||||
project_authenticator.Empty();
|
||||
project_name.Empty();
|
||||
m_strProjectName.Empty();
|
||||
m_strReturnURL.Empty();
|
||||
m_bCredentialsCached = false;
|
||||
m_bCredentialsDetected = false;
|
||||
m_bCookieRequired = false;
|
||||
m_strCookieFailureURL.Empty();
|
||||
|
||||
|
||||
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
|
||||
|
@ -336,6 +338,8 @@ bool CWizardAttachProject::SyncToAccountManager() {
|
|||
m_AccountManagerInfoPage->SetProjectURL( wxString(ami.acct_mgr_url.c_str(), wxConvUTF8) );
|
||||
m_strProjectName = wxString(ami.acct_mgr_name.c_str(), wxConvUTF8);
|
||||
m_bCredentialsCached = ami.have_credentials;
|
||||
m_bCookieRequired = ami.cookie_required;
|
||||
m_strCookieFailureURL = wxString(ami.cookie_failure_url.c_str(), wxConvUTF8);
|
||||
}
|
||||
|
||||
if (ami.acct_mgr_url.size() && !m_bCredentialsCached) {
|
||||
|
|
|
@ -138,6 +138,8 @@ public:
|
|||
bool m_bCredentialsDetected;
|
||||
wxString m_strProjectName;
|
||||
wxString m_strReturnURL;
|
||||
bool m_bCookieRequired;
|
||||
wxString m_strCookieFailureURL;
|
||||
};
|
||||
|
||||
#endif // _WIZ_ATTACHPROJECT_H_
|
||||
|
|
|
@ -437,6 +437,8 @@ struct ACCT_MGR_INFO {
|
|||
std::string acct_mgr_name;
|
||||
std::string acct_mgr_url;
|
||||
bool have_credentials;
|
||||
bool cookie_required;
|
||||
std::string cookie_failure_url;
|
||||
|
||||
ACCT_MGR_INFO();
|
||||
~ACCT_MGR_INFO(){}
|
||||
|
|
|
@ -825,6 +825,8 @@ int ACCT_MGR_INFO::parse(MIOFILE& in) {
|
|||
if (parse_str(buf, "<acct_mgr_name>", acct_mgr_name)) continue;
|
||||
if (parse_str(buf, "<acct_mgr_url>", acct_mgr_url)) continue;
|
||||
if (parse_bool(buf, "have_credentials", have_credentials)) continue;
|
||||
if (parse_bool(buf, "cookie_required", cookie_required)) continue;
|
||||
if (parse_str(buf, "<cookie_failure_url>", cookie_failure_url)) continue;
|
||||
}
|
||||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
@ -833,6 +835,8 @@ void ACCT_MGR_INFO::clear() {
|
|||
acct_mgr_name = "";
|
||||
acct_mgr_url = "";
|
||||
have_credentials = false;
|
||||
cookie_required = false;
|
||||
cookie_failure_url = "";
|
||||
}
|
||||
|
||||
ACCT_MGR_RPC_REPLY::ACCT_MGR_RPC_REPLY() {
|
||||
|
|
Loading…
Reference in New Issue