#! /bin/sh

# COPYRIGHT POLICY
# ----------------
# 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.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to Free Software Foundation, Inc.
# 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Copyright (C) 1998 Luc Deschenaux <lcd@gkb.com>
#
# DISCLAIMER
# ----------
# Use it at your own risk. You're sole responsible for anything that could
# happend before, while, after or without using this program.


# the next line restarts using wish \
exec wish "$0" "$@"
# interface generated by SpecTcl version 1.1 from /root/vftpd/UserManager.ui
#   root     is the parent window for this user interface

proc UserManager_ui {root args} {

	# this treats "." as a special case

	if {$root == "."} {
	    set base ""
	} else {
	    set base $root
	}
    
	frame $base.frame#1

	label $base.label#4 \
		-text Users:
	catch {
		$base.label#4 configure \
			-font -*-Helvetica-Bold-R-Normal-*-*-120-*-*-*-*-*-*
	}

	listbox $base.listbox#1 \
		-height 0 \
		-width 0 \
		-yscrollcommand "$base.scrollbar#1 set"

	scrollbar $base.scrollbar#1 \
		-command "$base.listbox#1 yview" \
		-orient v

	button $base.button#3 \
		-command vftpd_RemoveButton \
		-text Remove \
		-width 8

	button $base.button#1 \
		-command {vftpd_AddUser } \
		-text Add \
		-width 8

	button $base.button#2 \
		-command vftpd_EdUser \
		-text Edit \
		-width 8


	# Geometry management

	grid $base.frame#1 -in $root	-row 1 -column 1  \
		-rowspan 9
	grid $base.label#4 -in $base.frame#1	-row 2 -column 2  \
		-sticky e
	grid $base.listbox#1 -in $base.frame#1	-row 2 -column 3  \
		-rowspan 7 \
		-sticky nesw
	grid $base.scrollbar#1 -in $base.frame#1	-row 2 -column 4  \
		-rowspan 7 \
		-sticky ns
	grid $base.button#3 -in $base.frame#1	-row 3 -column 6 
	grid $base.button#1 -in $base.frame#1	-row 7 -column 6 
	grid $base.button#2 -in $base.frame#1	-row 8 -column 6 

	# Resize behavior management

	grid rowconfigure $root 1 -weight 1 -minsize 30
	grid rowconfigure $root 2 -weight 0 -minsize 30
	grid rowconfigure $root 3 -weight 0 -minsize 30
	grid rowconfigure $root 4 -weight 0 -minsize 30
	grid rowconfigure $root 5 -weight 0 -minsize 30
	grid rowconfigure $root 6 -weight 0 -minsize 30
	grid rowconfigure $root 7 -weight 0 -minsize 30
	grid rowconfigure $root 8 -weight 0 -minsize 30
	grid rowconfigure $root 9 -weight 0 -minsize 17
	grid columnconfigure $root 1 -weight 0 -minsize 30

	grid rowconfigure $base.frame#1 1 -weight 1 -minsize 28
	grid rowconfigure $base.frame#1 2 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 3 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 4 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 5 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 6 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 7 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 8 -weight 0 -minsize 30
	grid rowconfigure $base.frame#1 9 -weight 0 -minsize 30
	grid columnconfigure $base.frame#1 1 -weight 0 -minsize 15
	grid columnconfigure $base.frame#1 2 -weight 0 -minsize 50
	grid columnconfigure $base.frame#1 3 -weight 0 -minsize 189
	grid columnconfigure $base.frame#1 4 -weight 0 -minsize 2
	grid columnconfigure $base.frame#1 5 -weight 0 -minsize 30
	grid columnconfigure $base.frame#1 6 -weight 0 -minsize 30
	grid columnconfigure $base.frame#1 7 -weight 0 -minsize 18
# additional interface code
source /usr/local/sbin/vftpd_users
vftpd_UserManager_Init








# end additional interface code

}


# Allow interface to be run "stand-alone" for testing

catch {
    if [info exists embed_args] {
	# we are running in the plugin
	UserManager_ui .
    } else {
	# we are running in stand-alone mode
	if {$argv0 == [info script]} {
	    wm title . "vftpdusers"
	    UserManager_ui .
	}
    }
}
