2 * This file is part of DisOrder
3 * Copyright (C) 2008 Richard Kettlewell
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 /** @file disobedience/users.c
21 * @brief User management for Disobedience
23 * The user management window contains:
24 * - a list of all the users
27 * - a user details panel
30 * When you select a user that user's details are displayed to the right of the
31 * list. Hit the Apply button and any changes are applied.
33 * When you select 'add' a new empty set of details are displayed to be edited.
34 * Again Apply will commit them.
36 * TODO: @ref RIGHT_ADMIN and @ref RIGHT_USERINFO should be applied here, so we
37 * can give decent error messages.
39 * TODO: it would be really nice if the Username entry could be removed and new
40 * user names entered in the list, rather off in the details panel. This may
41 * be possible with a sufficiently clever GtkCellRenderer.
44 #include "disobedience.h"
47 static GtkWidget
*users_window
;
48 static GtkListStore
*users_list
;
49 static GtkTreeSelection
*users_selection
;
51 static GtkWidget
*users_details_table
;
52 static GtkWidget
*users_apply_button
;
53 static GtkWidget
*users_delete_button
;
54 static GtkWidget
*users_details_name
;
55 static GtkWidget
*users_details_email
;
56 static GtkWidget
*users_details_password
;
57 static GtkWidget
*users_details_password2
;
58 static GtkWidget
*users_details_rights
[32];
59 static int users_details_row
;
60 static const char *users_selected
;
61 static const char *users_deferred_select
;
63 static int users_mode
;
68 #define mode(X) do { \
69 users_mode = MODE_##X; \
70 if(0) fprintf(stderr, "%s:%d: %s(): mode -> %s\n", \
71 __FILE__, __LINE__, __FUNCTION__, #X); \
72 users_details_sensitize_all(); \
75 static const char *users_email
, *users_rights
, *users_password
;
77 /** @brief qsort() callback for username comparison */
78 static int usercmp(const void *a
, const void *b
) {
79 return strcmp(*(char **)a
, *(char **)b
);
82 /** @brief Find a user
83 * @param user User to find
84 * @param iter Iterator to point at user
85 * @return 0 on success, -1 if not found
87 static int users_find_user(const char *user
,
92 if(!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(users_list
), iter
))
95 gtk_tree_model_get(GTK_TREE_MODEL(users_list
), iter
,
97 if(!strcmp(who
, user
)) {
102 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(users_list
), iter
));
106 /** @brief Called with the list of users
109 * - at startup to populate the initial list
110 * - when we add a user
111 * - maybe in the future when we delete a user
113 * If users_deferred_select is set then that user is selected.
115 static void users_got_list(void attribute((unused
)) *v
, int nvec
, char **vec
) {
119 /* Present users in alphabetical order */
120 qsort(vec
, nvec
, sizeof (char *), usercmp
);
121 /* Set the list contents */
122 gtk_list_store_clear(users_list
);
123 for(n
= 0; n
< nvec
; ++n
)
124 gtk_list_store_insert_with_values(users_list
, &iter
, n
/*position*/,
125 0, vec
[n
], /* column 0 */
126 -1); /* no more columns */
127 /* Only show the window when the list is populated */
128 gtk_widget_show_all(users_window
);
129 if(users_deferred_select
) {
130 if(!users_find_user(users_deferred_select
, &iter
))
131 gtk_tree_selection_select_iter(users_selection
, &iter
);
132 users_deferred_select
= 0;
136 /** @brief Text should be visible */
137 #define DETAIL_VISIBLE 1
139 /** @brief Text should be editable */
140 #define DETAIL_EDITABLE 2
142 /** @brief Add a row to the user detail table */
143 static void users_detail_generic(const char *title
,
144 GtkWidget
*selector
) {
145 const int row
= users_details_row
++;
146 GtkWidget
*const label
= gtk_label_new(title
);
147 gtk_misc_set_alignment(GTK_MISC(label
), 1, 0);
148 gtk_table_attach(GTK_TABLE(users_details_table
),
150 0, 1, /* left/right_attach */
151 row
, row
+1, /* top/bottom_attach */
152 GTK_FILL
, /* xoptions */
154 1, 1); /* x/ypadding */
155 gtk_table_attach(GTK_TABLE(users_details_table
),
157 1, 2, /* left/right_attach */
158 row
, row
+ 1, /* top/bottom_attach */
159 GTK_EXPAND
|GTK_FILL
, /* xoptions */
160 GTK_FILL
, /* yoptions */
161 1, 1); /* x/ypadding */
164 /** @brief Add a row to the user details table
165 * @param entryp Where to put GtkEntry
166 * @param title Label for this row
167 * @param value Initial value or NULL
168 * @param flags Flags word
170 static void users_add_detail(GtkWidget
**entryp
,
176 if(!(entry
= *entryp
)) {
177 *entryp
= entry
= gtk_entry_new();
178 users_detail_generic(title
, entry
);
180 gtk_entry_set_visibility(GTK_ENTRY(entry
),
181 !!(flags
& DETAIL_VISIBLE
));
182 gtk_editable_set_editable(GTK_EDITABLE(entry
),
183 !!(flags
& DETAIL_EDITABLE
));
184 gtk_entry_set_text(GTK_ENTRY(entry
), value ? value
: "");
187 /** @brief Add a checkbox for a right
188 * @param title Label for this row
189 * @param value Current value
190 * @param right Right bit
192 static void users_add_right(const char *title
,
196 GtkWidget
**checkp
= &users_details_rights
[leftmost_bit(right
)];
198 if(!(check
= *checkp
)) {
199 *checkp
= check
= gtk_check_button_new();
200 users_detail_generic(title
, check
);
202 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check
), !!(value
& right
));
205 /** @brief Set sensitivity of particular mine/random rights bits */
206 static void users_details_sensitize(rights_type r
) {
207 const int bit
= leftmost_bit(r
);
208 const GtkWidget
*all
= users_details_rights
[bit
];
209 const int sensitive
= (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(all
))
210 && users_mode
!= MODE_NONE
);
212 gtk_widget_set_sensitive(users_details_rights
[bit
+ 1], sensitive
);
213 gtk_widget_set_sensitive(users_details_rights
[bit
+ 2], sensitive
);
216 /** @brief Set sensitivity of everything in sight */
217 static void users_details_sensitize_all(void) {
220 for(n
= 0; n
< 32; ++n
)
221 if(users_details_rights
[n
])
222 gtk_widget_set_sensitive(users_details_rights
[n
], users_mode
!= MODE_NONE
);
223 gtk_widget_set_sensitive(users_details_name
, users_mode
!= MODE_NONE
);
224 gtk_widget_set_sensitive(users_details_email
, users_mode
!= MODE_NONE
);
225 gtk_widget_set_sensitive(users_details_password
, users_mode
!= MODE_NONE
);
226 gtk_widget_set_sensitive(users_details_password2
, users_mode
!= MODE_NONE
);
227 users_details_sensitize(RIGHT_MOVE_ANY
);
228 users_details_sensitize(RIGHT_REMOVE_ANY
);
229 users_details_sensitize(RIGHT_SCRATCH_ANY
);
230 gtk_widget_set_sensitive(users_apply_button
, users_mode
!= MODE_NONE
);
231 gtk_widget_set_sensitive(users_delete_button
, !!users_selected
);
234 /** @brief Called when an _ALL widget is toggled
236 * Modifies sensitivity of the corresponding _MINE and _RANDOM widgets. We
237 * just do the lot rather than trying to figure out which one changed,
239 static void users_any_toggled(GtkToggleButton
attribute((unused
)) *togglebutton
,
240 gpointer
attribute((unused
)) user_data
) {
241 users_details_sensitize_all();
244 /** @brief Add a checkbox for a three-right group
245 * @param title Label for this row
246 * @param bits Rights bits (not masked or normalized)
247 * @param mask Mask for this group (must be 7*2^n)
249 static void users_add_right_group(const char *title
,
252 const uint32_t first
= mask
/ 7;
253 const int bit
= leftmost_bit(first
);
254 GtkWidget
**widgets
= &users_details_rights
[bit
], *any
, *mine
, *random
;
257 GtkWidget
*hbox
= gtk_hbox_new(FALSE
, 2);
259 any
= widgets
[0] = gtk_check_button_new_with_label("Any");
260 mine
= widgets
[1] = gtk_check_button_new_with_label("Own");
261 random
= widgets
[2] = gtk_check_button_new_with_label("Random");
262 gtk_box_pack_start(GTK_BOX(hbox
), any
, FALSE
, FALSE
, 0);
263 gtk_box_pack_start(GTK_BOX(hbox
), mine
, FALSE
, FALSE
, 0);
264 gtk_box_pack_start(GTK_BOX(hbox
), random
, FALSE
, FALSE
, 0);
265 users_detail_generic(title
, hbox
);
266 g_signal_connect(any
, "toggled", G_CALLBACK(users_any_toggled
), NULL
);
267 users_details_rights
[bit
] = any
;
268 users_details_rights
[bit
+ 1] = mine
;
269 users_details_rights
[bit
+ 2] = random
;
275 /* Discard irrelevant bits */
277 /* Shift down to bits 0-2; the mask is always 3 contiguous bits */
279 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(any
), !!(bits
& 1));
280 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mine
), !!(bits
& 2));
281 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(random
), !!(bits
& 4));
284 /** @brief Called when the details table is destroyed */
285 static void users_details_destroyed(GtkWidget
attribute((unused
)) *widget
,
286 GtkWidget
attribute((unused
)) **wp
) {
287 users_details_table
= 0;
288 g_object_unref(users_list
);
290 users_details_name
= 0;
291 users_details_email
= 0;
292 users_details_password
= 0;
293 users_details_password2
= 0;
294 memset(users_details_rights
, 0, sizeof users_details_rights
);
295 /* also users_selection? Not AFAICT; _get_selection does upref */
298 /** @brief Create or modify the user details table
299 * @param name User name (users_edit()) or NULL (users_add())
300 * @param email Email address
301 * @param rights User rights string
302 * @param password Password
304 static void users_makedetails(const char *name
,
307 const char *password
,
312 /* Create the table if it doesn't already exist */
313 if(!users_details_table
) {
314 users_details_table
= gtk_table_new(4, 2, FALSE
/*!homogeneous*/);
315 g_signal_connect(users_details_table
, "destroy",
316 G_CALLBACK(users_details_destroyed
), 0);
319 /* Create or update the widgets */
320 users_add_detail(&users_details_name
, "Username", name
,
321 (DETAIL_EDITABLE
|DETAIL_VISIBLE
) & nameflags
);
323 users_add_detail(&users_details_email
, "Email", email
,
324 (DETAIL_EDITABLE
|DETAIL_VISIBLE
) & flags
);
326 users_add_detail(&users_details_password
, "Password", password
,
327 DETAIL_EDITABLE
& flags
);
328 users_add_detail(&users_details_password2
, "Password", password
,
329 DETAIL_EDITABLE
& flags
);
331 parse_rights(rights
, &r
, 0);
332 users_add_right("Read operations", r
, RIGHT_READ
);
333 users_add_right("Play track", r
, RIGHT_PLAY
);
334 users_add_right_group("Move", r
, RIGHT_MOVE__MASK
);
335 users_add_right_group("Remove", r
, RIGHT_REMOVE__MASK
);
336 users_add_right_group("Scratch", r
, RIGHT_SCRATCH__MASK
);
337 users_add_right("Set volume", r
, RIGHT_VOLUME
);
338 users_add_right("Admin operations", r
, RIGHT_ADMIN
);
339 users_add_right("Rescan", r
, RIGHT_RESCAN
);
340 users_add_right("Register new users", r
, RIGHT_REGISTER
);
341 users_add_right("Modify own userinfo", r
, RIGHT_USERINFO
);
342 users_add_right("Modify track preferences", r
, RIGHT_PREFS
);
343 users_add_right("Modify global preferences", r
, RIGHT_GLOBAL_PREFS
);
344 users_add_right("Pause/resume tracks", r
, RIGHT_PAUSE
);
345 users_details_sensitize_all();
348 /** @brief Called when the 'add' button is pressed */
349 static void users_add(GtkButton
attribute((unused
)) *button
,
350 gpointer
attribute((unused
)) userdata
) {
351 /* Unselect whatever is selected */
352 gtk_tree_selection_unselect_all(users_selection
);
354 /* TODO it would be better to use the server default_rights if there's no
356 users_makedetails("",
358 config
->default_rights
,
360 DETAIL_EDITABLE
|DETAIL_VISIBLE
,
361 DETAIL_EDITABLE
|DETAIL_VISIBLE
);
362 /* Remember we're adding a user */
366 static rights_type
users_get_rights(void) {
370 /* Extract the rights value */
371 for(n
= 0; n
< 32; ++n
) {
372 if(users_details_rights
[n
])
373 if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(users_details_rights
[n
])))
376 /* Throw out redundant bits */
377 if(r
& RIGHT_REMOVE_ANY
)
378 r
&= ~(rights_type
)(RIGHT_REMOVE_MINE
|RIGHT_REMOVE_RANDOM
);
379 if(r
& RIGHT_MOVE_ANY
)
380 r
&= ~(rights_type
)(RIGHT_MOVE_MINE
|RIGHT_MOVE_RANDOM
);
381 if(r
& RIGHT_SCRATCH_ANY
)
382 r
&= ~(rights_type
)(RIGHT_SCRATCH_MINE
|RIGHT_SCRATCH_RANDOM
);
386 /** @brief Called when various things fail */
387 static void users_op_failed(struct callbackdata
attribute((unused
)) *cbd
,
388 int attribute((unused
)) code
,
390 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, msg
);
393 /** @brief Called when a new user has been created */
394 static void users_adduser_completed(void *v
) {
395 struct callbackdata
*cbd
= v
;
397 /* Now the user is created we can go ahead and set the email address */
398 if(*cbd
->u
.edituser
.email
) {
399 struct callbackdata
*ncbd
= xmalloc(sizeof *cbd
);
400 ncbd
->onerror
= users_op_failed
;
401 disorder_eclient_edituser(client
, NULL
, cbd
->u
.edituser
.user
,
402 "email", cbd
->u
.edituser
.email
, ncbd
);
404 /* Refresh the list of users */
405 disorder_eclient_users(client
, users_got_list
, 0);
406 /* We'll select the newly created user */
407 users_deferred_select
= cbd
->u
.edituser
.user
;
410 /** @brief Called if creating a new user fails */
411 static void users_adduser_failed(struct callbackdata
attribute((unused
)) *cbd
,
412 int attribute((unused
)) code
,
414 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, msg
);
415 mode(ADD
); /* Let the user try again */
418 /** @brief Called when the 'Apply' button is pressed */
419 static void users_apply(GtkButton
attribute((unused
)) *button
,
420 gpointer
attribute((unused
)) userdata
) {
421 struct callbackdata
*cbd
;
422 const char *password
;
423 const char *password2
;
431 name
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_name
)));
432 email
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_email
)));
433 password
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_password
)));
434 password2
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_password2
)));
436 /* No username. Really we wanted to desensitize the Apply button when
437 * there's no userame but there doesn't seem to be a signal to detect
438 * changes to the entry text. Consequently we have error messages
440 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, "Must enter a username");
443 if(strcmp(password
, password2
)) {
444 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, "Passwords do not match");
447 if(*email
&& !strchr(email
, '@')) {
448 /* The server will complain about this but we can give a better error
449 * message this way */
450 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, "Invalid email address");
453 cbd
= xmalloc(sizeof *cbd
);
454 cbd
->onerror
= users_adduser_failed
;
455 cbd
->u
.edituser
.user
= name
;
456 cbd
->u
.edituser
.email
= email
;
457 disorder_eclient_adduser(client
, users_adduser_completed
,
460 rights_string(users_get_rights()),
462 /* We switch to no-op mode while creating the user */
466 /* Ugh, can we de-dupe with above? */
467 email
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_email
)));
468 password
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_password
)));
469 password2
= xstrdup(gtk_entry_get_text(GTK_ENTRY(users_details_password2
)));
470 if(strcmp(password
, password2
)) {
471 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, "Passwords do not match");
474 if(*email
&& !strchr(email
, '@')) {
475 popup_submsg(users_window
, GTK_MESSAGE_ERROR
, "Invalid email address");
478 cbd
= xmalloc(sizeof *cbd
);
479 cbd
->onerror
= users_op_failed
;
480 disorder_eclient_edituser(client
, NULL
, users_selected
,
481 "email", email
, cbd
);
482 disorder_eclient_edituser(client
, NULL
, users_selected
,
483 "password", password
, cbd
);
484 disorder_eclient_edituser(client
, NULL
, users_selected
,
485 "rights", rights_string(users_get_rights()), cbd
);
486 /* We remain in edit mode */
491 /** @brief Called when a user has been deleted */
492 static void users_deleted(void *v
) {
493 const struct callbackdata
*const cbd
= v
;
496 if(!users_find_user(cbd
->u
.user
, iter
)) /* Find the user... */
497 gtk_list_store_remove(users_list
, iter
); /* ...and remove them */
500 /** @brief Called when the 'Delete' button is pressed */
501 static void users_delete(GtkButton
attribute((unused
)) *button
,
502 gpointer
attribute((unused
)) userdata
) {
505 struct callbackdata
*cbd
;
509 yesno
= gtk_message_dialog_new(GTK_WINDOW(users_window
),
511 GTK_MESSAGE_QUESTION
,
513 "Do you really want to delete user %s?"
514 " This action cannot be undone.",
516 res
= gtk_dialog_run(GTK_DIALOG(yesno
));
517 gtk_widget_destroy(yesno
);
518 if(res
== GTK_RESPONSE_YES
) {
519 cbd
= xmalloc(sizeof *cbd
);
520 cbd
->onerror
= users_op_failed
;
521 cbd
->u
.user
= users_selected
;
522 disorder_eclient_deluser(client
, users_deleted
, cbd
->u
.user
, cbd
);
526 static void users_got_email(void attribute((unused
)) *v
, const char *value
) {
530 static void users_got_rights(void attribute((unused
)) *v
, const char *value
) {
531 users_rights
= value
;
534 static void users_got_password(void attribute((unused
)) *v
, const char *value
) {
535 users_password
= value
;
536 users_makedetails(users_selected
,
541 DETAIL_EDITABLE
|DETAIL_VISIBLE
);
545 /** @brief Called when the selection MIGHT have changed */
546 static void users_selection_changed(GtkTreeSelection
attribute((unused
)) *treeselection
,
547 gpointer
attribute((unused
)) user_data
) {
549 char *gselected
, *selected
;
551 /* Identify the current selection */
552 if(gtk_tree_selection_get_selected(users_selection
, 0, &iter
)) {
553 gtk_tree_model_get(GTK_TREE_MODEL(users_list
), &iter
,
555 selected
= xstrdup(gselected
);
559 /* Eliminate no-change cases */
560 if(!selected
&& !users_selected
)
562 if(selected
&& users_selected
&& !strcmp(selected
, users_selected
))
564 /* There's been a change; junk the old data and fetch new data in
566 users_selected
= selected
;
567 users_makedetails("", "", "", "",
571 disorder_eclient_userinfo(client
, users_got_email
, users_selected
,
573 disorder_eclient_userinfo(client
, users_got_rights
, users_selected
,
575 disorder_eclient_userinfo(client
, users_got_password
, users_selected
,
578 mode(NONE
); /* not editing *yet* */
581 /** @brief Table of buttons below the user list */
582 static struct button users_buttons
[] = {
596 #define NUSERS_BUTTONS (sizeof users_buttons / sizeof *users_buttons)
598 /** @brief Pop up the user management window */
599 void manage_users(void) {
600 GtkWidget
*tree
, *buttons
, *hbox
, *hbox2
, *vbox
, *vbox2
;
602 GtkTreeViewColumn
*col
;
604 /* If the window already exists just raise it */
606 gtk_window_present(GTK_WINDOW(users_window
));
609 /* Create the window */
610 users_window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
611 gtk_widget_set_style(users_window
, tool_style
);
612 g_signal_connect(users_window
, "destroy",
613 G_CALLBACK(gtk_widget_destroyed
), &users_window
);
614 gtk_window_set_title(GTK_WINDOW(users_window
), "User Management");
615 /* default size is too small */
616 gtk_window_set_default_size(GTK_WINDOW(users_window
), 240, 240);
618 /* Create the list of users and populate it asynchronously */
619 users_list
= gtk_list_store_new(1, G_TYPE_STRING
);
620 disorder_eclient_users(client
, users_got_list
, 0);
621 /* Create the view */
622 tree
= gtk_tree_view_new_with_model(GTK_TREE_MODEL(users_list
));
623 /* ...and the renderers for it */
624 cr
= gtk_cell_renderer_text_new();
625 col
= gtk_tree_view_column_new_with_attributes("Username",
629 gtk_tree_view_append_column(GTK_TREE_VIEW(tree
), col
);
630 /* Get the selection for the view; set its mode; arrange for a callback when
632 users_selection
= gtk_tree_view_get_selection(GTK_TREE_VIEW(tree
));
633 gtk_tree_selection_set_mode(users_selection
, GTK_SELECTION_BROWSE
);
634 g_signal_connect(users_selection
, "changed",
635 G_CALLBACK(users_selection_changed
), NULL
);
637 /* Create the control buttons */
638 buttons
= create_buttons_box(users_buttons
,
640 gtk_hbox_new(FALSE
, 1));
641 users_delete_button
= users_buttons
[1].widget
;
643 /* Buttons live below the list */
644 vbox
= gtk_vbox_new(FALSE
, 2);
645 gtk_box_pack_start(GTK_BOX(vbox
), tree
, TRUE
/*expand*/, TRUE
/*fill*/, 0);
646 gtk_box_pack_start(GTK_BOX(vbox
), buttons
, FALSE
/*expand*/, FALSE
, 0);
648 /* Create an empty user details table, and put an apply button below it */
649 users_apply_button
= gtk_button_new_from_stock(GTK_STOCK_APPLY
);
650 users_makedetails("", "", "", "",
653 g_signal_connect(users_apply_button
, "clicked",
654 G_CALLBACK(users_apply
), NULL
);
655 hbox2
= gtk_hbox_new(FALSE
, 0);
656 gtk_box_pack_end(GTK_BOX(hbox2
), users_apply_button
,
657 FALSE
/*expand*/, FALSE
, 0);
659 vbox2
= gtk_vbox_new(FALSE
, 0);
660 gtk_box_pack_start(GTK_BOX(vbox2
), users_details_table
,
661 TRUE
/*expand*/, TRUE
/*fill*/, 0);
662 gtk_box_pack_start(GTK_BOX(vbox2
), hbox2
,
663 FALSE
/*expand*/, FALSE
, 0);
665 /* User details are to the right of the list */
666 hbox
= gtk_hbox_new(FALSE
, 2);
667 gtk_box_pack_start(GTK_BOX(hbox
), vbox
, FALSE
/*expand*/, FALSE
, 2);
668 gtk_box_pack_start(GTK_BOX(hbox
), vbox2
, TRUE
/*expand*/, TRUE
/*fill*/, 2);
669 gtk_container_add(GTK_CONTAINER(users_window
), hbox
);