head	1.16;
access;
symbols
	RELENG_9:1.16.0.2;
locks; strict;
comment	@# @;


1.16
date	2013.07.06.00.40.32;	author svnexp;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	2013.06.25.00.35.22;	author svnexp;	state Exp;
branches;
next	1.14;

1.14
date	2013.06.09.00.43.38;	author svnexp;	state Exp;
branches;
next	1.13;

1.13
date	2013.06.03.00.32.49;	author svnexp;	state Exp;
branches;
next	1.12;

1.12
date	2013.06.02.00.37.30;	author svnexp;	state Exp;
branches;
next	1.11;

1.11
date	2013.06.01.00.35.21;	author svnexp;	state Exp;
branches;
next	1.10;

1.10
date	2013.04.23.00.30.01;	author svnexp;	state Exp;
branches;
next	1.9;

1.9
date	2013.01.15.00.52.23;	author svnexp;	state Exp;
branches;
next	1.8;

1.8
date	2012.12.25.11.03.38;	author svnexp;	state Exp;
branches;
next	1.7;

1.7
date	2012.12.25.09.37.00;	author svnexp;	state Exp;
branches;
next	1.6;

1.6
date	2012.12.21.19.30.51;	author svnexp;	state Exp;
branches;
next	1.5;

1.5
date	2012.11.17.04.41.48;	author svnexp;	state Exp;
branches;
next	1.4;

1.4
date	2012.11.17.01.54.40;	author svnexp;	state Exp;
branches;
next	1.3;

1.3
date	2012.09.20.23.44.13;	author dteske;	state Exp;
branches;
next	1.2;

1.2
date	2012.09.18.22.28.42;	author dteske;	state Exp;
branches;
next	1.1;

1.1
date	2012.07.14.03.16.57;	author dteske;	state Exp;
branches;
next	;

1.16.2.1
date	2013.07.06.00.40.32;	author svnexp;	state dead;
branches;
next	1.16.2.2;

1.16.2.2
date	2013.07.07.20.03.18;	author svnexp;	state Exp;
branches;
next	1.16.2.3;

1.16.2.3
date	2014.03.27.04.02.36;	author svnexp;	state dead;
branches;
next	;


desc
@@


1.16
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/252795
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@#!/bin/sh
#-
# Copyright (c) 2012 Ron McDowell
# Copyright (c) 2012-2013 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 252795 2013-07-05 16:00:01Z dteske $
#
############################################################ INCLUDES

BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." "$0"
f_include $BSDCFG_SHARE/dialog.subr
f_include $BSDCFG_SHARE/mustberoot.subr
f_include $BSDCFG_SHARE/usermgmt/group_input.subr

BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr

ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"

############################################################ CONFIGURATION

# set some reasonable defaults if /etc/adduser.conf does not exist.
[ -f /etc/adduser.conf ] && f_include /etc/adduser.conf
: ${passwdtype:="yes"}

############################################################ FUNCTIONS

# save_changes
#
# Save any/all settings (actions performed depend on $mode value).
#
save_changes()
{
	local err retval=$SUCCESS

	case "$mode" in
	Delete)
		err=$( pw groupdel "$group_name" 2>&1 )
		retval=$?
		if [ $retval -ne $SUCCESS ]; then
			f_dialog_msgbox "$msg_error $err\n"
			return $retval
		fi
		f_show_msg "$msg_group_deleted"
		;;
	Add)
		local cmd="pw groupadd -n '$group_name'"
		[ "$group_gid" ] && cmd="$cmd -g '$group_gid'"
		[ "$group_members" != "$cur_group_members" ] &&
			cmd="$cmd -M '$group_members'"
		if [ "$pw_group_password_disable" ]; then
			cmd="$cmd -h -"
		elif [ "$group_password" ]; then
			cmd="echo \"\$group_password\" | $cmd -h 0"
		fi
		f_dprintf "cmd=%s" "$cmd"
		err=$( eval $cmd 2>&1 )
		retval=$?
		if [ $retval -ne $SUCCESS ]; then
			f_dialog_msgbox "$msg_error $err\n"
			return $retval
		fi
		f_show_msg "$msg_group_added"
		;;
	Edit/View)
		local cmd="pw groupmod -n '$group_name'"
		[ "$group_gid" ] && cmd="$cmd -g '$group_gid'"
		[ "$group_members" != "$cur_group_members" ] &&
			cmd="$cmd -M '$group_members'"
		if [ "$pw_group_password_disable" ]; then
			cmd="$cmd -h -"
		elif [ "$group_password" ]; then
			cmd="echo \"\$group_password\" | $cmd -h 0"
		fi
		f_dprintf "cmd=%s" "$cmd"
		err=$( eval $cmd 2>&1 )
		retval=$?
		if [ $retval -ne $SUCCESS ]; then
			f_dialog_msgbox "$msg_error $err\n"
			return $retval
		fi
		f_show_msg "$msg_group_updated"
		;;
	esac

	save_flag=
	return $SUCCESS
}

# dialog_title_update $mode
#
# Set the title based on the given $mode.
# 
dialog_title_update()
{
	local mode="$1"
	case "$mode" in
	Add)       f_dialog_title "$msg_add $msg_group" ;;
	Edit/View) f_dialog_title "$msg_edit_view $msg_group: $group" ;;
	Delete)    f_dialog_title "$msg_delete $msg_group: $group" ;;
	esac
}

############################################################ MAIN

# Incorporate rc-file if it exists
[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"

#
# Process command-line arguments
#
while [ $# -gt 0 ]; do
	key="${1%%=*}"
	value="${1#*=}"
	f_dprintf "key=[%s] value=[%s]" "$key" "$value"
	case "$key" in
	mode) mode="$value" ;;
	group) group="$value" ;;
	esac
	shift
done
f_dprintf "mode=[%s] group=[%s]" "$mode" "$group"

#
# Initialize
#
dialog_title_update "$mode"
f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
f_mustberoot_init
menu_text=
save_flag=
hline="$hline_arrows_tab_enter"

if [ "$mode" = "Add" ]; then
	f_dialog_input_group_name || exit 0

	f_dialog_noyes "$msg_use_default_values_for_all_account_details"
	retval=$?

	if [ $retval -eq 255 ]; then # User pressed ESC
		exit $SUCCESS
	elif [ $retval -ne $SUCCESS ]; then
		#
		# Ask a series of questions to pre-fill the editor screen.
		#
		# The defaults used in each dialog should allow the user to
		# simply hit ENTER to proceed, because cancelling a single
		# dialog will cause them to be returned to the main groupmenu.
		#
	
		[ "$passwdtype" = "yes" ] &&
			{ f_dialog_input_group_password || exit 0; }
		f_dialog_input_group_gid  || exit 0
		f_dialog_input_group_members || exit 0
	fi
fi

if [ "$mode" = "Edit/View" -o "$mode" = "Delete" ]; then
	f_input_group "$group" || f_die 1 "$msg_group_not_found"
fi

cur_group_name="$group_name"
cur_group_password="$group_password"
cur_group_gid="$group_gid"
cur_group_members="$group_members"

[ "$mode" = "Delete" ] && save_flag=1

#
# Loop until the user decides to Exit, Cancel, or presses ESC
#
while :; do
	dialog_title_update "$mode"

	menu_text=
	menu_exit="$msg_exit"
	if [ "$save_flag" ]; then
		if [ "$mode" = "Delete" ]; then
			menu_exit="$msg_delete/$msg_exit"
			menu_text="$msg_delete_exit_or_cancel"
		else
			menu_exit="$msg_save/$msg_exit"
			menu_text="$msg_save_exit_or_cancel"
		fi
	fi

	case "$mode" in
	Delete)
		menu_items="
			'X' '$menu_exit'
			'1' '$msg_group: $group_name'
			'-' '$msg_password: -----'
			'-' '$msg_group_id: $group_gid'
			'-' '$msg_group_members: $group_members'
		" # END-QUOTE
		;;
	*)
		menu_items="
			'X' '$menu_exit'
			'1' '$msg_group: $group_name'
			'2' '$msg_password: -----'
			'3' '$msg_group_id: $group_gid'
			'4' '$msg_group_members: $group_members'
		" # END-QUOTE
	esac

	eval f_dialog_menu_size height width rows \
	                        \"\$DIALOG_TITLE\"     \
	                        \"\$DIALOG_BACKTITLE\" \
	                        \"\$menu_text\"        \
	                        \"\$hline\"            \
	                        $menu_items

	f_dialog_default_fetch defaultitem
	mtag=$( eval $DIALOG \
		--title \"\$DIALOG_TITLE\"         \
		--backtitle \"\$DIALOG_BACKTITLE\" \
		--hline \"\$hline\"                \
		--ok-label \"\$msg_ok\"            \
		--cancel-label \"\$msg_cancel\"    \
		--default-item \"\$defaultitem\"   \
		--menu \"\$menu_text\"             \
		$height $width $rows               \
		$menu_items                        \
		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
	)
	retval=$?
	f_dialog_data_sanitize mtag
	f_dialog_default_store "$mtag"
	f_dprintf "retval=%u mtag=[%s]" $retval "$mtag"

	# Exit if user has either pressed ESC or chosen Cancel/No
	[ $retval -eq $SUCCESS ] || f_die

	case "$mtag" in
	X) # Exit
	   if [ "$save_flag" ]; then
	   	save_changes || continue
	   fi
	   break
	   ;;
	1) # Group Name
	   case "$mode" in
	   Add) f_dialog_input_group_name "$group_name" ;;
	   Edit/View|Delete)
	   	f_dialog_menu_group_list "$group_name"
	   	retval=$?
	   	f_dialog_menutag_fetch mtag
	   	f_dprintf "retval=%u mtag=[%s]" $retval "$mtag"

	   	# Loop if user has either pressed ESC or chosen Cancel/No
	   	[ $retval -eq $SUCCESS ] || continue

	   	[ "$mtag" = "X $msg_exit" ] && continue

	   	group="$mtag"
	   	f_input_group "$group" || f_die 1 "$msg_group_not_found"
	   	cur_group_name="$group_name"
	   	cur_group_password="$group_password"
	   	cur_group_gid="$group_gid"
	   	cur_group_members="$group_members"
	   	[ "$mode" != "Delete" ] && save_flag=
	   esac
	   ;;
	2) # Password
	   f_dialog_input_group_password
	   ;;
	3) # GID
	   f_dialog_input_group_gid "$group_gid"
	   ;;
	4) # Users in Group
	   f_dialog_input_group_members "$group_members"
	   ;;
	esac

done

exit $SUCCESS

################################################################################
# END
################################################################################
@


1.16.2.1
log
@file groupinput was added on branch RELENG_9 on 2013-07-07 20:03:18 +0000
@
text
@d1 307
@


1.16.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/252995
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 307
#!/bin/sh
#-
# Copyright (c) 2012 Ron McDowell
# Copyright (c) 2012-2013 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: stable/9/usr.sbin/bsdconfig/usermgmt/groupinput 252995 2013-07-07 19:13:34Z dteske $
#
############################################################ INCLUDES

BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." "$0"
f_include $BSDCFG_SHARE/dialog.subr
f_include $BSDCFG_SHARE/mustberoot.subr
f_include $BSDCFG_SHARE/usermgmt/group_input.subr

BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr

ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"

############################################################ CONFIGURATION

# set some reasonable defaults if /etc/adduser.conf does not exist.
[ -f /etc/adduser.conf ] && f_include /etc/adduser.conf
: ${passwdtype:="yes"}

############################################################ FUNCTIONS

# save_changes
#
# Save any/all settings (actions performed depend on $mode value).
#
save_changes()
{
	local err retval=$SUCCESS

	case "$mode" in
	Delete)
		err=$( pw groupdel "$group_name" 2>&1 )
		retval=$?
		if [ $retval -ne $SUCCESS ]; then
			f_dialog_msgbox "$msg_error $err\n"
			return $retval
		fi
		f_show_msg "$msg_group_deleted"
		;;
	Add)
		local cmd="pw groupadd -n '$group_name'"
		[ "$group_gid" ] && cmd="$cmd -g '$group_gid'"
		[ "$group_members" != "$cur_group_members" ] &&
			cmd="$cmd -M '$group_members'"
		if [ "$pw_group_password_disable" ]; then
			cmd="$cmd -h -"
		elif [ "$group_password" ]; then
			cmd="echo \"\$group_password\" | $cmd -h 0"
		fi
		f_dprintf "cmd=%s" "$cmd"
		err=$( eval $cmd 2>&1 )
		retval=$?
		if [ $retval -ne $SUCCESS ]; then
			f_dialog_msgbox "$msg_error $err\n"
			return $retval
		fi
		f_show_msg "$msg_group_added"
		;;
	Edit/View)
		local cmd="pw groupmod -n '$group_name'"
		[ "$group_gid" ] && cmd="$cmd -g '$group_gid'"
		[ "$group_members" != "$cur_group_members" ] &&
			cmd="$cmd -M '$group_members'"
		if [ "$pw_group_password_disable" ]; then
			cmd="$cmd -h -"
		elif [ "$group_password" ]; then
			cmd="echo \"\$group_password\" | $cmd -h 0"
		fi
		f_dprintf "cmd=%s" "$cmd"
		err=$( eval $cmd 2>&1 )
		retval=$?
		if [ $retval -ne $SUCCESS ]; then
			f_dialog_msgbox "$msg_error $err\n"
			return $retval
		fi
		f_show_msg "$msg_group_updated"
		;;
	esac

	save_flag=
	return $SUCCESS
}

# dialog_title_update $mode
#
# Set the title based on the given $mode.
# 
dialog_title_update()
{
	local mode="$1"
	case "$mode" in
	Add)       f_dialog_title "$msg_add $msg_group" ;;
	Edit/View) f_dialog_title "$msg_edit_view $msg_group: $group" ;;
	Delete)    f_dialog_title "$msg_delete $msg_group: $group" ;;
	esac
}

############################################################ MAIN

# Incorporate rc-file if it exists
[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"

#
# Process command-line arguments
#
while [ $# -gt 0 ]; do
	key="${1%%=*}"
	value="${1#*=}"
	f_dprintf "key=[%s] value=[%s]" "$key" "$value"
	case "$key" in
	mode) mode="$value" ;;
	group) group="$value" ;;
	esac
	shift
done
f_dprintf "mode=[%s] group=[%s]" "$mode" "$group"

#
# Initialize
#
dialog_title_update "$mode"
f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
f_mustberoot_init
menu_text=
save_flag=
hline="$hline_arrows_tab_enter"

if [ "$mode" = "Add" ]; then
	f_dialog_input_group_name || exit 0

	f_dialog_noyes "$msg_use_default_values_for_all_account_details"
	retval=$?

	if [ $retval -eq 255 ]; then # User pressed ESC
		exit $SUCCESS
	elif [ $retval -ne $SUCCESS ]; then
		#
		# Ask a series of questions to pre-fill the editor screen.
		#
		# The defaults used in each dialog should allow the user to
		# simply hit ENTER to proceed, because cancelling a single
		# dialog will cause them to be returned to the main groupmenu.
		#
	
		[ "$passwdtype" = "yes" ] &&
			{ f_dialog_input_group_password || exit 0; }
		f_dialog_input_group_gid  || exit 0
		f_dialog_input_group_members || exit 0
	fi
fi

if [ "$mode" = "Edit/View" -o "$mode" = "Delete" ]; then
	f_input_group "$group" || f_die 1 "$msg_group_not_found"
fi

cur_group_name="$group_name"
cur_group_password="$group_password"
cur_group_gid="$group_gid"
cur_group_members="$group_members"

[ "$mode" = "Delete" ] && save_flag=1

#
# Loop until the user decides to Exit, Cancel, or presses ESC
#
while :; do
	dialog_title_update "$mode"

	menu_text=
	menu_exit="$msg_exit"
	if [ "$save_flag" ]; then
		if [ "$mode" = "Delete" ]; then
			menu_exit="$msg_delete/$msg_exit"
			menu_text="$msg_delete_exit_or_cancel"
		else
			menu_exit="$msg_save/$msg_exit"
			menu_text="$msg_save_exit_or_cancel"
		fi
	fi

	case "$mode" in
	Delete)
		menu_items="
			'X' '$menu_exit'
			'1' '$msg_group: $group_name'
			'-' '$msg_password: -----'
			'-' '$msg_group_id: $group_gid'
			'-' '$msg_group_members: $group_members'
		" # END-QUOTE
		;;
	*)
		menu_items="
			'X' '$menu_exit'
			'1' '$msg_group: $group_name'
			'2' '$msg_password: -----'
			'3' '$msg_group_id: $group_gid'
			'4' '$msg_group_members: $group_members'
		" # END-QUOTE
	esac

	eval f_dialog_menu_size height width rows \
	                        \"\$DIALOG_TITLE\"     \
	                        \"\$DIALOG_BACKTITLE\" \
	                        \"\$menu_text\"        \
	                        \"\$hline\"            \
	                        $menu_items

	f_dialog_default_fetch defaultitem
	mtag=$( eval $DIALOG \
		--title \"\$DIALOG_TITLE\"         \
		--backtitle \"\$DIALOG_BACKTITLE\" \
		--hline \"\$hline\"                \
		--ok-label \"\$msg_ok\"            \
		--cancel-label \"\$msg_cancel\"    \
		--default-item \"\$defaultitem\"   \
		--menu \"\$menu_text\"             \
		$height $width $rows               \
		$menu_items                        \
		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
	)
	retval=$?
	f_dialog_data_sanitize mtag
	f_dialog_default_store "$mtag"
	f_dprintf "retval=%u mtag=[%s]" $retval "$mtag"

	# Exit if user has either pressed ESC or chosen Cancel/No
	[ $retval -eq $SUCCESS ] || f_die

	case "$mtag" in
	X) # Exit
	   if [ "$save_flag" ]; then
	   	save_changes || continue
	   fi
	   break
	   ;;
	1) # Group Name
	   case "$mode" in
	   Add) f_dialog_input_group_name "$group_name" ;;
	   Edit/View|Delete)
	   	f_dialog_menu_group_list "$group_name"
	   	retval=$?
	   	f_dialog_menutag_fetch mtag
	   	f_dprintf "retval=%u mtag=[%s]" $retval "$mtag"

	   	# Loop if user has either pressed ESC or chosen Cancel/No
	   	[ $retval -eq $SUCCESS ] || continue

	   	[ "$mtag" = "X $msg_exit" ] && continue

	   	group="$mtag"
	   	f_input_group "$group" || f_die 1 "$msg_group_not_found"
	   	cur_group_name="$group_name"
	   	cur_group_password="$group_password"
	   	cur_group_gid="$group_gid"
	   	cur_group_members="$group_members"
	   	[ "$mode" != "Delete" ] && save_flag=
	   esac
	   ;;
	2) # Password
	   f_dialog_input_group_password
	   ;;
	3) # GID
	   f_dialog_input_group_gid "$group_gid"
	   ;;
	4) # Users in Group
	   f_dialog_input_group_members "$group_members"
	   ;;
	esac

done

exit $SUCCESS

################################################################################
# END
################################################################################
@


1.16.2.3
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/263791
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@@


1.15
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/252178
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 252178 2013-06-24 20:58:54Z dteske $
d69 1
a69 1
		f_dialog_msgbox "$msg_group_deleted"
d88 1
a88 1
		f_dialog_msgbox "$msg_group_added"
d107 1
a107 1
		f_dialog_msgbox "$msg_group_updated"
@


1.14
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/251549
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 251549 2013-06-08 19:13:49Z dteske $
d142 2
a143 2
	mode) mode="$value";;
	group) group="$value";;
@


1.13
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/251244
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 251244 2013-06-02 09:02:12Z dteske $
d160 4
a163 7
	#
	# Ask a series of questions to pre-fill the editor screen.
	#
	# The defaults used in each dialog should allow the user to simply
	#   hit ENTER to proceed, because cancelling a single dialog will
	#   cause them to be returned to the main groupmenu.
	#
d165 16
a180 5
	f_dialog_input_group_name || exit 0
	[ "$passwdtype" = "yes" ] &&
		{ f_dialog_input_group_password || exit 0; }
	f_dialog_input_group_gid  || exit 0
	f_dialog_input_group_members || exit 0
@


1.12
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/251236
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 251236 2013-06-01 23:58:44Z dteske $
d231 1
d233 9
a241 9
		--title \"\$DIALOG_TITLE\"          \
		--backtitle \"\$DIALOG_BACKTITLE\"  \
		--hline \"\$hline\"                 \
		--ok-label \"\$msg_ok\"             \
		--cancel-label \"\$msg_cancel\"     \
		--default-item \"\$DEFAULTITEM_$$\" \
		--menu \"\$menu_text\"              \
		$height $width $rows                \
		$menu_items                         \
d246 1
a246 1
	setvar DEFAULTITEM_$$ "$mtag"
@


1.11
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/251190
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 251190 2013-05-31 19:07:17Z dteske $
d231 1
a231 1
	dialog_menu=$( eval $DIALOG \
a242 1

d244 2
a245 3
	setvar DEFAULTITEM_$$ "$dialog_menu"
	setvar DIALOG_MENU_$$ "$dialog_menu"
	mtag=$( f_dialog_menutag )
d264 1
a264 1
	   	mtag=$( f_dialog_menutag )
@


1.10
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/249751
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 249751 2013-04-22 05:52:06Z dteske $
d224 6
a229 6
	size=$( eval f_dialog_menu_size \
	        	\"\$DIALOG_TITLE\"     \
	        	\"\$DIALOG_BACKTITLE\" \
	        	\"\$menu_text\"        \
	        	\"\$hline\"            \
	        	$menu_items            )
d238 2
a239 1
		--menu \"\$menu_text\" $size        \
@


1.9
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/245437
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d4 1
a4 1
# Copyright (c) 2012 Devin Teske
d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 245437 2013-01-14 21:03:34Z dteske $
d232 8
a239 7
		--title \"\$DIALOG_TITLE\"         \
		--backtitle \"\$DIALOG_BACKTITLE\" \
		--hline \"\$hline\"                \
		--ok-label \"\$msg_ok\"            \
		--cancel-label \"\$msg_cancel\"    \
		--menu \"\$menu_text\" $size       \
		$menu_items                        \
d244 1
d263 1
a263 1
	   	f_dialog_menu_group_list
@


1.8
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/244675
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 244675 2012-12-25 10:47:45Z dteske $
d66 1
a66 1
			f_show_msg "%s %s\n" "$msg_error" "$err"
d69 1
a69 1
		f_show_msg "$msg_group_deleted"
d85 1
a85 1
			f_show_msg "%s %s\n" "$msg_error" "$err"
d88 1
a88 1
		f_show_msg "$msg_group_added"
d104 1
a104 1
			f_show_msg "%s %s\n" "$msg_error" "$err"
d107 1
a107 1
		f_show_msg "$msg_group_updated"
@


1.7
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/244674
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 244674 2012-12-25 09:30:25Z dteske $
d34 1
@


1.6
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/244550
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 244550 2012-12-21 19:26:17Z dteske $
a150 1
f_dialog_init
@


1.5
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/243112
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r243112 | dteske | 2012-11-16 00:59:11 +0000 (Fri, 16 Nov 2012) | 11 lines
## SVN ##
## SVN ## Replicate a feature from sysinstall documented in
## SVN ## stable/9/usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## To get a list of modules you can link to, see `bsdconfig -h' output.
## SVN ##
## SVN ## Approved by:	adrian (co-mentor) (implicit)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 243112 2012-11-16 00:59:11Z dteske $
d80 1
a80 1
		f_dprintf "cmd=$cmd"
d99 1
a99 1
		f_dprintf "cmd=$cmd"
d139 1
a139 1
	f_dprintf "key=[$key] value=[$value]"
d146 1
a146 1
f_dprintf "mode=[$mode] group=[$group]"
d245 1
a245 1
	f_dprintf "retval=$retval mtag=[$mtag]"
d264 1
a264 1
	   	f_dprintf "retval=$retval mtag=[$mtag]"
@


1.4
log
@Switching exporter and resync
@
text
@d28 1
a28 1
# $FreeBSD: head/usr.sbin/bsdconfig/usermgmt/groupinput 240768 2012-09-20 23:44:13Z dteske $
d41 1
a41 1
ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
@


1.3
log
@SVN rev 240768 on 2012-09-20 23:44:13Z by dteske

Change all invocations of dialog(1) to no-longer require temporary files.
This allows bsdconfig to -- like bsdinstall -- operate from read-only media.

Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
@
text
@d28 1
a28 1
# $FreeBSD$
@


1.2
log
@SVN rev 240684 on 2012-09-18 22:28:42Z by dteske

Move major includes into /usr/share/bsdconfig for easy external access.

Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
@
text
@d231 1
a231 1
	eval $DIALOG \
d239 2
a240 1
		2> $DIALOG_TMPDIR/dialog.menu.$$
d243 1
@


1.1
log
@SVN rev 238438 on 2012-07-14 03:16:57Z by dteske

Import bsdconfig(8) as a replacement for the post-install abilities of
deprecated sysinstall(8). NOTE: WITH_BSDCONFIG is currently required.

Submitted by:	Devin Teske (dteske), Ron McDowell <rcm@@fuzzwad.org>
Reviewed by:	Ron McDowell <rcm@@fuzzwad.org>
Approved by:	Ed Maste (emaste)
@
text
@d32 5
a36 4
BSDCFG_LIBE="/usr/libexec/bsdconfig"
. $BSDCFG_LIBE/include/common.subr || exit 1
f_include $BSDCFG_LIBE/include/dialog.subr
f_include $BSDCFG_LIBE/include/mustberoot.subr
d38 1
a38 2
APP_DIR="070.usermgmt"
f_include $BSDCFG_LIBE/$APP_DIR/include/group_input.subr
@

