moved cgi script to admin
authorMatthias Förste <foerste@schlittermann.de>
Wed, 13 Jul 2011 13:23:03 +0200
changeset 11 2217a0f2ded2
parent 10 059036ddb06d
child 12 e0e126b7f06d
moved cgi script to admin
Build.PL
cgi-bin/admin/dav-htuseradd.cgi
cgi-bin/dav-htuseradd.cgi
--- a/Build.PL	Tue Jul 12 11:01:23 2011 +0200
+++ b/Build.PL	Wed Jul 13 13:23:03 2011 +0200
@@ -42,7 +42,7 @@
         'String::MkPasswd' => 0
     },
     script_files => [glob 'bin/*'],
-    cgi_files => { map { /\.(bak|orig)$/ ? () : ($_ => $_) } glob 'cgi-bin/*' }
+    cgi_files => { map { /\.(bak|orig)$/ ? () : ($_ => $_) } glob 'cgi-bin/admin/*' }
 );
 $build->add_build_element('cgi');
 $build->install_path(
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cgi-bin/admin/dav-htuseradd.cgi	Wed Jul 13 13:23:03 2011 +0200
@@ -0,0 +1,64 @@
+#!/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 <http://www.gnu.org/licenses/>.
+#
+#    Matthias Förste <foerste@schlittermann.de>
+
+use warnings;
+
+use CGI::Fast;
+use Ius::Dav::Htpasswd qw(mkpasswd readconfig useradd);
+
+while (my $q = new CGI::Fast) {
+
+    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 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;
+
+}
--- a/cgi-bin/dav-htuseradd.cgi	Tue Jul 12 11:01:23 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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 <http://www.gnu.org/licenses/>.
-#
-#    Matthias Förste <foerste@schlittermann.de>
-
-use warnings;
-
-use CGI::Fast;
-use Ius::Dav::Htpasswd qw(mkpasswd readconfig useradd);
-
-while (my $q = new CGI::Fast) {
-
-    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 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;
-
-}