// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
#include "frmEditAccount.h"
-#include "frmInvalidSSLCertificate.h"
-#include "carddav/carddav.h"
frmEditAccount::frmEditAccount( wxWindow* parent )
:
int SSLResult;
+#if defined(__APPLE__)
+
+ SSLResult = DisplayTrustPanel(&CDavObj);
+
+#elif defined(__WIN32__)
+
+ BOOL ModifiedCertificateData;
+ CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(&CDavObj, (HWND)this->GetHandle());
+
+ if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)){
+ wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog"));
+ return;
+ }
+
+ if (ModifiedCertificateData == FALSE){
+ wxMessageBox(_("Unable to get server prefix without a valid SSL certificate."), _("Error getting server prefix"));
+ return;
+ }
+
+#else
+
frmInvalidSSLCertificate *frmICPtr = new frmInvalidSSLCertificate(this);
frmICPtr->LoadDataNew(CDavObj.GetSSLVerifyResults(), txtAddress->GetValue());
delete frmICPtr;
frmICPtr = NULL;
-
+
+#endif
+
// Process the response from the user.
if (SSLResult == 1){
return;
}
-
} else {
bool ContinueAcc = TRUE;
wxString AccountName;
wxString AccountData;
-
+
ContinueAcc = cfgfile->GetFirstGroup(AccountName, itemindex);
-
+
while (ContinueAcc){
if (AccountName == AccName){
void frmEditAccount::UpdateSettings( wxCommandEvent& event )
{
+ // Check if server address matches against the blacklist.
+ // Bring up warning message if it does.
+
+ if (CheckBlacklist(txtAddress->GetValue())){
+
+ int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this);
+
+ if (MessageBoxResult == wxNO){
+ return;
+ }
+
+ }
+
// Update the settings for the account.
long itemindex = 0;