# HG changeset patch # User Matthias Förste # Date 1310731840 -7200 # Node ID 8934ba3404bc1d2f18b5077ef2be0d450ca11503 # Parent 6426cf731f2542f7b8dc5109ab8895bab2d9a84e perltidy diff -r 6426cf731f25 -r 8934ba3404bc Build.PL --- a/Build.PL Fri Jul 15 14:03:55 2011 +0200 +++ b/Build.PL Fri Jul 15 14:10:40 2011 +0200 @@ -4,7 +4,7 @@ my $builder = Module::Build->subclass( class => 'My::Module::Build', - code => <<'___CODE', + code => <<'___CODE', use strict; use warnings; use File::Temp; @@ -27,22 +27,23 @@ ___CODE ); -my $build = $builder->new -( - module_name => 'Ius::Dav::Htpasswd', - license => 'gpl', +my $build = $builder->new( + module_name => 'Ius::Dav::Htpasswd', + license => 'gpl', create_license => 1, - requires => { + requires => { 'Apache::Htpasswd' => 0, - 'AppConfig' => 0, - 'File::Path' => 0, - 'POSIX' => 0, + 'AppConfig' => 0, + 'File::Path' => 0, + 'POSIX' => 0, 'String::MkPasswd' => 0 }, - script_files => [glob 'bin/*'], - cgi_files => { map { /\.(bak|orig)$/ ? () : ($_ => $_) } glob 'cgi-bin/*' } + script_files => [ glob 'bin/*' ], + cgi_files => + { map { /\.(bak|orig)$/ ? () : ( $_ => $_ ) } glob 'cgi-bin/*' } ); $build->add_build_element('cgi'); $build->install_path( - 'cgi-bin' => $build->original_prefix($build->installdirs) . '/lib/ius-dav-htpasswd/cgi-bin'); + 'cgi-bin' => $build->original_prefix( $build->installdirs ) + . '/lib/ius-dav-htpasswd/cgi-bin' ); $build->create_build_script; diff -r 6426cf731f25 -r 8934ba3404bc bin/ius-dav-htuseradd --- a/bin/ius-dav-htuseradd Fri Jul 15 14:03:55 2011 +0200 +++ b/bin/ius-dav-htuseradd Fri Jul 15 14:10:40 2011 +0200 @@ -25,13 +25,13 @@ use Getopt::Long; use Pod::Usage; -my ($user, $expiry, $pass); +my ( $user, $expiry, $pass ); GetOptions( - 'u|user=s' => \$user, + 'u|user=s' => \$user, 'e|expiry=i' => \$expiry, - 'h|help' => sub { usage(-exit => 0, -verbose => 1) }, - 'm|man' => sub { + 'h|help' => sub { usage( -exit => 0, -verbose => 1 ) }, + 'm|man' => sub { usage( -exit => 0, @@ -42,7 +42,9 @@ -verbose => 2 ); }, -) and defined $user or usage; + ) + and defined $user + or usage; $pass = useradd readconfig, $user, mkpasswd, $expiry; print "[$pass]\n"; diff -r 6426cf731f25 -r 8934ba3404bc bin/ius-dav-htuserdel --- a/bin/ius-dav-htuserdel Fri Jul 15 14:03:55 2011 +0200 +++ b/bin/ius-dav-htuserdel Fri Jul 15 14:10:40 2011 +0200 @@ -27,14 +27,16 @@ GetOptions( 'u|user=s' => \$user, - "h|help" => sub { usage( -verbose => 0, -exitval => 0 ) }, - "m|man" => sub { + "h|help" => sub { usage( -verbose => 0, -exitval => 0 ) }, + "m|man" => sub { usage( -verbose => 2, -exitval => 0, -noperldoc => ( `perldoc -V 2>/dev/null`, $? != 0 )[-1] ); }, -) and defined $user or usage(); + ) + and defined $user + or usage(); exit userdel readconfig, $user; diff -r 6426cf731f25 -r 8934ba3404bc bin/ius-dav-htuserexpiry --- a/bin/ius-dav-htuserexpiry Fri Jul 15 14:03:55 2011 +0200 +++ b/bin/ius-dav-htuserexpiry Fri Jul 15 14:10:40 2011 +0200 @@ -26,7 +26,7 @@ use Pod::Usage; GetOptions( - 'h|help' => sub { usage(-exit => 0, -verbose => 1) }, + 'h|help' => sub { usage( -exit => 0, -verbose => 1 ) }, 'm|man' => sub { usage( -exit => 0, diff -r 6426cf731f25 -r 8934ba3404bc cgi-bin/ius-dav-htuseradd.cgi --- a/cgi-bin/ius-dav-htuseradd.cgi Fri Jul 15 14:03:55 2011 +0200 +++ b/cgi-bin/ius-dav-htuseradd.cgi Fri Jul 15 14:10:40 2011 +0200 @@ -27,39 +27,38 @@ my $q = new CGI; - print $q->header(-charset => 'UTF-8'); - print $q->start_html( - -title => $0, - -bgcolor => "white", - ); +print $q->header( -charset => 'UTF-8' ); +print $q->start_html( + -title => $0, + -bgcolor => "white", +); - my ($user, $pass, $expiry) = ( - $q->param('user'), - $q->param('pass'), - $q->param('expiry') - ); +my ( $user, $pass, $expiry ) = + ( $q->param('user'), $q->param('pass'), $q->param('expiry') ); - unless (defined $user or defined $pass or defined $expiry) { +unless ( defined $user or defined $pass or defined $expiry ) { - print $q->start_form, - 'New User' => $q->textfield('user'), - 'Password' => $q->password_field('pass'), - 'Expiry' => $q->textfield('expiry'), - $q->submit, - $q->end_form; + print $q->start_form, + 'New User' => $q->textfield('user'), + 'Password' => $q->password_field('pass'), + 'Expiry' => $q->textfield('expiry'), + $q->submit, + $q->end_form; - } else { +} +else { - my @cmd = (qw(sudo ius-dav-htuseradd -u), $user); - push @cmd, '-e', $expiry if defined $expiry and $expiry ne ''; + my @cmd = ( qw(sudo ius-dav-htuseradd -u), $user ); + push @cmd, '-e', $expiry if defined $expiry and $expiry ne ''; - if (my $pass = qx(@cmd)) { - chomp $pass; - print $q->p($pass); - } else { - print $q->p('Something went wrong'); - } - + if ( my $pass = qx(@cmd) ) { + chomp $pass; + print $q->p($pass); + } + else { + print $q->p('Something went wrong'); } - print $q->end_html; +} + +print $q->end_html;