X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Factmgr%2FfrmActivityMgr.cpp;h=7232694151bba19869ab247dc4e13272cd07fa7e;hb=547ab1fe605cdb4884179ab011dabba4d0bd7bc2;hp=40ab583d8debcbc3d12f9fa5847961f35e4cd153;hpb=700c6a4c98319bc09eeb5c0905a5dafac8aa61cc;p=xestiaab%2F.git diff --git a/source/actmgr/frmActivityMgr.cpp b/source/actmgr/frmActivityMgr.cpp index 40ab583..7232694 100644 --- a/source/actmgr/frmActivityMgr.cpp +++ b/source/actmgr/frmActivityMgr.cpp @@ -80,7 +80,7 @@ frmActivityMgrADT( parent ) ActListProcTimer.SetupPointers(&ActivityList, &ActivityListIndex, &ActivityListTaskDetail, &TasksActive, lstActivity, lblDetails, GauProgress, this, &AnimationTimer, - &ActProcessTimer, &ActivityListFinDate, &ActivityListConn); + &ActProcessTimer, &ActivityListFinDate, &ActivityListConnObject); AnimationTimer.SetBitmap(bmpActivity); AnimationTimer.SetSleepBitmap(&SleepBitmap); @@ -331,6 +331,32 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) #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; @@ -440,7 +466,7 @@ void frmActivityMgr::ProcessTasksThread() #elif defined(__WIN32__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateContextPointer()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #else @@ -528,6 +554,32 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) #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; @@ -796,6 +848,32 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) #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; @@ -905,7 +983,7 @@ void frmActivityMgr::ProcessTasksThread() #elif defined(__WIN32__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateContextPointer()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #else @@ -966,7 +1044,6 @@ void frmActivityMgr::ProcessTasksThread() wxArrayString vCardUpdateRemote; wxArrayString vCardUpdateLog; std::map vCardETag; - ContactListData ServerContactList; std::map vCardDownloadData; @@ -1017,8 +1094,6 @@ void frmActivityMgr::ProcessTasksThread() COConnectResult ConnectResponse = ConnObjectIter->second->Connect(false); bool ExitLoop = FALSE; - - std::map *SCListData = NULL; while (ExitLoop == FALSE){ @@ -1028,6 +1103,32 @@ void frmActivityMgr::ProcessTasksThread() #if defined(__APPLE__) #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; @@ -1133,7 +1234,7 @@ void frmActivityMgr::ProcessTasksThread() #elif defined(__WIN32__) - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateContextPointer()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnObjectIter->second->BuildSSLCollection()); #else @@ -1395,6 +1496,11 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse ServerEntityTag = ConnObjectIter->second->GetServerEntityTagValue(additer->first.ToStdString()); + if (ServerEntityTag.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + ServerETag = wxString::FromUTF8(ServerEntityTag.EntityTag.c_str()); // Add to the ETag Database. @@ -1423,6 +1529,11 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse ServerEntityTag = ConnObjectIter->second->GetServerEntityTagValue(additer->first.ToStdString()); + if (ServerEntityTag.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + ServerETag = wxString::FromUTF8(ServerEntityTag.EntityTag.c_str()); // Add to the ETag Database. @@ -1431,6 +1542,12 @@ void frmActivityMgr::ProcessTasksThread() } } + + // Check if any errors occured before continuing. + + if (iter->second != 1){ + break; + } // Look for vCard files which aren't in the ETagDB. @@ -1489,6 +1606,13 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse ServerEntityTag = ConnObjectIter->second->GetServerEntityTagValue(vCardAdd[vi].ToStdString()); + if (ServerEntityTag.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + + // TODO: Continue from here! + ETagServer = wxString::FromUTF8(ServerEntityTag.EntityTag.c_str()); if (ETagOriginal != ETagServer){ @@ -1510,6 +1634,11 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse GetContactResponse = ConnObjectIter->second->GetContact(vCardAdd[vi].ToStdString(), &ServerContactDataString); + if (GetContactResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + ServerContactData = wxString::FromUTF8(ServerContactDataString.c_str()); // Process v3 version into v4 version. @@ -1561,6 +1690,11 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(vCardAdd[vi].ToStdString(), ClientData.WriteString().ToStdString()); + if (EditContactResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + iter->second = 4; } else if (ConflictResult == 2){ @@ -1605,10 +1739,20 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(vCardAdd[vi].ToStdString(), TaskData.ToStdString()); + if (AddContactResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + // Get the Server ETag and put it in the ETag database. COServerResponse EntityTagResponse = ConnObjectIter->second->GetServerEntityTagValue(vCardAdd[vi].ToStdString()); + if (EntityTagResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + ETagServer = wxString::FromUTF8(EntityTagResponse.EntityTag.c_str()); ETagDBPtr->AddETag(vCardAdd[vi], ETagServer, ETagServer); @@ -1636,6 +1780,11 @@ void frmActivityMgr::ProcessTasksThread() COServerResponse GetContactResponse = ConnObjectIter->second->GetContact(vCardAdd[vi].ToStdString(), &ServerContactDataString); + if (GetContactResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + ServerContactData = wxString::FromUTF8(ServerContactDataString.c_str()); ClientData.LoadFile(FullFilename); @@ -1682,7 +1831,12 @@ void frmActivityMgr::ProcessTasksThread() // Decided to use client version. COServerResponse EditContactResponse = ConnObjectIter->second->EditContact(vCardAdd[vi].ToStdString(), ClientData.WriteString().ToStdString()); - + + if (EditContactResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + iter->second = 4; } else if (ConflictResult == 2){ @@ -1726,11 +1880,21 @@ void frmActivityMgr::ProcessTasksThread() // Upload the data to the server. COServerResponse AddContactResponse = ConnObjectIter->second->AddContact(vCardAdd[vi].ToStdString(), TaskData.ToStdString()); - + + if (AddContactResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + // Get the Server ETag and put it in the ETag database. COServerResponse EntityTagResponse = ConnObjectIter->second->GetServerEntityTagValue(vCardAdd[vi].ToStdString()); + if (EntityTagResponse.RequestResult != COREQUEST_OK){ + iter->second = 2; + break; + } + ETagDBPtr->AddETag(vCardAdd[vi], ETagServer, ETagServer); } @@ -1739,6 +1903,10 @@ void frmActivityMgr::ProcessTasksThread() } + if (iter->second != 1){ + break; + } + // Process the vCards to delete locally. for (int vi = 0; vi < vCardDelete.GetCount(); vi++){