1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/perl
$| = 1;
use warnings;
use CGI qw/:standard *p/;
use IPC::Open2;
print header( -type => 'text/html' ), start_html( -title => 'piny-web: Create User'), h1('Create User');
print start_form( -name => 'newuser_form' );
print start_p, "Enter a username and valid email address for the new user. Please remember that the username may only contain alphanumerics, underscores, periods, and dashes. The username may not begin with a dash, nor may it begin with the strings 'git-' or 'ikiwiki-'.", end_p;
print start_p;
print label( { -for => 'username' }, "Username: " ), textfield( -name => 'username' ), "<br />";
print label( { -for => 'email' }, "Email Address: " ), textfield( -name => 'email' ), "<br />";
print "</p>";
print end_form, end_html;
=for temporarily commenting this out until i can get the base page to show up
if( $q->param('n') && $q->param('a') && $q->param('p') ) {
unless( open2( OUT, IN, '/usr/bin/sudo', '/usr/sbin/newuser', '--batch', $q->param('a'), $q->param('n') ) ) {
print 'could not execute newrepo';
die;
};
# make things flushier
select((select(IN), $| = 1)[0]);
select((select(OUT), $| = 1)[0]);
print( IN $q->param('p') . "\n" );
close( IN );
while( <OUT> ) {
print;
};
} else {
print 'Missing parameters.';
};
|