[glom] Fix opening documents using a centrally-hosted database (#586684).
- From: Armin Burgmeier <arminb src gnome org>
- To: svn-commits-list gnome org
- Subject: [glom] Fix opening documents using a centrally-hosted database (#586684).
- Date: Wed, 24 Jun 2009 12:35:40 +0000 (UTC)
commit 6ca99eb2f32cdf661dd7586842d69dbbcce3afad
Author: Armin Burgmeier <armin arbur net>
Date: Wed Jun 24 14:30:25 2009 +0200
Fix opening documents using a centrally-hosted database (#586684).
* glom/application.cc (on_document_load): Only provide a known user
name and password for self-hosted databases, and ask the user for the
database password for centrally-hosted ones.
* glom/frame_glom.cc (connection_request_password_and_attempt): Show
the connection dialog for centrally hosted connections, and fix trying
to login with the same (wrong) credentials all the time without giving
the user a chance to correct them. This fixes bug #586684.
ChangeLog | 11 +++++++++++
glom/application.cc | 6 +++++-
glom/frame_glom.cc | 8 ++++----
3 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1c81437..f7ad89a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-06-24 Armin Burgmeier <armin openismus com>
+
+ * glom/application.cc (on_document_load): Only provide a known user
+ name and password for self-hosted databases, and ask the user for the
+ database password for centrally-hosted ones.
+
+ * glom/frame_glom.cc (connection_request_password_and_attempt): Show
+ the connection dialog for centrally hosted connections, and fix trying
+ to login with the same (wrong) credentials all the time without giving
+ the user a chance to correct them. This fixes bug #586684.
+
2009-06-22 Armin Burgmeier <armin openismus com>
* glom/application.cc (on_document_load): If we load an example file,
diff --git a/glom/application.cc b/glom/application.cc
index 1826b85..a418280 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -1087,7 +1087,11 @@ bool App_Glom::on_document_load()
//Use the default username/password if opening as non network-shared:
if(!(pDocument->get_network_shared()))
{
- m_temp_username = Privs::get_default_developer_user_name(m_temp_password);
+ // If the document is centrally hosted, don't pretend to know the
+ // username or password, because we don't. The user will enter
+ // the login credentials in a dialog.
+ if(pDocument->get_hosting_mode() != Document::HOSTING_MODE_POSTGRES_CENTRAL)
+ m_temp_username = Privs::get_default_developer_user_name(m_temp_password);
}
bool database_not_found = false;
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 3194c4c..df5a699 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -2128,7 +2128,6 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
Glib::ustring username, password;
m_pDialogConnection->get_username_and_password(username, password);
document->set_connection_user(username);
-
}
else
{
@@ -2297,10 +2296,10 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
m_dialog_progess_connection_startup = 0;
}
- //Only ask for the password if we are shared on the network.
+ //Only ask for the password if we are shared on the network, or we are using a centrally hosted server.
//Otherwise, no password question is necessary, due to how our self-hosted database server is configured.
if(document->get_network_shared()
- && (document->get_hosting_mode() != Document::HOSTING_MODE_SQLITE) ) //TODO: The sqlite check may be unnecessary.
+ || document->get_hosting_mode() == Document::HOSTING_MODE_POSTGRES_CENTRAL)
{
//We recreate the dialog each time to make sure it is clean of any changes:
if(m_pDialogConnection)
@@ -2339,7 +2338,7 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
//Only show the dialog if we don't know the correct username/password yet:
int response = Gtk::RESPONSE_OK;
- if(m_pDialogConnection && known_username.empty() && known_password.empty())
+ if(m_pDialogConnection)
{
response = Glom::Utils::dialog_run_with_help(m_pDialogConnection, "dialog_connection");
m_pDialogConnection->hide();
@@ -2355,6 +2354,7 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
if(m_pDialogConnection)
{
sharedptr<SharedConnection> sharedconnection = m_pDialogConnection->connect_to_server_with_connection_settings();
+ // TODO: Save username in document?
return true; //Succeeded, because no exception was thrown.
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]