summaryrefslogtreecommitdiff
path: root/source4/gtk/common/gtk-smb.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-03-23 01:02:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:12 -0500
commit9b48673ad9ed5cf2019df7111fe6ef89ad57573d (patch)
tree843cdf81bb15a79c9da532aea54f602bc7a59d54 /source4/gtk/common/gtk-smb.c
parentdf8c102ec9c64a44ae4b7aa3a47bdf33178f2dcf (diff)
downloadsamba-9b48673ad9ed5cf2019df7111fe6ef89ad57573d.tar.gz
samba-9b48673ad9ed5cf2019df7111fe6ef89ad57573d.tar.bz2
samba-9b48673ad9ed5cf2019df7111fe6ef89ad57573d.zip
r5987: Add credentials callback for gtk+. The gtk+ apps now no longer
ask for a password when kerberos is being used. (This used to be commit 642ec7cbef6d392b49ed0fe86d1816d4953e30ad)
Diffstat (limited to 'source4/gtk/common/gtk-smb.c')
-rw-r--r--source4/gtk/common/gtk-smb.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c
index a84f9f639d..f4458442f0 100644
--- a/source4/gtk/common/gtk-smb.c
+++ b/source4/gtk/common/gtk-smb.c
@@ -20,8 +20,8 @@
*/
#include "includes.h"
-#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
+#include "gtk/common/select.h"
void gtk_show_werror(GtkWidget *win, const char *message, WERROR err)
{
@@ -58,11 +58,6 @@ static void on_browse_activate (GtkButton *button, gpointer user_d
gtk_widget_destroy(GTK_WIDGET(shd));
}
-static void on_krb5_toggled(GtkToggleButton *togglebutton, GtkRpcBindingDialog *d)
-{
- gtk_widget_set_sensitive(d->entry_password, !gtk_toggle_button_get_active(togglebutton));
-}
-
static void on_ncalrpc_toggled(GtkToggleButton *tb, GtkRpcBindingDialog *d)
{
gtk_widget_set_sensitive(d->frame_host, !gtk_toggle_button_get_active(tb));
@@ -84,7 +79,6 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
GtkWidget *table1;
GtkWidget *lbl_username;
GtkWidget *lbl_userdomain;
- GtkWidget *lbl_password;
GtkWidget *btn_browse;
GtkWidget *label9;
GtkWidget *lbl_credentials;
@@ -98,6 +92,7 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
gtk_rpc_binding_dialog->credentials = cli_credentials_init(gtk_rpc_binding_dialog->mem_ctx);
cli_credentials_guess(gtk_rpc_binding_dialog->credentials);
+ cli_credentials_set_gtk_callbacks(gtk_rpc_binding_dialog->credentials);
gtk_window_set_title (GTK_WINDOW (gtk_rpc_binding_dialog), "Connect");
@@ -192,12 +187,6 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (lbl_userdomain), 0, 0.5);
- lbl_password = gtk_label_new ("Password:");
- gtk_table_attach (GTK_TABLE (table1), lbl_password, 0,1, 2,3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (lbl_password), 0, 0.5);
-
label9 = gtk_label_new ("");
gtk_table_attach (GTK_TABLE (table1), label9, 0,1, 3,4,
(GtkAttachOptions) (GTK_FILL),
@@ -220,24 +209,11 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
gtk_entry_set_text(GTK_ENTRY(gtk_rpc_binding_dialog->entry_userdomain),
cli_credentials_get_domain(gtk_rpc_binding_dialog->credentials));
- gtk_rpc_binding_dialog->entry_password = gtk_entry_new ();
- gtk_entry_set_visibility (GTK_ENTRY (gtk_rpc_binding_dialog->entry_password), FALSE);
- gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->entry_password, 1,2, 2,3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
- gtk_entry_set_text(GTK_ENTRY(gtk_rpc_binding_dialog->entry_password),
- cli_credentials_get_password(gtk_rpc_binding_dialog->credentials));
-
gtk_rpc_binding_dialog->krb5_chk_button = gtk_check_button_new_with_mnemonic ("_Use kerberos");
gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->krb5_chk_button, 1,2, 3,4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- g_signal_connect ((gpointer) gtk_rpc_binding_dialog->krb5_chk_button, "toggled",
- G_CALLBACK (on_krb5_toggled),
- gtk_rpc_binding_dialog);
-
/* Poor man's autodetection */
if(getenv("KRB5CCNAME")) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(gtk_rpc_binding_dialog->krb5_chk_button), TRUE);
@@ -296,7 +272,7 @@ GType gtk_rpc_binding_dialog_get_type (void)
return mytype;
}
-GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials, struct sam_pipe *sam_pipe)
+GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials, struct dcerpc_pipe *sam_pipe)
{
GtkRpcBindingDialog *d = GTK_RPC_BINDING_DIALOG ( g_object_new (gtk_rpc_binding_dialog_get_type (), NULL));
if (nocredentials) {
@@ -309,7 +285,6 @@ GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials, struct sam_pipe *sam_
struct cli_credentials *gtk_rpc_binding_dialog_get_credentials(GtkRpcBindingDialog *d)
{
cli_credentials_set_username(d->credentials, gtk_entry_get_text(GTK_ENTRY(d->entry_username)), CRED_SPECIFIED);
- cli_credentials_set_password(d->credentials, gtk_entry_get_text(GTK_ENTRY(d->entry_password)), CRED_SPECIFIED);
cli_credentials_set_domain(d->credentials, gtk_entry_get_text(GTK_ENTRY(d->entry_userdomain)), CRED_SPECIFIED);
return d->credentials;