[Greater-commits] r197 - trunk/Administration

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 14 16:01:15 CEST 2011


Author: aheinecke
Date: 2011-06-14 16:01:14 +0200 (Tue, 14 Jun 2011)
New Revision: 197

Modified:
   trunk/Administration/AuthenticateDialog.cpp
   trunk/Administration/AuthenticateDialog.h
Log:
Give feedback why the authorization failed if the authorization failed


Modified: trunk/Administration/AuthenticateDialog.cpp
===================================================================
--- trunk/Administration/AuthenticateDialog.cpp	2011-06-10 16:20:22 UTC (rev 196)
+++ trunk/Administration/AuthenticateDialog.cpp	2011-06-14 14:01:14 UTC (rev 197)
@@ -212,7 +212,7 @@
   if (!da_db_connect_admin(p_user, p_password, p_database, &admin, &errinfo))
   {
     //Authentification failed
-    OnAuthFailed();
+    OnAuthFailed(errinfo.err_param);
   }
   else
   {
@@ -261,16 +261,22 @@
 *
 * Purpose  : Show message box in case authentification failed
 *
-* Parameter: -
+* Parameter: errmsg -> the message the server replied
 *
 * Return   : -
 * 
 * Changes  :
 *********************************************************************/
-void AuthenticateDialog::OnAuthFailed()
+void AuthenticateDialog::OnAuthFailed(const char * errmsg)
 {
   //Display error message box
-  wxMessageBox(wxT("Authentication failed"), wxT("Info"), wxOK | wxICON_ERROR);
+  wxString message = wxT("Authentication failed!");
+  if (errmsg) {
+    message = wxT("Authentication failed:\n");
+    message += wxString(errmsg, wxConvUTF8);
+  }
+
+  wxMessageBox(message, wxT("Info"), wxOK | wxICON_ERROR);
 }
 
 

Modified: trunk/Administration/AuthenticateDialog.h
===================================================================
--- trunk/Administration/AuthenticateDialog.h	2011-06-10 16:20:22 UTC (rev 196)
+++ trunk/Administration/AuthenticateDialog.h	2011-06-14 14:01:14 UTC (rev 197)
@@ -61,7 +61,7 @@
                      const wxPoint& pos, const wxSize& size);
   void OnButtonOK(wxCommandEvent &event);
   void OnButtonCancel(wxCommandEvent &event);
-  void OnAuthFailed();
+  void OnAuthFailed(const char * errmsg = 0);
 private:
   DECLARE_EVENT_TABLE()
   wxStaticText*  stextDb;



More information about the Greater-commits mailing list