ActListProcTimer.SetupPointers(&ActivityList, &ActivityListIndex, &ActivityListTaskDetail,
&TasksActive, lstActivity, lblDetails, GauProgress, this, &AnimationTimer,
- &ActProcessTimer, &ActivityListFinDate, &ActivityListConn);
+ &ActProcessTimer, &ActivityListFinDate, &ActivityListConnObject);
AnimationTimer.SetBitmap(bmpActivity);
AnimationTimer.SetSleepBitmap(&SleepBitmap);
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;
#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
break;
}
- std::cout << ETagGetResponse.EntityTag << std::endl;
-
ETagDBPtr->UpdateETag(ContactFilename, ETagGetResponse.EntityTag, ETagGetResponse.EntityTag);
iter->second = 4;
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;
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;
#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
wxArrayString vCardUpdateRemote;
wxArrayString vCardUpdateLog;
std::map<wxString,wxString> vCardETag;
- ContactListData ServerContactList;
std::map<wxString,vCardDownloadDataFileClass> vCardDownloadData;
COConnectResult ConnectResponse = ConnObjectIter->second->Connect(false);
bool ExitLoop = FALSE;
-
- std::map<wxString,FileSyncData> *SCListData = NULL;
while (ExitLoop == FALSE){
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;
ConnectResponse = ConnObjectIter->second->Connect(true);
+ if (ConnectResponse == COCONNECT_OK){
+
+ ExitLoop = true;
+ break;
+
+ } else {
+
+ ExitLoop = true;
+ iter->second = 2;
+ break;
+
+ }
+
ExitLoop = true;
break;
#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
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.
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.
}
}
+
+ // Check if any errors occured before continuing.
+
+ if (iter->second != 1){
+ break;
+ }
// Look for vCard files which aren't in the ETagDB.
COServerResponse ServerEntityTag = ConnObjectIter->second->GetServerEntityTagValue(vCardAdd[vi].ToStdString());
+ if (ServerEntityTag.RequestResult != COREQUEST_OK){
+ iter->second = 2;
+ break;
+ }
+
ETagServer = wxString::FromUTF8(ServerEntityTag.EntityTag.c_str());
if (ETagOriginal != ETagServer){
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.
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){
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);
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);
// 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){
// 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);
}
}
+ if (iter->second != 1){
+ break;
+ }
+
// Process the vCards to delete locally.
for (int vi = 0; vi < vCardDelete.GetCount(); vi++){
}
-}
\ No newline at end of file
+}