summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/usermgmt
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-07-05 16:00:01 +0000
committerdteske <dteske@FreeBSD.org>2013-07-05 16:00:01 +0000
commit0ac55ea171e6d82b0acc861ebcb19fb4db4958c4 (patch)
tree20324385a5f53dae148a2e6fa863df76ea68f69d /usr.sbin/bsdconfig/usermgmt
parent1523d4a961431261ec396302c4112265ef2003c7 (diff)
downloadFreeBSD-src-0ac55ea171e6d82b0acc861ebcb19fb4db4958c4.zip
FreeBSD-src-0ac55ea171e6d82b0acc861ebcb19fb4db4958c4.tar.gz
Use f_show_msg() instead of f_dialog_msgbox() where appropriate. The main
difference between these two functions: Usage: f_show_msg() $format_string [ $format_args ... ] Usage: f_dialog_msgbox() $text [ $hline ] The former lends itself well to displaying the $msg_* i18n text, prompts, etc. While the latter is better for text you do not control (error strings captured as a response from external commands) -- or if you have to control the hline.
Diffstat (limited to 'usr.sbin/bsdconfig/usermgmt')
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/groupinput6
-rw-r--r--usr.sbin/bsdconfig/usermgmt/share/group_input.subr6
-rw-r--r--usr.sbin/bsdconfig/usermgmt/share/user_input.subr16
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/userinput6
4 files changed, 16 insertions, 18 deletions
diff --git a/usr.sbin/bsdconfig/usermgmt/groupinput b/usr.sbin/bsdconfig/usermgmt/groupinput
index f84f618..6fff40f 100755
--- a/usr.sbin/bsdconfig/usermgmt/groupinput
+++ b/usr.sbin/bsdconfig/usermgmt/groupinput
@@ -66,7 +66,7 @@ save_changes()
f_dialog_msgbox "$msg_error $err\n"
return $retval
fi
- f_dialog_msgbox "$msg_group_deleted"
+ f_show_msg "$msg_group_deleted"
;;
Add)
local cmd="pw groupadd -n '$group_name'"
@@ -85,7 +85,7 @@ save_changes()
f_dialog_msgbox "$msg_error $err\n"
return $retval
fi
- f_dialog_msgbox "$msg_group_added"
+ f_show_msg "$msg_group_added"
;;
Edit/View)
local cmd="pw groupmod -n '$group_name'"
@@ -104,7 +104,7 @@ save_changes()
f_dialog_msgbox "$msg_error $err\n"
return $retval
fi
- f_dialog_msgbox "$msg_group_updated"
+ f_show_msg "$msg_group_updated"
;;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/share/group_input.subr b/usr.sbin/bsdconfig/usermgmt/share/group_input.subr
index babcee7..93d981a 100644
--- a/usr.sbin/bsdconfig/usermgmt/share/group_input.subr
+++ b/usr.sbin/bsdconfig/usermgmt/share/group_input.subr
@@ -138,13 +138,13 @@ f_dialog_input_group_name()
# Check for NULL entry
if [ ! "$_input" ]; then
- f_dialog_msgbox "$msg_group_is_empty"
+ f_show_msg "$msg_group_is_empty"
continue
fi
# Check for invalid entry
if ! echo "$_input" | grep -q "^[[:alpha:]]"; then
- f_dialog_msgbox "$msg_group_must_start_with_letter"
+ f_show_msg "$msg_group_must_start_with_letter"
continue
fi
@@ -231,7 +231,7 @@ f_dialog_input_group_password()
# Check for password mismatch
if [ "$_password1" != "$_password2" ]; then
- f_dialog_msgbox "$msg_group_passwords_do_not_match"
+ f_show_msg "$msg_group_passwords_do_not_match"
continue
fi
diff --git a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
index 7cdd2f0..21bfbd3 100644
--- a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
+++ b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
@@ -242,13 +242,13 @@ f_dialog_input_name()
# Check for NULL entry
if [ ! "$_input" ]; then
- f_dialog_msgbox "$msg_login_is_empty"
+ f_show_msg "$msg_login_is_empty"
continue
fi
# Check for invalid entry
if ! echo "$_input" | grep -q "^[[:alpha:]]"; then
- f_dialog_msgbox "$msg_login_must_start_with_letter"
+ f_show_msg "$msg_login_must_start_with_letter"
continue
fi
@@ -328,7 +328,7 @@ f_dialog_input_password()
# Check for password mismatch
if [ "$_password1" != "$_password2" ]; then
- f_dialog_msgbox "$msg_passwords_do_not_match"
+ f_show_msg "$msg_passwords_do_not_match"
continue
fi
@@ -584,7 +584,7 @@ f_dialog_input_expire_password()
# Taint-check the user's input
if ! f_isinteger "$ret_days"; then
- f_dialog_msgbox "$msg_invalid_number_of_days"
+ f_show_msg "$msg_invalid_number_of_days"
continue
fi
@@ -610,8 +610,7 @@ f_dialog_input_expire_password()
# Taint-check the user's input
if ! f_isinteger "${_input:-0}"; then
- f_dialog_msgbox \
- "$msg_invalid_number_of_seconds"
+ f_show_msg "$msg_invalid_number_of_seconds"
continue
fi
@@ -769,7 +768,7 @@ f_dialog_input_expire_account()
# Taint-check the user's input
if ! f_isinteger "$ret_days"; then
- f_dialog_msgbox "$msg_invalid_number_of_days"
+ f_show_msg "$msg_invalid_number_of_days"
continue
fi
@@ -795,8 +794,7 @@ f_dialog_input_expire_account()
# Taint-check the user's input
if ! f_isinteger "${_input:-0}"; then
- f_dialog_msgbox \
- "$msg_invalid_number_of_seconds"
+ f_show_msg "$msg_invalid_number_of_seconds"
continue
fi
diff --git a/usr.sbin/bsdconfig/usermgmt/userinput b/usr.sbin/bsdconfig/usermgmt/userinput
index 06221e1..196262b 100755
--- a/usr.sbin/bsdconfig/usermgmt/userinput
+++ b/usr.sbin/bsdconfig/usermgmt/userinput
@@ -84,7 +84,7 @@ save_changes()
f_dialog_msgbox "$msg_error $err\n"
return $retval
fi
- f_dialog_msgbox "$msg_login_deleted"
+ f_show_msg "$msg_login_deleted"
if [ "$pw_group_delete" = "$msg_yes" ] &&
f_quietly pw groupshow -g "$pw_gid"
@@ -122,7 +122,7 @@ save_changes()
f_dialog_msgbox "$msg_error $err\n"
return $retval
fi
- f_dialog_msgbox "$msg_login_added"
+ f_show_msg "$msg_login_added"
if [ "$pw_home_create" = "$msg_yes" ]; then
err=$( mkdir -p "$pw_home_dir" 2>&1 )
@@ -168,7 +168,7 @@ save_changes()
f_dialog_msgbox "$msg_error $err\n"
return $retval
fi
- f_dialog_msgbox "$msg_login_updated"
+ f_show_msg "$msg_login_updated"
if [ "$pw_home_create" = "$msg_yes" ]; then
err=$( mkdir -p "$pw_home_dir" )
OpenPOWER on IntegriCloud