summaryrefslogtreecommitdiff
path: root/source4/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'source4/gtk')
-rw-r--r--source4/gtk/README2
-rw-r--r--source4/gtk/common/gtk-smb.c77
-rw-r--r--source4/gtk/common/gtk-smb.h4
-rw-r--r--source4/gtk/common/select.c280
-rw-r--r--source4/gtk/common/select.h77
-rw-r--r--source4/gtk/config.m44
-rw-r--r--source4/gtk/config.mk14
-rw-r--r--source4/gtk/tools/gregedit.c16
-rw-r--r--source4/gtk/tools/gwcrontab.c18
-rw-r--r--source4/gtk/tools/gwsam.c410
-rw-r--r--source4/gtk/tools/gwsam_user.c356
11 files changed, 1193 insertions, 65 deletions
diff --git a/source4/gtk/README b/source4/gtk/README
index 7947d45e25..ae41065e34 100644
--- a/source4/gtk/README
+++ b/source4/gtk/README
@@ -4,6 +4,8 @@ things.
Common code at the moment:
GtkRpcBindingDialog - Gtk Dialog Window for obtaining user credentials and a RPC binding string
+GtkSelectDomainDialog - Gtk Dialog for selecting a domain
+GtkSelectHostDialog - Gtk Dialog for selecting a SMB host
gtk_show_werror() - Show dialog box with a WERROR
gtk_show_nterror() - Show dialog box with a NTSTATUS
create_gtk_samba_about() - Shows about Window
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c
index 7d7de18e76..d1c1eaa806 100644
--- a/source4/gtk/common/gtk-smb.c
+++ b/source4/gtk/common/gtk-smb.c
@@ -19,19 +19,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
#include "includes.h"
+#include "gtk-smb.h"
void gtk_show_werror(GtkWidget *win, WERROR err)
{
@@ -55,8 +44,15 @@ void gtk_show_ntstatus(GtkWidget *win, NTSTATUS status)
gtk_widget_destroy (dialog);
}
-static void gtk_rpc_binding_dialog_class_init (GtkRpcBindingDialogClass *class)
+static void on_browse_activate (GtkButton *button, gpointer user_data)
{
+ GtkRpcBindingDialog *rbd = user_data;
+ GtkSelectHostDialog *shd = gtk_select_host_dialog_new(TRUE);
+ if(gtk_dialog_run(GTK_DIALOG(shd)) == GTK_RESPONSE_ACCEPT) {
+ gtk_entry_set_text(GTK_ENTRY(rbd->entry_host), gtk_select_host_dialog_get_host(shd));
+ }
+
+ gtk_widget_destroy(GTK_WIDGET(shd));
}
static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_dialog)
@@ -79,6 +75,7 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
GtkWidget *table1;
GtkWidget *lbl_username;
GtkWidget *lbl_password;
+ GtkWidget *btn_browse;
GtkWidget *label9;
GtkWidget *chk_button;
GtkWidget *lbl_credentials;
@@ -139,6 +136,14 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di
gtk_widget_show (gtk_rpc_binding_dialog->entry_host);
gtk_box_pack_start (GTK_BOX (hbox1), gtk_rpc_binding_dialog->entry_host, TRUE, TRUE, 0);
+ btn_browse = gtk_button_new_with_label ("Browse");
+ gtk_widget_show (btn_browse);
+ gtk_box_pack_start (GTK_BOX (hbox1), btn_browse, TRUE, TRUE, 0);
+
+ g_signal_connect ((gpointer) btn_browse, "pressed",
+ G_CALLBACK (on_browse_activate),
+ gtk_rpc_binding_dialog);
+
label2 = gtk_label_new ("Host");
gtk_widget_show (label2);
gtk_frame_set_label_widget (GTK_FRAME (frame_host), label2);
@@ -245,7 +250,7 @@ GType gtk_rpc_binding_dialog_get_type ()
sizeof (GtkRpcBindingDialogClass),
NULL,
NULL,
- (GClassInitFunc) gtk_rpc_binding_dialog_class_init,
+ NULL,
NULL,
NULL,
sizeof(GtkRpcBindingDialog),
@@ -282,12 +287,14 @@ const char *gtk_rpc_binding_dialog_get_binding(GtkRpcBindingDialog *d, char *pip
char *options = NULL;
char *binding = NULL;
+ /* Format: TRANSPORT:host:[\pipe\foo,foo,foo] */
+
host = gtk_entry_get_text(GTK_ENTRY(d->entry_host));
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->transport_tcp_ip)))
transport = "ncacn_tcp";
else
transport = "ncacn_np";
- // Format: TRANSPORT:host:[\pipe\foo,foo,foo]
+
if(pipe != NULL) {
options = talloc_asprintf(d->mem_ctx, "\\pipe\\%s", pipe);
}
@@ -309,44 +316,46 @@ const char *gtk_rpc_binding_dialog_get_binding(GtkRpcBindingDialog *d, char *pip
GtkWidget* create_gtk_samba_about_dialog (char *appname)
{
+ GtkWidget *samba_about_dialog;
GtkWidget *dialog_vbox1;
GtkWidget *image1;
GtkWidget *label1;
+ GtkWidget *label3;
GtkWidget *label2;
GtkWidget *dialog_action_area1;
- GtkWidget *closebutton1;
- GtkWidget *aboutwin;
+ GtkWidget *okbutton1;
- aboutwin = gtk_dialog_new ();
- gtk_window_set_title (GTK_WINDOW (aboutwin), "About");
- gtk_window_set_resizable (GTK_WINDOW (aboutwin), FALSE);
+ samba_about_dialog = gtk_dialog_new ();
+ gtk_window_set_title (GTK_WINDOW (samba_about_dialog), "About");
- dialog_vbox1 = GTK_DIALOG (aboutwin)->vbox;
+ dialog_vbox1 = GTK_DIALOG (samba_about_dialog)->vbox;
gtk_widget_show (dialog_vbox1);
- /* FIXME: Samba logo ?
- image1 = create_pixmap (aboutwin, "samba.png");
+/* FIXME image1 = create_pixmap (samba_about_dialog, "slmed.png");
gtk_widget_show (image1);
- gtk_box_pack_start (GTK_BOX (dialog_vbox1), image1, FALSE, TRUE, 0); */
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), image1, TRUE, TRUE, 0);*/
label1 = gtk_label_new (appname);
gtk_widget_show (label1);
gtk_box_pack_start (GTK_BOX (dialog_vbox1), label1, FALSE, FALSE, 0);
- gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);
- label2 = gtk_label_new_with_mnemonic ("(C) 2004 Jelmer Vernooij <jelmer@samba.org>\nPart of Samba\nhttp://www.samba.org/\n");
+ label3 = gtk_label_new_with_mnemonic ("Part of Samba <http://www.samba.org/>");
+ gtk_widget_show (label3);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), label3, FALSE, FALSE, 0);
+
+ label2 = gtk_label_new ("\302\251 1992-2004 The Samba Team");
gtk_widget_show (label2);
- gtk_box_pack_start (GTK_BOX (dialog_vbox1), label2, TRUE, FALSE, 0);
- gtk_label_set_use_markup (GTK_LABEL (label2), TRUE);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), label2, FALSE, FALSE, 0);
- dialog_action_area1 = GTK_DIALOG (aboutwin)->action_area;
+ dialog_action_area1 = GTK_DIALOG (samba_about_dialog)->action_area;
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
- closebutton1 = gtk_button_new_from_stock ("gtk-close");
- gtk_widget_show (closebutton1);
- gtk_dialog_add_action_widget (GTK_DIALOG (aboutwin), closebutton1, GTK_RESPONSE_CLOSE);
- GTK_WIDGET_SET_FLAGS (closebutton1, GTK_CAN_DEFAULT);
+ okbutton1 = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (okbutton1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (samba_about_dialog), okbutton1, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
- return aboutwin;
+ return samba_about_dialog;
}
+
diff --git a/source4/gtk/common/gtk-smb.h b/source4/gtk/common/gtk-smb.h
index cbc587c8e9..e9b62d94da 100644
--- a/source4/gtk/common/gtk-smb.h
+++ b/source4/gtk/common/gtk-smb.h
@@ -22,6 +22,8 @@
#ifndef __GTK_SMB_H__
#define __GTK_SMB_H__
+#ifdef HAVE_GTK
+
#include <gtk/gtk.h>
typedef struct _GtkRpcBindingDialog GtkRpcBindingDialog;
@@ -51,3 +53,5 @@ struct _GtkRpcBindingDialogClass
#define IS_GTK_RPC_BINDING_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_rpc_binding_dialog_get_type ())
#endif
+
+#endif
diff --git a/source4/gtk/common/select.c b/source4/gtk/common/select.c
new file mode 100644
index 0000000000..4e4d14dbe2
--- /dev/null
+++ b/source4/gtk/common/select.c
@@ -0,0 +1,280 @@
+/*
+ Unix SMB/CIFS implementation.
+ SMB-related GTK+ functions
+
+ Copyright (C) Jelmer Vernooij 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "gtk-smb.h"
+
+/* GtkSelectDomainDialog */
+
+const char *gtk_select_domain_dialog_get_domain(GtkSelectDomainDialog *d)
+{
+ return gtk_entry_get_text(GTK_ENTRY(d->entry_domain));
+}
+
+void gtk_select_domain_dialog_init (GtkSelectDomainDialog *select_domain_dialog)
+{
+ GtkWidget *dialog_vbox1;
+ GtkWidget *hbox1;
+ GtkWidget *label1;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *dialog_action_area1;
+ GtkWidget *cancelbutton1;
+ GtkWidget *okbutton1;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *curcol;
+
+ gtk_window_set_title (GTK_WINDOW (select_domain_dialog), "Select Domain");
+
+ dialog_vbox1 = GTK_DIALOG (select_domain_dialog)->vbox;
+ gtk_widget_show (dialog_vbox1);
+
+ hbox1 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox1);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, TRUE, 0);
+
+ label1 = gtk_label_new ("Domain:");
+ gtk_widget_show (label1);
+ gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
+
+ select_domain_dialog->entry_domain = gtk_entry_new ();
+ gtk_widget_show (select_domain_dialog->entry_domain);
+ gtk_box_pack_start (GTK_BOX (hbox1), select_domain_dialog->entry_domain, TRUE, TRUE, 0);
+
+ scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow1);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), scrolledwindow1, TRUE, TRUE, 0);
+
+ select_domain_dialog->list_domains = gtk_tree_view_new ();
+ gtk_widget_show (select_domain_dialog->list_domains);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow1), select_domain_dialog->list_domains);
+
+ curcol = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_title(curcol, "Name");
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(curcol, renderer, True);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(select_domain_dialog->list_domains), curcol);
+ gtk_tree_view_column_add_attribute(curcol, renderer, "text", 0);
+
+ select_domain_dialog->store_domains = gtk_list_store_new(1, G_TYPE_STRING);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(select_domain_dialog->list_domains), GTK_TREE_MODEL(select_domain_dialog->store_domains));
+ g_object_unref(select_domain_dialog->store_domains);
+
+ dialog_action_area1 = GTK_DIALOG (select_domain_dialog)->action_area;
+ gtk_widget_show (dialog_action_area1);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
+
+ cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
+ gtk_widget_show (cancelbutton1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (select_domain_dialog), cancelbutton1, GTK_RESPONSE_CANCEL);
+ GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
+
+ okbutton1 = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (okbutton1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (select_domain_dialog), okbutton1, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
+}
+
+struct policy_handle gtk_select_domain_dialog_get_handle(GtkSelectDomainDialog *d)
+{
+ struct policy_handle h;
+
+
+ /* FIXME */
+ return h;
+}
+
+GType gtk_select_domain_dialog_get_type ()
+{
+ static GType mytype = 0;
+
+ if (!mytype)
+ {
+ static const GTypeInfo myinfo =
+ {
+ sizeof (GtkSelectDomainDialogClass),
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ sizeof(GtkSelectDomainDialog),
+ 0,
+ (GInstanceInitFunc) gtk_select_domain_dialog_init,
+ };
+
+ mytype = g_type_register_static (GTK_TYPE_DIALOG,
+ "GtkSelectDomainDialog", &myinfo, 0);
+ }
+
+ return mytype;
+}
+
+GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe)
+{
+ GtkSelectDomainDialog *d = gtk_type_new (gtk_select_domain_dialog_get_type ());
+ NTSTATUS status;
+ struct samr_EnumDomains r;
+ struct samr_Connect cr;
+ struct samr_Close dr;
+ struct policy_handle handle;
+ uint32_t resume_handle = 0;
+ int i;
+ TALLOC_CTX *mem_ctx = talloc_init("gtk_select_domain_dialog_new");
+
+ d->sam_pipe = sam_pipe;
+
+ cr.in.system_name = 0;
+ cr.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ cr.out.handle = &handle;
+
+ status = dcerpc_samr_Connect(sam_pipe, mem_ctx, &cr);
+ if (!NT_STATUS_IS_OK(status)) {
+ gtk_show_ntstatus(NULL, status);
+ talloc_destroy(mem_ctx);
+ return GTK_WIDGET(d);
+ }
+
+ r.in.handle = &handle;
+ r.in.resume_handle = &resume_handle;
+ r.in.buf_size = (uint32_t)-1;
+ r.out.resume_handle = &resume_handle;
+
+ status = dcerpc_samr_EnumDomains(sam_pipe, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ gtk_show_ntstatus(NULL, status);
+ } else if (r.out.sam) {
+ for (i=0;i<r.out.sam->count;i++) {
+ GtkTreeIter iter;
+ printf("- %s\n", r.out.sam->entries[i].name.name);
+ gtk_list_store_append(d->store_domains, &iter);
+ gtk_list_store_set (d->store_domains, &iter, 0, r.out.sam->entries[i].name.name, -1);
+ }
+ }
+
+ dr.in.handle = &handle;
+ dr.out.handle = &handle;
+
+ status = dcerpc_samr_Close(sam_pipe, mem_ctx, &dr);
+ if (!NT_STATUS_IS_OK(status)) {
+ gtk_show_ntstatus(NULL, status);
+ talloc_destroy(mem_ctx);
+ return GTK_WIDGET ( d );
+ }
+
+ talloc_destroy(mem_ctx);
+
+ return GTK_WIDGET ( d );
+}
+
+
+/* GtkSelectHostDialog */
+const char *gtk_select_host_dialog_get_host (GtkSelectHostDialog *d)
+{
+ return gtk_entry_get_text(GTK_ENTRY(d->entry_host));
+}
+
+void gtk_select_host_dialog_init (GtkSelectHostDialog *select_host_dialog)
+{
+ GtkWidget *dialog_vbox2;
+ GtkWidget *hbox2;
+ GtkWidget *label2;
+ GtkWidget *entry_host;
+ GtkWidget *scrolledwindow2;
+ GtkWidget *dialog_action_area2;
+ GtkWidget *cancelbutton2;
+ GtkWidget *okbutton2;
+
+ gtk_window_set_title (GTK_WINDOW (select_host_dialog), "Select Host");
+
+ dialog_vbox2 = GTK_DIALOG (select_host_dialog)->vbox;
+ gtk_widget_show (dialog_vbox2);
+
+ hbox2 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox2);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox2), hbox2, TRUE, TRUE, 0);
+
+ label2 = gtk_label_new ("Host");
+ gtk_widget_show (label2);
+ gtk_box_pack_start (GTK_BOX (hbox2), label2, FALSE, FALSE, 0);
+
+ select_host_dialog->entry_host = gtk_entry_new ();
+ gtk_widget_show (select_host_dialog->entry_host);
+ gtk_box_pack_start (GTK_BOX (hbox2), select_host_dialog->entry_host, TRUE, TRUE, 0);
+
+ scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow2);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox2), scrolledwindow2, TRUE, TRUE, 0);
+
+ select_host_dialog->tree_host = gtk_tree_view_new ();
+ gtk_widget_show (select_host_dialog->tree_host);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow2), select_host_dialog->tree_host);
+
+ select_host_dialog->store_host = gtk_tree_store_new(1, G_TYPE_STRING);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(select_host_dialog->tree_host), GTK_TREE_MODEL(select_host_dialog->store_host));
+ g_object_unref(select_host_dialog->store_host);
+
+ dialog_action_area2 = GTK_DIALOG (select_host_dialog)->action_area;
+ gtk_widget_show (dialog_action_area2);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area2), GTK_BUTTONBOX_END);
+
+ cancelbutton2 = gtk_button_new_from_stock ("gtk-cancel");
+ gtk_widget_show (cancelbutton2);
+ gtk_dialog_add_action_widget (GTK_DIALOG (select_host_dialog), cancelbutton2, GTK_RESPONSE_CANCEL);
+ GTK_WIDGET_SET_FLAGS (cancelbutton2, GTK_CAN_DEFAULT);
+
+ okbutton2 = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (okbutton2);
+ gtk_dialog_add_action_widget (GTK_DIALOG (select_host_dialog), okbutton2, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (okbutton2, GTK_CAN_DEFAULT);
+}
+
+GType gtk_select_host_dialog_get_type ()
+{
+ static GType mytype = 0;
+
+ if (!mytype)
+ {
+ static const GTypeInfo myinfo =
+ {
+ sizeof (GtkSelectHostDialogClass),
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ sizeof(GtkSelectHostDialog),
+ 0,
+ (GInstanceInitFunc) gtk_select_host_dialog_init,
+ };
+
+ mytype = g_type_register_static (GTK_TYPE_DIALOG,
+ "GtkSelectHostDialog", &myinfo, 0);
+ }
+
+ return mytype;
+}
+
+GtkWidget *gtk_select_host_dialog_new (BOOL nocredentials)
+{
+ return GTK_WIDGET ( gtk_type_new (gtk_select_host_dialog_get_type ()));
+}
+
+
diff --git a/source4/gtk/common/select.h b/source4/gtk/common/select.h
new file mode 100644
index 0000000000..b89712ffe0
--- /dev/null
+++ b/source4/gtk/common/select.h
@@ -0,0 +1,77 @@
+/*
+ Unix SMB/CIFS implementation.
+ SMB-related GTK+ functions
+
+ Copyright (C) Jelmer Vernooij 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __GTK_SELECT_H__
+#define __GTK_SELECT_H__
+
+#ifdef HAVE_GTK
+
+#include <gtk/gtk.h>
+
+typedef struct _GtkSelectDomainDialog GtkSelectDomainDialog;
+
+struct _GtkSelectDomainDialog
+{
+ GtkDialog dialog;
+ GtkWidget *entry_domain;
+ GtkWidget *list_domains;
+ GtkListStore *store_domains;
+ TALLOC_CTX *mem_ctx;
+ struct dcerpc_pipe *sam_pipe;
+};
+
+typedef struct _GtkSelectDomainDialogClass GtkSelectDomainDialogClass;
+
+struct _GtkSelectDomainDialogClass
+{
+ GtkDialogClass parent_class;
+};
+
+#define GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_rpc_binding_dialog_get_type (), GtkSelectDomainDialog)
+#define GTK_SELECT_DOMAIN_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_rpc_binding_dialog_class_get_type (), GtkSelectDomainDialogClass)
+#define IS_GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_rpc_binding_dialog_get_type ())
+
+typedef struct _GtkSelectHostDialog GtkSelectHostDialog;
+
+struct _GtkSelectHostDialog
+{
+ GtkDialog dialog;
+ GtkWidget *entry_host;
+ GtkWidget *tree_host;
+ GtkTreeStore *store_host;
+ struct dcerpc_pipe *sam_pipe;
+ TALLOC_CTX *mem_ctx;
+};
+
+typedef struct _GtkSelectHostDialogClass GtkSelectHostDialogClass;
+
+struct _GtkSelectHostDialogClass
+{
+ GtkDialogClass parent_class;
+};
+
+#define GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_rpc_binding_dialog_get_type (), GtkSelectHostDialog)
+#define GTK_SELECT_HOST_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_rpc_binding_dialog_class_get_type (), GtkSelectHostDialogClass)
+#define IS_GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_rpc_binding_dialog_get_type ())
+
+#endif
+
+#endif
diff --git a/source4/gtk/config.m4 b/source4/gtk/config.m4
index c939c4cbc8..757ce59c07 100644
--- a/source4/gtk/config.m4
+++ b/source4/gtk/config.m4
@@ -4,13 +4,17 @@ SMB_EXT_LIB_FROM_PKGCONFIG(gtk, [glib-2.0 gtk+-2.0])
SMB_SUBSYSTEM_ENABLE(GTKSMB, NO)
SMB_BINARY_ENABLE(gregedit, NO)
SMB_BINARY_ENABLE(gwcrontab, NO)
+SMB_BINARY_ENABLE(gwsam, NO)
if test t$SMB_EXT_LIB_ENABLE_gtk = tYES; then
SMB_SUBSYSTEM_ENABLE(GTKSMB, YES)
SMB_BINARY_ENABLE(gregedit, YES)
SMB_BINARY_ENABLE(gwcrontab, YES)
+ SMB_BINARY_ENABLE(gwsam, YES)
+ AC_DEFINE(HAVE_GTK, 1, [Whether GTK+ is available])
fi
SMB_SUBSYSTEM_MK(GTKSMB,gtk/config.mk)
SMB_BINARY_MK(gregedit,gtk/config.mk)
SMB_BINARY_MK(gwcrontab,gtk/config.mk)
+SMB_BINARY_MK(gwsam,gtk/config.mk)
diff --git a/source4/gtk/config.mk b/source4/gtk/config.mk
index 186e47691d..5ff34e7d09 100644
--- a/source4/gtk/config.mk
+++ b/source4/gtk/config.mk
@@ -3,10 +3,10 @@
##############################
# Start SUBSYSTEM GTKSMB
[SUBSYSTEM::GTKSMB]
-INIT_OBJ_FILES = gtk/common/gtk-smb.o
+INIT_OBJ_FILES = gtk/common/gtk-smb.o
+ADD_OBJ_FILES = gtk/common/select.o
REQUIRED_LIBRARIES = gtk
-REQUIRED_SUBSYSTEMS = \
- CHARSET LIBBASIC
+REQUIRED_SUBSYSTEMS = CHARSET LIBBASIC
# End SUBSYSTEM GTKSMB
##############################
@@ -25,3 +25,11 @@ OBJ_FILES = gtk/tools/gwcrontab.o
REQUIRED_SUBSYSTEMS = CONFIG LIBCMDLINE LIBRPC LIBSMB GTKSMB
# End BINARY gwcrontab
################################################
+
+################################################
+# Start BINARY gwsam
+[BINARY::gwsam]
+OBJ_FILES = gtk/tools/gwsam.o gtk/tools/gwsam_user.o
+REQUIRED_SUBSYSTEMS = CONFIG LIBCMDLINE LIBRPC LIBSMB GTKSMB
+# End BINARY gwsam
+################################################
diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c
index 6c13dcaef0..d26f393bb9 100644
--- a/source4/gtk/tools/gregedit.c
+++ b/source4/gtk/tools/gregedit.c
@@ -19,26 +19,14 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
#include "includes.h"
+#include "gtk/common/gtk-smb.h"
GtkWidget *openfilewin;
GtkWidget *savefilewin;
GtkTreeStore *store_keys;
GtkListStore *store_vals;
GtkWidget *tree_keys;
-GtkWidget *aboutwin;
GtkWidget *mainwin;
GtkWidget *save;
@@ -265,7 +253,7 @@ static void on_delete_activate (GtkMenuItem *menuitem,
static void on_about_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog());
+ GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog("gregedit"));
gtk_dialog_run(aboutwin);
gtk_widget_destroy(GTK_WIDGET(aboutwin));
}
diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c
index 9683570664..aef9c15b52 100644
--- a/source4/gtk/tools/gwcrontab.c
+++ b/source4/gtk/tools/gwcrontab.c
@@ -19,19 +19,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
#include "includes.h"
+#include "gtk/common/gtk-smb.h"
struct dcerpc_pipe *at_pipe = NULL;
GtkWidget *mainwin;
@@ -211,7 +200,7 @@ void
on_about_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog());
+ GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog("gwcrontab"));
gtk_dialog_run(aboutwin);
gtk_widget_destroy(GTK_WIDGET(aboutwin));
}
@@ -242,6 +231,7 @@ create_mainwindow (void)
accel_group = gtk_accel_group_new ();
mainwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_default_size (GTK_WINDOW (mainwindow), 642, 562);
gtk_window_set_title (GTK_WINDOW (mainwindow), "Task Scheduler");
vbox = gtk_vbox_new (FALSE, 0);
@@ -529,7 +519,7 @@ static GtkWidget*create_new_job_dialog (void)
-int main(int argc, char **argv)
+ int main(int argc, char **argv)
{
gtk_init(&argc, &argv);
mainwin = create_mainwindow();
diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c
new file mode 100644
index 0000000000..9df9698ba9
--- /dev/null
+++ b/source4/gtk/tools/gwsam.c
@@ -0,0 +1,410 @@
+/*
+ Unix SMB/CIFS implementation.
+ GTK+ SAM frontend
+
+ Copyright (C) Jelmer Vernooij 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "gtk/common/gtk-smb.h"
+
+struct policy_handle sam_handle;
+struct dcerpc_pipe *sam_pipe = NULL;
+struct policy_handle domain_handle;
+GtkWidget *mainwin;
+
+void update_grouplist()
+{
+ if(!sam_pipe) return;
+ //FIXME
+}
+
+void update_userlist()
+{
+ NTSTATUS status;
+ struct samr_EnumDomainUsers r;
+ uint32_t resume_handle=0;
+ int i;
+ BOOL ret = True;
+ TALLOC_CTX *mem_ctx;
+
+ if(!sam_pipe) return;
+
+ mem_ctx = talloc_init("update_userlist");
+ r.in.handle = &domain_handle;
+ r.in.resume_handle = &resume_handle;
+ r.in.acct_flags = 0;
+ r.in.max_size = (uint32_t)-1;
+ r.out.resume_handle = &resume_handle;
+
+ status = dcerpc_samr_EnumDomainUsers(sam_pipe, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ gtk_show_ntstatus(mainwin, status);
+ talloc_destroy(mem_ctx);
+ return;
+ }
+
+ if (!r.out.sam || r.out.sam->count == 0) {
+ talloc_destroy(mem_ctx);
+ return;
+ }
+
+ for (i=0;i<r.out.sam->count;i++) {
+ printf("Found: %s\n", r.out.sam->entries[i].name.name);
+ /* FIXME: Query user info */
+
+// if (!test_OpenUser(sam_pipe, mem_ctx, &sam_handle, r.out.sam->entries[i].idx)) {
+// ret = False;
+// }
+ }
+ talloc_destroy(mem_ctx);
+}
+
+void
+on_new1_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+
+}
+
+void
+on_select_domain_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkSelectDomainDialog *d;
+ gint result;
+ d = gtk_select_domain_dialog_new(sam_pipe);
+ result = gtk_dialog_run(GTK_DIALOG(d));
+ switch(result) {
+ case GTK_RESPONSE_ACCEPT:
+ break;
+ default:
+ gtk_widget_destroy(GTK_WIDGET(d));
+ return;
+ }
+ domain_handle = gtk_select_domain_dialog_get_handle(d);
+ gtk_widget_destroy(GTK_WIDGET(d));
+}
+
+void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
+{
+ GtkRpcBindingDialog *d;
+ NTSTATUS status;
+ struct samr_Connect r;
+ TALLOC_CTX *mem_ctx;
+ gint result;
+
+ d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE));
+ result = gtk_dialog_run(GTK_DIALOG(d));
+ switch(result) {
+ case GTK_RESPONSE_ACCEPT:
+ break;
+ default:
+ gtk_widget_destroy(GTK_WIDGET(d));
+ return;
+ }
+
+ /* If connected, get list of jobs */
+ status = dcerpc_pipe_connect(&sam_pipe, (char *)gtk_rpc_binding_dialog_get_binding(d, DCERPC_SAMR_NAME), DCERPC_SAMR_UUID, DCERPC_SAMR_VERSION, lp_workgroup(), (char *)gtk_rpc_binding_dialog_get_username(d), (char *)gtk_rpc_binding_dialog_get_password(d));
+ if(!NT_STATUS_IS_OK(status)) {
+ gtk_show_ntstatus(mainwin, status);
+ sam_pipe = NULL;
+ gtk_widget_destroy(GTK_WIDGET(d));
+ return;
+ }
+
+ r.in.system_name = 0;
+ r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ r.out.handle = &sam_handle;
+
+ mem_ctx = talloc_init("connect");
+ status = dcerpc_samr_Connect(sam_pipe, mem_ctx, &r);
+ talloc_destroy(mem_ctx);
+ if (!NT_STATUS_IS_OK(status)) {
+ gtk_show_ntstatus(mainwin, status);
+ sam_pipe = NULL;
+ gtk_widget_destroy(GTK_WIDGET(d));
+ return;
+ }
+
+ gtk_widget_destroy(GTK_WIDGET(d));
+
+ update_userlist();
+ update_grouplist();
+}
+
+void
+on_quit_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ if(sam_pipe)dcerpc_pipe_close(sam_pipe);
+ gtk_main_quit();
+}
+
+
+void
+on_account_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ //FIXME
+}
+
+
+void
+on_user_rights_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ //FIXME
+}
+
+
+void
+on_audit_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ //FIXME
+}
+
+
+void
+on_trust_relations_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ //FIXME
+}
+
+
+void
+on_refresh_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ update_userlist();
+ update_grouplist();
+}
+
+
+void
+on_about_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog("gwsam"));
+ gtk_dialog_run(aboutwin);
+ gtk_widget_destroy(GTK_WIDGET(aboutwin));
+}
+
+ GtkWidget*
+create_mainwindow (void)
+{
+ GtkWidget *mainwin;
+ GtkWidget *vbox1;
+ GtkWidget *connect;
+ GtkWidget *menubar;
+ GtkWidget *menuitem1;
+ GtkWidget *menuitem1_menu;
+ GtkWidget *new1;
+ GtkWidget *separatormenuitem1;
+ GtkWidget *quit;
+ GtkWidget *menuitem2;
+ GtkWidget *seldomain;
+ GtkWidget *menuitem2_menu;
+ GtkWidget *cut1;
+ GtkWidget *copy1;
+ GtkWidget *paste1;
+ GtkWidget *delete1;
+ GtkWidget *policies;
+ GtkWidget *policies_menu;
+ GtkWidget *account;
+ GtkWidget *user_rights;
+ GtkWidget *audit;
+ GtkWidget *separator1;
+ GtkWidget *trust_relations;
+ GtkWidget *menuitem3;
+ GtkWidget *menuitem3_menu;
+ GtkWidget *refresh;
+ GtkWidget *menuitem4;
+ GtkWidget *menuitem4_menu;
+ GtkWidget *about;
+ GtkWidget *vpaned;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *user_list;
+ GtkWidget *scrolledwindow2;
+ GtkWidget *group_list;
+ GtkWidget *statusbar;
+ GtkAccelGroup *accel_group;
+
+ accel_group = gtk_accel_group_new ();
+
+ mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_default_size (GTK_WINDOW (mainwin), 642, 562);
+ gtk_window_set_title (GTK_WINDOW (mainwin), "User Manager");
+
+ vbox1 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox1);
+ gtk_container_add (GTK_CONTAINER (mainwin), vbox1);
+
+ menubar = gtk_menu_bar_new ();
+ gtk_widget_show (menubar);
+ gtk_box_pack_start (GTK_BOX (vbox1), menubar, FALSE, FALSE, 0);
+
+ menuitem1 = gtk_menu_item_new_with_mnemonic ("_User");
+ gtk_widget_show (menuitem1);
+ gtk_container_add (GTK_CONTAINER (menubar), menuitem1);
+
+ menuitem1_menu = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem1), menuitem1_menu);
+
+ new1 = gtk_image_menu_item_new_from_stock ("gtk-new", accel_group);
+ gtk_widget_show (new1);
+ gtk_container_add (GTK_CONTAINER (menuitem1_menu), new1);
+
+ connect = gtk_menu_item_new_with_mnemonic ("_Connect");
+ gtk_widget_show (connect);
+ gtk_container_add (GTK_CONTAINER (menuitem1_menu), connect);
+
+ seldomain = gtk_menu_item_new_with_mnemonic("_Select Domain");
+ gtk_widget_show(seldomain);
+ gtk_container_add (GTK_CONTAINER (menuitem1_menu), seldomain);
+
+ separatormenuitem1 = gtk_separator_menu_item_new ();
+ gtk_widget_show (separatormenuitem1);
+ gtk_container_add (GTK_CONTAINER (menuitem1_menu), separatormenuitem1);
+ gtk_widget_set_sensitive (separatormenuitem1, FALSE);
+
+ quit = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
+ gtk_widget_show (quit);
+ gtk_container_add (GTK_CONTAINER (menuitem1_menu), quit);
+
+ policies = gtk_menu_item_new_with_mnemonic ("_Policies");
+ gtk_widget_show (policies);
+ gtk_container_add (GTK_CONTAINER (menubar), policies);
+
+ policies_menu = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (policies), policies_menu);
+
+ account = gtk_menu_item_new_with_mnemonic ("_Account...");
+ gtk_widget_show (account);
+ gtk_container_add (GTK_CONTAINER (policies_menu), account);
+
+ user_rights = gtk_menu_item_new_with_mnemonic ("_User Rights...");
+ gtk_widget_show (user_rights);
+ gtk_container_add (GTK_CONTAINER (policies_menu), user_rights);
+
+ audit = gtk_menu_item_new_with_mnemonic ("A_udit...");
+ gtk_widget_show (audit);
+ gtk_container_add (GTK_CONTAINER (policies_menu), audit);
+
+ separator1 = gtk_separator_menu_item_new ();
+ gtk_widget_show (separator1);
+ gtk_container_add (GTK_CONTAINER (policies_menu), separator1);
+ gtk_widget_set_sensitive (separator1, FALSE);
+
+ trust_relations = gtk_menu_item_new_with_mnemonic ("_Trust relations");
+ gtk_widget_show (trust_relations);
+ gtk_container_add (GTK_CONTAINER (policies_menu), trust_relations);
+
+ menuitem3 = gtk_menu_item_new_with_mnemonic ("_View");
+ gtk_widget_show (menuitem3);
+ gtk_container_add (GTK_CONTAINER (menubar), menuitem3);
+
+ menuitem3_menu = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem3), menuitem3_menu);
+
+ refresh = gtk_image_menu_item_new_from_stock ("gtk-refresh", accel_group);
+ gtk_widget_show (refresh);
+ gtk_container_add (GTK_CONTAINER (menuitem3_menu), refresh);
+
+ menuitem4 = gtk_menu_item_new_with_mnemonic ("_Help");
+ gtk_widget_show (menuitem4);
+ gtk_container_add (GTK_CONTAINER (menubar), menuitem4);
+
+ menuitem4_menu = gtk_menu_new ();
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menuitem4_menu);
+
+ about = gtk_menu_item_new_with_mnemonic ("_About");
+ gtk_widget_show (about);
+ gtk_container_add (GTK_CONTAINER (menuitem4_menu), about);
+
+ vpaned = gtk_vpaned_new ();
+ gtk_widget_show (vpaned);
+ gtk_box_pack_start (GTK_BOX (vbox1), vpaned, TRUE, TRUE, 0);
+
+ scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow1);
+ gtk_paned_pack1 (GTK_PANED (vpaned), scrolledwindow1, FALSE, TRUE);
+
+ user_list = gtk_tree_view_new ();
+ gtk_widget_show (user_list);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow1), user_list);
+
+ scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow2);
+ gtk_paned_pack2 (GTK_PANED (vpaned), scrolledwindow2, TRUE, TRUE);
+
+ group_list = gtk_tree_view_new ();
+ gtk_widget_show (group_list);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow2), group_list);
+
+ statusbar = gtk_statusbar_new ();
+ gtk_widget_show (statusbar);
+ gtk_box_pack_start (GTK_BOX (vbox1), statusbar, FALSE, FALSE, 0);
+
+ g_signal_connect ((gpointer) new1, "activate",
+ G_CALLBACK (on_new1_activate),
+ NULL);
+ g_signal_connect ((gpointer) seldomain, "activate",
+ G_CALLBACK (on_select_domain_activate),
+ NULL);
+ g_signal_connect ((gpointer) connect, "activate",
+ G_CALLBACK (on_connect_activate),
+ NULL);
+ g_signal_connect ((gpointer) quit, "activate",
+ G_CALLBACK (on_quit_activate),
+ NULL);
+ g_signal_connect ((gpointer) account, "activate",
+ G_CALLBACK (on_account_activate),
+ NULL);
+ g_signal_connect ((gpointer) user_rights, "activate",
+ G_CALLBACK (on_user_rights_activate),
+ NULL);
+ g_signal_connect ((gpointer) audit, "activate",
+ G_CALLBACK (on_audit_activate),
+ NULL);
+ g_signal_connect ((gpointer) trust_relations, "activate",
+ G_CALLBACK (on_trust_relations_activate),
+ NULL);
+ g_signal_connect ((gpointer) refresh, "activate",
+ G_CALLBACK (on_refresh_activate),
+ NULL);
+ g_signal_connect ((gpointer) about, "activate",
+ G_CALLBACK (on_about_activate),
+ NULL);
+
+ gtk_window_add_accel_group (GTK_WINDOW (mainwin), accel_group);
+
+ return mainwin;
+}
+
+
+
+ int main(int argc, char **argv)
+{
+ gtk_init(&argc, &argv);
+ mainwin = create_mainwindow();
+ gtk_widget_show(mainwin);
+ gtk_main();
+}
+
diff --git a/source4/gtk/tools/gwsam_user.c b/source4/gtk/tools/gwsam_user.c
new file mode 100644
index 0000000000..9b764dc1d2
--- /dev/null
+++ b/source4/gtk/tools/gwsam_user.c
@@ -0,0 +1,356 @@
+/*
+ Unix SMB/CIFS implementation.
+ GTK+ SAM frontend
+
+ Copyright (C) Jelmer Vernooij 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "gtk/common/gtk-smb.h"
+
+
+GtkWidget*
+create_user_edit_dialog (void)
+{
+ GtkWidget *user_edit_dialog;
+ GtkWidget *dialog_vbox1;
+ GtkWidget *notebook;
+ GtkWidget *table1;
+ GtkWidget *label4;
+ GtkWidget *label5;
+ GtkWidget *label6;
+ GtkWidget *label7;
+ GtkWidget *label8;
+ GtkWidget *chk_mustchange;
+ GtkWidget *entry_fullname;
+ GtkWidget *entry_description;
+ GtkWidget *lbl_username;
+ GtkWidget *entry_password;
+ GtkWidget *entry_confirm_password;
+ GtkWidget *chk_cannotchange;
+ GtkWidget *chk_cannotexpire;
+ GtkWidget *chk_disabled;
+ GtkWidget *chk_lockedout;
+ GtkWidget *label1;
+ GtkWidget *hbox1;
+ GtkWidget *scrolledwindow3;
+ GtkWidget *treeview3;
+ GtkWidget *vbox2;
+ GtkWidget *btn_groupadd;
+ GtkWidget *btn_groupdel;
+ GtkWidget *scrolledwindow4;
+ GtkWidget *treeview4;
+ GtkWidget *label2;
+ GtkWidget *vbox3;
+ GtkWidget *frame1;
+ GtkWidget *table2;
+ GtkWidget *label12;
+ GtkWidget *label13;
+ GtkWidget *entry_profilepath;
+ GtkWidget *entry_scriptname;
+ GtkWidget *label10;
+ GtkWidget *frame2;
+ GtkWidget *table3;
+ GtkWidget *label14;
+ GtkWidget *entry_homedir;
+ GtkWidget *chk_mapdrive;
+ GtkWidget *combo_homedrive;
+ GtkWidget *label11;
+ GtkWidget *label3;
+ GtkWidget *dialog_action_area1;
+ GtkWidget *cancelbutton1;
+ GtkWidget *applybutton1;
+ GtkWidget *okbutton1;
+
+ user_edit_dialog = gtk_dialog_new ();
+ gtk_window_set_title (GTK_WINDOW (user_edit_dialog), "Edit User");
+
+ dialog_vbox1 = GTK_DIALOG (user_edit_dialog)->vbox;
+ gtk_widget_show (dialog_vbox1);
+
+ notebook = gtk_notebook_new ();
+ gtk_widget_show (notebook);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox1), notebook, TRUE, TRUE, 0);
+
+ table1 = gtk_table_new (10, 2, FALSE);
+ gtk_widget_show (table1);
+ gtk_container_add (GTK_CONTAINER (notebook), table1);
+
+ label4 = gtk_label_new ("Username");
+ gtk_widget_show (label4);
+ gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
+
+ label5 = gtk_label_new ("Full name");
+ gtk_widget_show (label5);
+ gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
+
+ label6 = gtk_label_new ("Description");
+ gtk_widget_show (label6);
+ gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
+
+ label7 = gtk_label_new ("Password");
+ gtk_widget_show (label7);
+ gtk_table_attach (GTK_TABLE (table1), label7, 0, 1, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
+
+ label8 = gtk_label_new ("Confirm password");
+ gtk_widget_show (label8);
+ gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 4, 5,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);
+
+ chk_mustchange = gtk_check_button_new_with_mnemonic ("_User Must Change Password at Next Logon");
+ gtk_widget_show (chk_mustchange);
+ gtk_table_attach (GTK_TABLE (table1), chk_mustchange, 1, 2, 5, 6,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ entry_fullname = gtk_entry_new ();
+ gtk_widget_show (entry_fullname);
+ gtk_table_attach (GTK_TABLE (table1), entry_fullname, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ entry_description = gtk_entry_new ();
+ gtk_widget_show (entry_description);
+ gtk_table_attach (GTK_TABLE (table1), entry_description, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ lbl_username = gtk_label_new ("");
+ gtk_widget_show (lbl_username);
+ gtk_table_attach (GTK_TABLE (table1), lbl_username, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (lbl_username), 0, 0.5);
+
+ entry_password = gtk_entry_new ();
+ gtk_widget_show (entry_password);
+ gtk_table_attach (GTK_TABLE (table1), entry_password, 1, 2, 3, 4,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ entry_confirm_password = gtk_entry_new ();
+ gtk_widget_show (entry_confirm_password);
+ gtk_table_attach (GTK_TABLE (table1), entry_confirm_password, 1, 2, 4, 5,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ chk_cannotchange = gtk_check_button_new_with_mnemonic ("User Cannot Change Password");
+ gtk_widget_show (chk_cannotchange);
+ gtk_table_attach (GTK_TABLE (table1), chk_cannotchange, 1, 2, 6, 7,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ chk_cannotexpire = gtk_check_button_new_with_mnemonic ("Password Never Expires");
+ gtk_widget_show (chk_cannotexpire);
+ gtk_table_attach (GTK_TABLE (table1), chk_cannotexpire, 1, 2, 7, 8,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ chk_disabled = gtk_check_button_new_with_mnemonic ("Account Disabled");
+ gtk_widget_show (chk_disabled);
+ gtk_table_attach (GTK_TABLE (table1), chk_disabled, 1, 2, 8, 9,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ chk_lockedout = gtk_check_button_new_with_mnemonic ("Account Locked Out");
+ gtk_widget_show (chk_lockedout);
+ gtk_table_attach (GTK_TABLE (table1), chk_lockedout, 1, 2, 9, 10,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ label1 = gtk_label_new ("Main");
+ gtk_widget_show (label1);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0), label1);
+
+ hbox1 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox1);
+ gtk_container_add (GTK_CONTAINER (notebook), hbox1);
+
+ scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow3);
+ gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow3, TRUE, TRUE, 0);
+
+ treeview3 = gtk_tree_view_new ();
+ gtk_widget_show (treeview3);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview3);
+
+ vbox2 = gtk_vbox_new (TRUE, 0);
+ gtk_widget_show (vbox2);
+ gtk_box_pack_start (GTK_BOX (hbox1), vbox2, TRUE, TRUE, 0);
+
+ btn_groupadd = gtk_button_new_from_stock ("gtk-add");
+ gtk_widget_show (btn_groupadd);
+ gtk_box_pack_start (GTK_BOX (vbox2), btn_groupadd, FALSE, FALSE, 0);
+
+ btn_groupdel = gtk_button_new_from_stock ("gtk-remove");
+ gtk_widget_show (btn_groupdel);
+ gtk_box_pack_start (GTK_BOX (vbox2), btn_groupdel, FALSE, FALSE, 0);
+
+ scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow4);
+ gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow4, TRUE, TRUE, 0);
+
+ treeview4 = gtk_tree_view_new ();
+ gtk_widget_show (treeview4);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview4);
+
+ label2 = gtk_label_new ("Groups");
+ gtk_widget_show (label2);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1), label2);
+
+ vbox3 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox3);
+ gtk_container_add (GTK_CONTAINER (notebook), vbox3);
+
+ frame1 = gtk_frame_new (NULL);
+ gtk_widget_show (frame1);
+ gtk_box_pack_start (GTK_BOX (vbox3), frame1, TRUE, TRUE, 0);
+
+ table2 = gtk_table_new (2, 2, FALSE);
+ gtk_widget_show (table2);
+ gtk_container_add (GTK_CONTAINER (frame1), table2);
+
+ label12 = gtk_label_new ("User Profile Path:");
+ gtk_widget_show (label12);
+ gtk_table_attach (GTK_TABLE (table2), label12, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);
+
+ label13 = gtk_label_new ("Logon Script Name:");
+ gtk_widget_show (label13);
+ gtk_table_attach (GTK_TABLE (table2), label13, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);
+
+ entry_profilepath = gtk_entry_new ();
+ gtk_widget_show (entry_profilepath);
+ gtk_table_attach (GTK_TABLE (table2), entry_profilepath, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ entry_scriptname = gtk_entry_new ();
+ gtk_widget_show (entry_scriptname);
+ gtk_table_attach (GTK_TABLE (table2), entry_scriptname, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ label10 = gtk_label_new ("User Profiles");
+ gtk_widget_show (label10);
+ gtk_frame_set_label_widget (GTK_FRAME (frame1), label10);
+
+ frame2 = gtk_frame_new (NULL);
+ gtk_widget_show (frame2);
+ gtk_box_pack_start (GTK_BOX (vbox3), frame2, TRUE, TRUE, 0);
+
+ table3 = gtk_table_new (2, 2, FALSE);
+ gtk_widget_show (table3);
+ gtk_container_add (GTK_CONTAINER (frame2), table3);
+
+ label14 = gtk_label_new ("Path");
+ gtk_widget_show (label14);
+ gtk_table_attach (GTK_TABLE (table3), label14, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label14), 0, 0.5);
+
+ entry_homedir = gtk_entry_new ();
+ gtk_widget_show (entry_homedir);
+ gtk_table_attach (GTK_TABLE (table3), entry_homedir, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ chk_mapdrive = gtk_check_button_new_with_mnemonic ("Map homedir to drive");
+ gtk_widget_show (chk_mapdrive);
+ gtk_table_attach (GTK_TABLE (table3), chk_mapdrive, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ combo_homedrive = gtk_combo_box_entry_new_text ();
+ gtk_widget_show (combo_homedrive);
+ gtk_table_attach (GTK_TABLE (table3), combo_homedrive, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "C:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "D:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "E:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "F:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "G:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "H:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "I:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "J:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "K");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "L:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "M:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "N:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "O:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "P:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "Q:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "R:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "S:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "T:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "U:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "V:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "W:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "X:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "Y:");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "Z:");
+
+ label11 = gtk_label_new ("Home Directory");
+ gtk_widget_show (label11);
+ gtk_frame_set_label_widget (GTK_FRAME (frame2), label11);
+
+ label3 = gtk_label_new ("Profile");
+ gtk_widget_show (label3);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2), label3);
+
+ dialog_action_area1 = GTK_DIALOG (user_edit_dialog)->action_area;
+ gtk_widget_show (dialog_action_area1);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
+
+ cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
+ gtk_widget_show (cancelbutton1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (user_edit_dialog), cancelbutton1, GTK_RESPONSE_CANCEL);
+ GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
+
+ applybutton1 = gtk_button_new_from_stock ("gtk-apply");
+ gtk_widget_show (applybutton1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (user_edit_dialog), applybutton1, GTK_RESPONSE_APPLY);
+ GTK_WIDGET_SET_FLAGS (applybutton1, GTK_CAN_DEFAULT);
+
+ okbutton1 = gtk_button_new_from_stock ("gtk-ok");
+ gtk_widget_show (okbutton1);
+ gtk_dialog_add_action_widget (GTK_DIALOG (user_edit_dialog), okbutton1, GTK_RESPONSE_OK);
+ GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
+
+ return user_edit_dialog;
+}