From 975792af5d69772b3903ce8a9ff3c79c40b5d1e9 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 19 Feb 2012 19:06:33 -0800 Subject: [PATCH] Show nicer conversion message --- acl/convert.cgi | 10 +++++++++- acl/lang/en | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/acl/convert.cgi b/acl/convert.cgi index 115849881..dfd88cf36 100755 --- a/acl/convert.cgi +++ b/acl/convert.cgi @@ -68,6 +68,7 @@ else { print &ui_subheading($text{'convert_msg'}); print "
\n";
 map { $exists{$_->{'name'}}++ } &list_users();
+$skipped = $exists = $invalid = $converted = 0;
 foreach $u (@users) {
 	local $ok;
 	if ($in{'conv'} == 0) {
@@ -88,13 +89,16 @@ foreach $u (@users) {
 		      $u->{'uid'} <= $in{'max'};
 		}
 	if (!$ok) {
-		print &text('convert_skip', $u->{'user'}),"\n";
+		#print &text('convert_skip', $u->{'user'}),"\n";
+		$skipped++;
 		}
 	elsif ($exists{$u->{'user'}}) {
 		print "",&text('convert_exists', $u->{'user'}),"\n";
+		$exists++;
 		}
 	elsif ($u->{'user'} !~ /^[A-z0-9\-\_\.]+$/) {
 		print "",&text('convert_invalid', $u->{'user'}),"\n";
+		$invalid++;
 		}
 	else {
 		# Actually add the user
@@ -115,6 +119,7 @@ foreach $u (@users) {
 
 		push(@{$group->{'members'}}, $u->{'user'});
 		$exists{$u->{'user'}}++;
+		$converted++;
 		}
 	}
 endpwent() if ($gconfig{'os_type'} ne 'hpux');
@@ -123,6 +128,9 @@ endpwent() if ($gconfig{'os_type'} ne 'hpux');
 &modify_group($group->{'name'}, $group);
 &restart_miniserv();
 
+# Print summary
+print &text('convert_done', $converted, $invalid, $exists, $skipped),"

\n"; + print "


\n"; &ui_print_footer("", $text{'index_return'}); diff --git a/acl/lang/en b/acl/lang/en index 4eaf63fc2..6d786a68f 100644 --- a/acl/lang/en +++ b/acl/lang/en @@ -276,6 +276,7 @@ convert_exists=$1 already exists convert_invalid=$1 is not a valid Webmin username convert_added=$1 being added convert_msg=Converting Unix users... +convert_done=$1 users converted, $2 invalid, $3 already exist, $4 excluded. sync_title=Unix User Synchronization sync_desc=This form allows you to configure the automatic synchronization of Unix users created through Webmin and users in this module.