Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced integers for cURLcode with actual cURLcode values.
[xestiaab/.git] / source / actmgr / frmActivityMgr.cpp
index b63d827..006c668 100644 (file)
@@ -330,9 +330,11 @@ void frmActivityMgr::ProcessTasksThread()
                                                
                                                int ErrorCode = ConnHandle.GetResultCode();
                                                
-                                               if (ErrorCode != 0){
+                                               if (ErrorCode != CURLE_OK){
                                                        
-                                                       if (ErrorCode == 60 || ErrorCode == 51){
+                                                       if (ErrorCode == CURLE_SSL_CACERT ||
+                                                               ErrorCode == CURLE_PEER_FAILED_VERIFICATION ||
+                                                               ErrorCode == CURLE_SSL_CONNECT_ERROR){
                                                                
                                                                // Invalid SSL certificate so bring up a dialog to the user
                                                                // explaining what has happened and the options available.
@@ -519,9 +521,11 @@ void frmActivityMgr::ProcessTasksThread()
                                                
                                                int ErrorCode = ConnHandle.GetResultCode();
                                                
-                                               if (ErrorCode != 0){
+                                               if (ErrorCode != CURLE_OK){
                                                        
-                                                       if (ErrorCode == 60 || ErrorCode == 51){
+                                                       if (ErrorCode == CURLE_SSL_CACERT ||
+                                                               ErrorCode == CURLE_PEER_FAILED_VERIFICATION ||
+                                                               ErrorCode == CURLE_SSL_CONNECT_ERROR){
                                                                
                                                                // Invalid SSL certificate so bring up a dialog to the user
                                                                // explaining what has happened and the options available.
@@ -789,9 +793,11 @@ void frmActivityMgr::ProcessTasksThread()
                                                
                                                int ErrorCode = ConnHandle.GetResultCode();
                                                
-                                               if (ErrorCode != 0){
+                                               if (ErrorCode != CURLE_OK){
                                                        
-                                                       if (ErrorCode == 60 || ErrorCode == 51){
+                                                       if (ErrorCode == CURLE_SSL_CACERT ||
+                                                               ErrorCode == CURLE_PEER_FAILED_VERIFICATION ||
+                                                               ErrorCode == CURLE_SSL_CONNECT_ERROR){
                                                                
                                                                // Invalid SSL certificate so bring up a dialog to the user
                                                                // explaining what has happened and the options available.
@@ -1013,21 +1019,16 @@ void frmActivityMgr::ProcessTasksThread()
                                        std::map<wxString,FileSyncData> *SCListData = NULL;
                                        
                                        while (ExitLoop == FALSE){
-                                       
-                                               ServerContactList = ConnHandle.GetContactList(SyncTokenLoad.ToUTF8());
-                                               SSLCertCollection certcol = ConnHandle.GetCertificateData();
-                               
-                                               // Create a pointer for the std::map<wxString,FileSyncData>.
-                               
-                                               SCListData = &ServerContactList.ListData;
                                
                                                // Check if any errors have occured whilst getting the data.
                                
-                                               int ErrorCode = ConnHandle.GetResultCode();
+                                               int ErrorCode = ConnHandle.SSLVerifyTest();
                                
-                                               if (ErrorCode != 0){
+                                               if (ErrorCode != CURLE_OK){
                                        
-                                                       if (ErrorCode == 60 || ErrorCode == 51){
+                                                       if (ErrorCode == CURLE_SSL_CACERT ||
+                                                               ErrorCode == CURLE_PEER_FAILED_VERIFICATION ||
+                                                               ErrorCode == CURLE_SSL_CONNECT_ERROR){
                                                
                                                                // Invalid SSL certificate so bring up a dialog to the user
                                                                // explaining what has happened and the options available.
@@ -1057,6 +1058,16 @@ void frmActivityMgr::ProcessTasksThread()
                                                                         frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetTrustObject());
                                                                         
                                                                 }
+
+#elif defined(__WIN32__)
+
+                                                               BOOL ModifiedCertificateData;
+                                                               CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(&ConnHandle, (HWND)frmMainPtrGet->GetHandle());
+
+                                                               if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)){
+                                                                       wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog"));
+                                                               }
+
 #else
                                 
                                                                // Setup the data to be sent in the wxPostEvent command.
@@ -1159,6 +1170,13 @@ void frmActivityMgr::ProcessTasksThread()
                                
                                        bool ContinueProcess = AccDir.GetFirst(&AccDirFilename, wxEmptyString, wxDIR_DEFAULT);
                                
+                                       ServerContactList = ConnHandle.GetContactList(SyncTokenLoad.ToUTF8());
+                                       SSLCertCollection certcol = ConnHandle.GetCertificateData();
+
+                                       // Create a pointer for the std::map<wxString,FileSyncData>.
+
+                                       SCListData = &ServerContactList.ListData;
+
                                        // Process the server data.
 
                                        if (SCListData != NULL){
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy