#!/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' ), "
"; print label( { -for => 'email' }, "Email Address: " ), textfield( -name => 'email' ), "
"; print "

"; 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( ) { print; }; } else { print 'Missing parameters.'; };