X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Factmgr%2FfrmActivityMgr.cpp;h=be5f40aa2eddd38fe7152c8d3c2100694364ddac;hp=ec4700c6516a2cf7e37c6bca2d71f845c9129b51;hb=ccc379ac30775d5b73698b83875a35fc1bfa56d0;hpb=2c8998278759b5bf6fc3bcf75afd289c214b6c84 diff --git a/source/actmgr/frmActivityMgr.cpp b/source/actmgr/frmActivityMgr.cpp index ec4700c..be5f40a 100644 --- a/source/actmgr/frmActivityMgr.cpp +++ b/source/actmgr/frmActivityMgr.cpp @@ -330,7 +330,54 @@ void frmActivityMgr::ProcessTasksThread() frmMainPtrGet->PauseAllTimers(); #if defined(__APPLE__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + int SSLResult = DisplayTrustPanel(ConnObjectIter->second->BuildSSLCollection(), AccountNameFriendly); + + if (SSLResult != NSOKButton){ + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #elif defined(__WIN32__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + BOOL ModifiedCertificateData = false; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(ConnObjectIter->second, (HWND)frmMainPtrGet->GetHandle()); + + if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)) { + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + } + + if (ModifiedCertificateData == false) { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #else bool UsingSSLBypass = false; @@ -436,11 +483,11 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetTrustObject()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #elif defined(__WIN32__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateContextPointer()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #else @@ -449,7 +496,7 @@ void frmActivityMgr::ProcessTasksThread() #endif COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(StringURLIter->second.ToStdString(), - StringDataIter->second.ToStdString()); + std::string(StringDataIter->second.ToUTF8())); if (AddContactResponse.RequestResult != COREQUEST_OK){ iter->second = 2; @@ -465,8 +512,6 @@ void frmActivityMgr::ProcessTasksThread() break; } - std::cout << ETagGetResponse.EntityTag << std::endl; - ETagDBPtr->UpdateETag(ContactFilename, ETagGetResponse.EntityTag, ETagGetResponse.EntityTag); iter->second = 4; @@ -527,7 +572,54 @@ void frmActivityMgr::ProcessTasksThread() frmMainPtrGet->PauseAllTimers(); #if defined(__APPLE__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + int SSLResult = DisplayTrustPanel(ConnObjectIter->second->BuildSSLCollection(), AccountNameFriendly); + + if (SSLResult != NSOKButton){ + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #elif defined(__WIN32__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + BOOL ModifiedCertificateData = false; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(ConnObjectIter->second, (HWND)frmMainPtrGet->GetHandle()); + + if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)) { + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + } + + if (ModifiedCertificateData == FALSE) { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #else bool UsingSSLBypass = false; @@ -729,7 +821,7 @@ void frmActivityMgr::ProcessTasksThread() // Upload the data to the server. COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(StringURLIter->second.ToStdString(), - StringDataIter->second.ToStdString()); + std::string(StringDataIter->second.ToUTF8())); if (EditContactResponse.RequestResult != COREQUEST_OK){ iter->second = 2; @@ -795,7 +887,54 @@ void frmActivityMgr::ProcessTasksThread() frmMainPtrGet->PauseAllTimers(); #if defined(__APPLE__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + int SSLResult = DisplayTrustPanel(ConnObjectIter->second->BuildSSLCollection(), AccountNameFriendly); + + if (SSLResult != NSOKButton){ + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #elif defined(__WIN32__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + BOOL ModifiedCertificateData = false; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(ConnObjectIter->second, (HWND)frmMainPtrGet->GetHandle()); + + if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)) { + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + } + + if (ModifiedCertificateData == false) { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #else bool UsingSSLBypass = false; @@ -901,11 +1040,11 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetTrustObject()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #elif defined(__WIN32__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateContextPointer()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #else @@ -1024,7 +1163,54 @@ void frmActivityMgr::ProcessTasksThread() frmMainPtrGet->PauseAllTimers(); #if defined(__APPLE__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + int SSLResult = DisplayTrustPanel(ConnObjectIter->second->BuildSSLCollection(), AccountNameFriendly); + + if (SSLResult != NSOKButton){ + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #elif defined(__WIN32__) + + ConnObjectIter->second->BypassSSLVerification(true); + + COConnectResult ConnectionSSLResult = ConnObjectIter->second->Connect(false); + + ConnObjectIter->second->BypassSSLVerification(false); + + BOOL ModifiedCertificateData = false; + CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(ConnObjectIter->second, (HWND)frmMainPtrGet->GetHandle()); + + if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)) { + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + } + + if (ModifiedCertificateData == false) { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnObjectIter->second->BuildSSLCollection()); + iter->second = 2; + break; + + } else { + + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); + + } + #else bool UsingSSLBypass = false; @@ -1111,6 +1297,19 @@ void frmActivityMgr::ProcessTasksThread() ConnectResponse = ConnObjectIter->second->Connect(true); + if (ConnectResponse == COCONNECT_OK){ + + ExitLoop = true; + break; + + } else { + + ExitLoop = true; + iter->second = 2; + break; + + } + ExitLoop = true; break; @@ -1126,11 +1325,11 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetTrustObject()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #elif defined(__WIN32__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateContextPointer()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #else @@ -1507,8 +1706,6 @@ void frmActivityMgr::ProcessTasksThread() break; } - // TODO: Continue from here! - ETagServer = wxString::FromUTF8(ServerEntityTag.EntityTag.c_str()); if (ETagOriginal != ETagServer){ @@ -1584,7 +1781,7 @@ void frmActivityMgr::ProcessTasksThread() // Decided to use client version. - COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(vCardAdd[vi].ToStdString(), ClientData.WriteString().ToStdString()); + COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(vCardAdd[vi].ToStdString(), std::string(ClientData.WriteString().ToUTF8())); if (EditContactResponse.RequestResult != COREQUEST_OK){ iter->second = 2; @@ -1633,7 +1830,7 @@ void frmActivityMgr::ProcessTasksThread() // Upload the data to the server. - COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(vCardAdd[vi].ToStdString(), TaskData.ToStdString()); + COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(vCardAdd[vi].ToStdString(), std::string(TaskData.ToUTF8())); if (AddContactResponse.RequestResult != COREQUEST_OK){ iter->second = 2; @@ -1726,7 +1923,7 @@ void frmActivityMgr::ProcessTasksThread() // Decided to use client version. - COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(vCardAdd[vi].ToStdString(), ClientData.WriteString().ToStdString()); + COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(vCardAdd[vi].ToStdString(), std::string(ClientData.WriteString().ToUTF8())); if (EditContactResponse.RequestResult != COREQUEST_OK){ iter->second = 2; @@ -1775,7 +1972,7 @@ void frmActivityMgr::ProcessTasksThread() // Upload the data to the server. - COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(vCardAdd[vi].ToStdString(), TaskData.ToStdString()); + COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(vCardAdd[vi].ToStdString(), std::string(TaskData.ToUTF8())); if (AddContactResponse.RequestResult != COREQUEST_OK){ iter->second = 2; @@ -2076,4 +2273,4 @@ void frmActivityMgr::UpdateStatusLabel(wxCommandEvent& event){ } -} \ No newline at end of file +}