# HG changeset patch # User Matthias Förste # Date 1310718743 -7200 # Node ID 7f24266dc25d67ed6b416a3f7041aeabcae0f707 # Parent 44cdd9d6fd8c8e0a3149903c00a686dc15b2d269 more file name and path changes diff -r 44cdd9d6fd8c -r 7f24266dc25d Build.PL --- a/Build.PL Fri Jul 15 10:28:04 2011 +0200 +++ b/Build.PL Fri Jul 15 10:32:23 2011 +0200 @@ -41,9 +41,9 @@ 'String::MkPasswd' => 0 }, script_files => [glob 'bin/*'], - cgi_files => { map { /\.(bak|orig)$/ ? () : ($_ => $_) } glob 'cgi-bin/admin/*' } + cgi_files => { map { /\.(bak|orig)$/ ? () : ($_ => $_) } glob 'cgi-bin/*' } ); $build->add_build_element('cgi'); $build->install_path( - 'cgi-bin' => $build->original_prefix($build->installdirs) . '/lib/cgi-bin'); + 'cgi-bin' => $build->original_prefix($build->installdirs) . '/lib/ius-dav-htpasswd/cgi-bin'); $build->create_build_script; diff -r 44cdd9d6fd8c -r 7f24266dc25d cgi-bin/admin/ius-dav-htuseradd.cgi --- a/cgi-bin/admin/ius-dav-htuseradd.cgi Fri Jul 15 10:28:04 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) 2011 Matthias Förste -# -# 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 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Matthias Förste - -use warnings; - -# Using CGI::Fast will result in an Internal Server Error because we are -# restarting apache when everything else works -# use CGI::Fast; -use CGI; -use Ius::Dav::Htpasswd qw(mkpasswd readconfig useradd); - -my $q = new CGI; - - 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') - ); - - 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; - - } else { - - 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'); - } - - } - - print $q->end_html; diff -r 44cdd9d6fd8c -r 7f24266dc25d cgi-bin/ius-dav-htuseradd.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cgi-bin/ius-dav-htuseradd.cgi Fri Jul 15 10:32:23 2011 +0200 @@ -0,0 +1,65 @@ +#!/usr/bin/perl + +# Copyright (C) 2011 Matthias Förste +# +# 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Matthias Förste + +use warnings; + +# Using CGI::Fast will result in an Internal Server Error because we are +# restarting apache when everything else works +# use CGI::Fast; +use CGI; +use Ius::Dav::Htpasswd qw(mkpasswd readconfig useradd); + +my $q = new CGI; + + 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') + ); + + 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; + + } else { + + 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'); + } + + } + + print $q->end_html;