*** userdetails.cgi	Tue Oct 13 09:25:49 1998
--- userdetails1.cgi	Tue Oct 13 13:00:04 1998
***************
*** 1,290 ****
! #!/usr/local/bin/perl
! #
! #
! # Adapted from "superForm" mailer
! #
! # Author Mike McCauley (mikem@open.com.au)
! # Copyright (C) connect.com.au
! # Revision 1.1
  #
  require "cgi-lib.pl";
  
! # ------------------------------------------------------------
! # Configurable variables
  
! # True if must use nicknames
! $useNicknames = 0;
  
! # The name of the default nickname file under the referrers server root
! $nicknameFile = "cgi-bin/mail.list";
  
! # The name of the administrator
! $adminName = "big.net.au hostmaster";
  
! # The email address of the administrator
! $adminAddress = 'webmaster@big.net.au';
  
! # The location and flags of the sendmail program on your system
! $sendmailProg = "/usr/lib/sendmail";
  
! # The location of the pgp executable on your system
! $pgpProg = "/usr/bin/pgp";
  
! # The default name of the pgp public keyring for pgp encryption. 
! # Relative to $serverRoot
! $pgpKeyringDir = ".pgp";
  
! # Define true if you have BSD flock in your perl
! $haveFlock = 1;
  
! print "Content-type: text/html\n\n";
  
! # End of Configurable variables
! # ------------------------------------------------------------
  
! ReadParse(*input);		# grab cgi parameters
  
! # Debugging support
! #print &PrintHeader;
! #print &PrintVariables(%input);
! #print `env`;
! 
! 
! ###########################################################################
! # Find their server root dir and make sure they are 'one of ours'
! # First the domain name of the referer
! if ($ENV{'HOSTNAME'} =~ makita.big.net.au)
! {
!     $serverRoot = "/usr/local/apache";
!     chomp $serverRoot;
! 	error("Can't determine server root directory. Perhaps your Web
! server is not at <a href=http://www.big.net.au>DOMAINNAME</a>")
! 		if $serverRoot eq '';
  }
! else
  {
! 	error("Can't find domain name of referrer. The form is not configured properly");
  }
! 
! #error("Nothing to do: to-email, to-nickname and append-file are all empty")
! #    if (!$input{'to-email'}
! #        && !$input{'to-nickname'}
! #		&& !$input{'append-file'});
! 	  
! ###########################################################################
! # Establish the destination email address
! if ($useNicknames)
! {
! 	if ($input{'to-nickname'})
! 	{
! 		$nicknameFile = $input{'nickname-file'} if $input{'nickname-file'};
! 		# Remove any relative path fragments
! 		$nicknameFile =~ s/\.\.//g;
! 
! 		my $nicknamePath = "$serverRoot/$nicknameFile";
! 		error("Can't read nickname file $nicknamePath") if !-r $nicknamePath;
! 		open (MAILNAMES, $nicknamePath) 
! 			|| error ("Can't open $nicknamePath: $!\n");
! 		while (<MAILNAMES>) 
! 		{
! 			chomp;
! 			($nick, $addr) = split(/:/, $_);
! 			$nicknames{$nick} = $addr;
! 		}
! 		close (MAILNAMES);
! 
! 		$to_email = $nicknames{$input{'to-nickname'}} 
!             if $input{'to-nickname'} && $nicknames{$input{'to-nickname'}};
! 	}
  }
  else
  {
!     $to_email = $input{'Email-addr'} if ($input{'to-email'} eq 'yes');
! #    if ($input{'Message'})
! #		{
! #		$Admessage .= " Additonal Information:\n";
! #		$Admessage .= "========================\n\n";
! #		$Admessage .= "$input{'Message'}";
! #		}
  }
  
! ###########################################################################
! # Check for the existence of mandatory and correct format fields
! foreach $key (sort keys (%input))
  {
!     if ($key =~ /(.*)-MANDATORY$/)
!     {
!         $errorMsg .= "'$1' not entered<br>" if !$input{$1};
!     }
!     elsif ($key =~ /(.*)-FORMAT$/)
!     {
! 	$format = $input{$key};
! 	$errorMsg .= "'$1' not in correct format<br>" 
! 	    if $input{$1} && $input{$1} !~ /$format/;
!     }
!     else
!     {
! 	# Might be the result of a multiple select, or several fields
! 	# with the same name. Cgi-lib joins them with NULL. Concatenate with ,
! 	$input{$key} =~ s/\0/,/g;
!     }
  }
  
! &error($errorMsg) if $errorMsg;
! ###########################################################################
! #
! #Determines Server configuration and PH number
! #
  
! if ($input{'Dial-PH'} eq 'other')
! 	{
! 	$dialup .= "$input{'otherPH'}";
! 	}else{
! 	$dialup .= "$input{'Dial-PH'}";
! 	}
  
  #
- # Define some network settings
- #
- 	$IPno .= "Server Assigned";
- 	$DNSno .= "Server Assigned ( 210.8.58.1 )";
- 	$sDNSno .= "Server Assigned ( 210.8.58.2 )";
- 	$news .= "news.big.net.au";
- 	$proxy .= "proxy.big.net.au:8080";
- 	
- 
- ###########################################################################
- # Format the message
- if ($input{'message-format'})
- {
- 	# Set up some convenient variabls for use in the message format
- 	my $F_TIME = time;
- 	my $F_FORMATTED_DATE_TIME = &formatDate(time);
-     #protect quotes
-     $input{'message-format'} =~ s/"/\\"/g;
  
!     $message = eval qq/"$input{'message-format'}"/;
! }
! else
! {
!     # Print the value of each non-special tag
!     $message .= "\n=============================================================\n";
!     foreach $key (sort keys (%input))
      {
! 	next if $key =~ /(.*)-MANDATORY$/;
! 	next if $key =~ /(.*)-FORMAT$/;
! 	next if $key eq 'to-nickname';
! 	next if $key eq 'nickname-file';
! 	next if $key eq 'from-name';
! 	next if $key eq 'from-email';
! 	next if $key eq 'subject';
! 	next if $key eq 'to-email';
! 	next if $key eq 'append-file';
! 	next if $key eq 'pgp-encrypt-to';
! 	next if $key eq 'pgp-keyring-dir';
! 	next if $key eq 'message-format';
! 	next if $key eq 'next-url';
! 	if ($input{$key} eq 'error')
! 		{
! 		error("OOPS! You forget to fill something in!");
! 		}
! 	
! 	$message .= "$key:\t$input{$key}\n";
      }
!     # Append some useful other info
!     
  }
  
- ###########################################################################
- # Encrypt the message if necessary
- if ($input{'pgp-encrypt-to'})
- {
-     $input{'pgp-keyring-dir'} =~ s/\.\.//g;
-     $pgpKeyringDir = "$input{'pgp-keyring-dir'}"
-         if $input{'pgp-keyring-dir'};
- 	my $fullPath = "$serverRoot/$pgpKeyringDir";
- 	
-     error("Keyring directory $fullPath does not exist") 
- 		if !-d $fullPath;
-     error("No public keyring file $fullPath/pubring.pgp")
- 		if !-r "$fullPath/pubring.pgp";
-     $ENV{'PGPPATH'} = $fullPath;
-     
-     # Put some info about who from that will show up in the encrypted message
-     $message = "\nFrom: <$input{'from-email'}>\nSubject: $input{'subject'}\n\n" . $message;
- 
-     my $fileName = "/tmp/superForm$$";
-     open (PLAINTEXT, ">$fileName") || die ("Can't open plaintext file $fileName: $!\n");
-     print PLAINTEXT $message;
-     close(PLAINTEXT);
- 
-     system("$pgpProg +batchmode -eaw $fileName $input{'pgp-encrypt-to'} >/dev/null 2>&1");
-     open (CRYPT, "$fileName.asc") || die ("Can't open encrypted file $fileName.asc: $!\n");
-     $/ = undef;
-     $message = <CRYPT>;
-     close(CRYPT);
-     $/ = "\n";
-     unlink("$fileName.asc");
-     die "$pgpProg failed: $!\n" if $?;
- }
- ###########################################################################
- # Draft up a Welcome message to be emailed to the new user.
- # Contents of the message are pulled from "welcome.txt"
- 
- $welcome .= "Dear $input{'Contact'},\n\n";
- #open( MSG, "/usr/local/apache/htdocs/useradd/welcome.txt" ) ;
- $inputmessage = "" ;
- #while( $inputmessage ne 'EOF'){ 
- #	$inputmessage = <MSG> ;
- 	$welcome .= "$inputmessage"; 
- #	}
- #close( MSG ) ;
  
! ###########################################################################
! # Send an email message if required
! if ($to_email)
  {
! $to_email .= "\@big.net.au";
!  
!    sendMail($to_email, 
! 	     $input{'from-email'},
! 	     $input{'subject'},
! 	     $welcome);
! }
! 
! ###########################################################################
! # Append to a file if required
! if ($input{'append-file'})
! {
!     # Make sure there are no relative components in the pathname
!     $input{'append-file'} =~ s/\.\.//g;
!     my $fileName = "$serverRoot/$input{'append-file'}";
!     # $file must exist and be writeable
!     error ("Append file '$fileName' is not writeable") if !-w $fileName;
!     open (APPENDFILE, ">>$fileName") || die ("Can't open append file $fileName: $!\n");
!     flock(APPENDFILE, 2) if $haveFlock;	# Exclusive lock, BSD systems only
!     print APPENDFILE $message;
!     flock(APPENDFILE, 8) if $haveFlock;	# Unlock, BSD systems only
!     close(APPENDFILE);
  }
  
! ###########################################################################
! # Hooray, we finished
! &success;
! 
! ###########################################################################
! # Send email to the address given.
! #
! sub sendMail
  {
      my ($address, $from, $subject, $welcome) = @_;
!     # Escape any naughty characters in the address
      $address =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g;
      $ssaddress = $address;
!     $ssaddress =~ s/,/ /g;  # Space sep address line for sendmail
! 
!     open (MAIL, "| $sendmailProg $ssaddress") || die ("Can't open $sendmail: $!\n");
      print MAIL <<_END_OF_FORM_;
  From: $from
  To: $address
  Subject: $subject
--- 1,176 ----
! #!/usr/bin/perl
  #
+ # cgi script to add users via the www
+ # based very loosely on userdetails.cgi
+ # totally rewritten by Ben O'Shea <ben@big.net.au>
+ 
  require "cgi-lib.pl";
  
! # -----------------------------------------------------------------------------------
! # Administrator information
! $adminName = "big.net.au administrator";
  
! # and his email address so people know where to bother him ;-)
! $adminaddress = 'webmaster@big.net.au';
  
! # location and args you want to pass to sendmail
! $sendmailprog = "/usr/lib/sendmail";
  
! # set this to 1 if you have BSD style flock in your perl
! $haveflock = 1;
  
! # IPAddress this is almost always dynamic so we set it to that here
! $ipaddress .= "Server Assigned";
  
! # End of user configurable variables section
! # -----------------------------------------------------------------------------------
  
! print "Content-type: text/html\n\n";
  
! # Basically where gonna get alot of shit here
! # variables etc to be used in the processing of the form
  
! ReadParse(*input);        # grab parameters for the script from the web
  
! # Your http server root
! $serverroot = "/usr/local/apache";
  
! # get email address to send welcome message to
! if ($input{'to-email'} eq 'yes')
! {
!     $to_email = $input{'Email-addr'};
! }
  
! # Get which POP they want to dial into and set the
! # Network settings. these are user configurable and
! # probably should be up above with the other user
! # configurable settings, however they rely on which POP the user 
! # is dialing into. so they live down here. get over it :-)
  
! if ($input{'Dial-PH'} eq 'bne')
! {
!     $dialup .= "07 33572222";
!     $pdns .= "Server Assigned (210.8.58.1)";
!     $sdns .= "Server Assigned (210.8.58.2)";
!     $news .= "news.big.net.au";
!     $proxy .= "proxy.big.net.au:8080";
  }
! elsif ($input{'Dial-PH'} eq 'strath')
  {
!     $dialup .= "07 38812588";
!     $pdns .= "Server Assigned (210.8.58.1)";
!     $sdns .= "Server Assigned (210.8.58.2)";
!     $news .= "news.big.net.au";
!     $proxy .= "proxy.big.net.au:8080";
  }
! elsif ($input{'Dial-PH'} eq 'sun')
! {
!     $dialup .= "07 54511900";
!     $pdns .= "Server Assigned (203.46.7.1)";
!     $sdns .= "Server Assigned (210.8.58.1)";
!     $news .= "news.sun.big.net.au";
!     $proxy .= "proxy.sun.big.net.au:8080";
! }
! elsif ($input{'Dial-PH'} eq 'rocky')
! {
!     $dialup .= "07 49278998";
!     $pdns .= "Server Assigned (203.46.49.1)";
!     $sdns .= "Server Assigned (210.8.58.1)";
!     $news .= "news.rocky.big.net.au";
!     $proxy .= "proxy.rocky.big.net.au:8080";
  }
  else
  {
!     error("You must select a valid POP");
  }
  
! 
! # send some email to them lying about how nice we are and how thick they aren't etc...
! 
! &welcome_msg;
! 
! if ($to_email)
  {
!     $to_email .= "\@big.net.au";
!     sendmail($to_email, $input{'from-email'}, $input{'subject'}, $welcome);
  }
  
! # append to details file.
! &appendtofile;
  
! # finished
! &success;
  
+ # 
+ # --------------------------------------------------------------------------------------
  #
  
! # Subroutines -- moved alot of shit here seeing as brett whinged about this scriupt lacking form
! # structure etc... so i moved ALOT of shit here just for forms sake ;p
! #
! # we want to format the email before we send it off to the new (l)user ;-)
! # this will go in later along with checking for mandatory  fields etc.
! # sub message_format
! # {
! #    if ($input{'message-format'})
! #    {
! #        # some nice variables for use in the message format
! #        my $F_TIME = time;
! #        my $F_FORMATTED_DATE_TIME = &formatedate(time);
! #        # protect the quotes
! #        $input{'message-format'} =~ s/"/\\"/g;
! #        $message  = eval qq/"$input{'message-format'}"/;
! #     }
! #     else
! #     {
! #     
! #     }
! #
! # }
! #
! 
! # Make a welcome message to be emailed to the (l)user
! sub welcome_msg
! {
!     $welcome .= "Dear $input{'Contact'}, \n\n";
!     open(MSG, "/usr/local/apache/htdocs/useradd/welcome.txt");
!     $inputmessage = "";
!     while($inputmessage ne 'EOF')
      {
!         $inputmessage = <MSG> ;
!         $welcome .= "$inputmessage";
      }
!     close(MSG);
  }
  
  
! sub appendtofile
  {
!     if ($input{'append-file'})
!     {
!         $input{'append-file'} =~ s/\.\.//g;
!         my $filename = "$serverroot/$input{'append-file'}";
!         # $filename must exist and be writeable
!         error("Append file '$filename' is not writeable") if !-w $filename;
!         open(APPENDFILE, ">>$filename") || die ("Can't open append file $filename: $!\n");
!         flock(APPENDFILE, 2) if $haveflock;
!         print APPENDFILE $message;
!         flock(APPENDFILE, 8) if $haveflock;
!         close(APPENDFILE);
!     }
  }
  
! sub sendmail
  {
      my ($address, $from, $subject, $welcome) = @_;
!     # escape any naughty charcaters in the email address
      $address =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g;
      $ssaddress = $address;
!     $ssaddress =~ s/,/ /g; # space seperate address line for sendmail
!     
!     open (MAIL, "| $sendmailprog $ssaddress") || die ("Can;t open $sendmail: $!\n");
      print MAIL <<_END_OF_FORM_;
+     
  From: $from
  To: $address
  Subject: $subject
***************
*** 293,321 ****
  
  $welcome
  
- $Admessage
  _END_OF_FORM_
      close(MAIL);
! 
!     error("$sendmailProg failed with $?") if $?;
  }
  
  sub error
  {
      my ($msg) = @_;
! 
!     print &PrintHeader;
      print <<_END_OF_CONTENT_;
  <html><head><title>Form Error</title></head>
  <body><h1>Form Error</h1>
  <strong>Your form was not successfully processed
! because an error was encountered:</strong> 
  <p><h1>$msg</h1>
! <p><strong>Please press 'Back' and try again</strong>.
  <hr>
- Go back to <a href=$ENV{'HTTP_REFERER'}>Where you were</a><br>
- Please report problems with this gateway to
- <a href="mailto:$adminAddress">&lt;$adminAddress&gt;</a>
  </body></html>
  _END_OF_CONTENT_
      exit 1;
--- 179,201 ----
  
  $welcome
  
  _END_OF_FORM_
      close(MAIL);
!     error("$sendmailprog failed with $?") if $?;
  }
  
  sub error
  {
      my ($msg) = @_;
!     
      print <<_END_OF_CONTENT_;
  <html><head><title>Form Error</title></head>
  <body><h1>Form Error</h1>
  <strong>Your form was not successfully processed
! because an error was encountered:</strong>
  <p><h1>$msg</h1>
! <p><stong>Please press 'Back' and try again</strong>.
  <hr>
  </body></html>
  _END_OF_CONTENT_
      exit 1;
***************
*** 325,603 ****
  {
      if ($input{'next-url'})
      {
! 	# Redirect to the next URL
! 	print "Location: $input{'next-url'}\n\n";
!     }
!     if ($proxy eq 'None')
! 	{
! 	&result_display_noproxy();
! 	}
!     else{
! 	&result_display();
      }
      exit 0;
  }
  
! ###########################################################################
! # Returns a formatted date and time in locale specific format.
! # HTML entities can be used for special characters.
! #
! sub formatDate
! {
!     my ($time) = @_;			# Seconds since Jan 1 1970
! 
!     my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) 
! 		= localtime($time);
  
- 	sprintf("%d/%d/%d %d:%0.2d", $mday, $mon + 1, $year, $hour, $min);
  }
  
! ###########################################################################
! # Subroutine for displaying output to browser
! #
! 
! sub result_display {
! print <<EOF;
! 
! 
! <html><head><title>BIG.NET.au - User Details</title></head>
! <BODY bgcolor="#ffffff">
! <center>
! <font size=+3>BIG.NET.au Customer Connection Details</font><br>
! Date: $input{'Date'}
! <table cellpadding=3 border=0><tr><td>
! 
! <table border=4><tr><td>
! <b>Name:</b></td>
! <td>$input{'Contact'}</td></tr>
! <tr><td>
! <b>Address:</b></td>
! <td>$input{'Address1'}<br>
! $input{'Address2'} , $input{'Postcode'}</td></tr>
! <tr><td>
! <b>Phone:</b></td>
! <td>$input{'Phone'}</td></tr>
! <tr><td>
! <b>Fax:</b></td>
! <td>$input{'Fax'}</td></tr>
! 
! 
! <tr><td>
! Username/Login:</td>
! <td align=center>
! <b>$input{'Login'}</b>
! </td></tr>
! <tr><td>
! Dial-in Password:</td>
! <td align=center>
! <b>$input{'Dial-passwd'}</b>
! </td></tr>
! <tr><td>
! Email Reply Address:</td>
! <td align=center>
! <b>$input{'Email-addr'}\@big.net.au</b>
! </td></tr>
! <tr><td>
! Email Password:</td>
! <td align=center>
! <b>$input{'Email-passwd'}</b>
! </td></tr>
! </table>
! </center>
! 
! </td><td>
! 
! <center>
! <table border=5>
! <tr><td>
! Dial-in No ( Brisbane ) :</td>
! <td align=center>
! <b>$dialup</b>
! </td></tr>
! <tr><td>
! IP Number:</td>
! <td align=center>
! <b>$IPno</b>
! </td></tr>
! <tr><td>
! Primary DNS:</td>
! <td align=center>
! <b>$DNSno</b>
! </td></tr>
! <tr><td>
! Secondary DNS:</td>
! <td align=center>
! <b>$sDNSno</b>
! </td></tr>
! <tr><td>
! HTTP Proxy:</td>
! <td align=center>
! <b>$proxy</b>
! </td></tr>
! <br>
! <tr><td>
! POP Server:</td>
! <td align=center>
! <b>mail.big.net.au</b>
! </td></tr>
! <tr><td>
! SMTP Server:</td>
! <td align=center>
! <b>mail.big.net.au</b>
! </td></tr>
! <tr><td>
! NEWS Server:</td>
! <td align=center>
! <b>$news</b>
! </td></tr>
! <tr><td>
! Home Page:</td>
! <td align=center>
! <b>http://www.big.net.au</b>
! </td></tr>
! <tr><td>
! Personal Home Page:</td>
! <td align=center>
! <b>http://www.big.net.au/~$input{'Email-addr'}</b>
! </td></tr>
! </table>
! </center>
! 
! </td></tr></table>
! 
! <center>
! Please keep this Information Sheet somewhere <b>safe</b> for future reference
! <hr>
  
! EOF
  
! open( FLE, "/usr/local/apache/htdocs/useradd/footer.htm" ) ;
! while( <FLE> ){ print ; }
! close( FLE ) ;
! 
! }
! 
! 
! ######################################################################
! # Display WITHOUT Proxy server
! 
! sub result_display_noproxy {
! print <<EOF;
! 
! 
! <html><head><title>BIG.NET.au - User Details</title></head>
! <BODY bgcolor="#ffffff">
! <center>
! <font size=+3>BIG.NET.au Customer Connection Details</font><br>
! Date: $input{'Date'}
! <table cellpadding=3 border=0><tr><td>
! 
! <table border=4><tr><td>
! <b>Name:</b></td>
! <td>$input{'Contact'}</td></tr>
! <tr><td>
! <b>Address:</b></td>
! <td>$input{'Address1'}<br>
! $input{'Address2'} , $input{'Postcode'}</td></tr>
! <tr><td>
! <b>Phone:</b></td>
! <td>$input{'Phone'}</td></tr>
! <tr><td>
! <b>Fax:</b></td>
! <td>$input{'Fax'}</td></tr>
! 
! 
! <tr><td>
! Username/Login:</td>
! <td align=center>
! <b>$input{'Login'}</b>
! </td></tr>
! <tr><td>
! Dial-in Password:</td>
! <td align=center>
! <b>$input{'Dial-passwd'}</b>
! </td></tr>
! <tr><td>
! Email Reply Address:</td>
! <td align=center>
! <b>$input{'Email-addr'}\@big.net.au</b>
! </td></tr>
! <tr><td>
! Email Password:</td>
! <td align=center>
! <b>$input{'Email-passwd'}</b>
! </td></tr>
! </table>
! </center>
! 
! </td><td>
! 
! <center>
! <table border=5>
! <tr><td>
! Dial-in No:</td>
! <td align=center>
! <b>$dialup</b>
! </td></tr>
! <tr><td>
! IP Number:</td>
! <td align=center>
! <b>$IPno</b>
! </td></tr>
! <tr><td>
! Primary DNS:</td>
! <td align=center>
! <b>$DNSno</b>
! </td></tr>
! <tr><td>
! Secondary DNS:</td>
! <td align=center>
! <b>$sDNSno</b>
! </td></tr>
! <br>
! <tr><td>
! POP Server:</td>
! <td align=center>
! <b>mail.big.net.au</b>
! </td></tr>
! <tr><td>
! SMTP Server:</td>
! <td align=center>
! <b>mail.big.net.au</b>
! </td></tr>
! <tr><td>
! NEWS Server:</td>
! <td align=center>
! <b>$news</b>
! </td></tr>
! <tr><td>
! Home Page:</td>
! <td align=center>
! <b>http://www.big.net.au</b>
! </td></tr>
! <tr><td>
! Personal Home Page:</td>
! <td align=center>
! <b>http://www.big.net.au/~$input{'Email-addr'}</b>
! </td></tr>
! </table>
! </center>
  
! </td></tr></table>
  
  
! <center>
! Please keep this Information Sheet somewhere <b>safe</b> for future reference
! <hr>
  
- EOF
  
- open( FLE, "/usr/local/apache/htdocs/useradd/footer.htm" ) ;
- while( <FLE> ){ print ; }
- close( FLE ) ;
  
  }
- 
- #
- # END OF SUBS
- ######################################################################
--- 205,365 ----
  {
      if ($input{'next-url'})
      {
!         print "Location: $input{'next-url'}\n\n";
      }
+     &result_display();
      exit 0;
  }
  
! # This is the bit that adds users to the system
! # Expect this to change alot
! # TODO:
! #   * plans
! #   * unlimited support
! #   * embed some c dbm routines
! #   * error checking (this is kinda important;-)
! #   * etc
! 
! sub useradd
! {
!     # some variables
!     my $default_expiry = 0;
!     my $default_slimit = -1;
!     my $default_tlimt = -1;
!     my $default_priority = 4;
!     my $ph_no = -1;
!     my $login = $input{'Login'};
!     my $passwd = $input{'Dial-passwd'};
!     
!     # do it
!     system("/usr/sbin/useradd -p $passwd $login");
!     systen("acua addrec $login $default_expiry $default_tlimit $default_slimit $default_priority \"$ph_no\"");
!     system("chsh -s /bin/zsh $login");
  
  }
+     
  
! sub result_display
! {
!     print <<_END_OF_HTML_;
  
!     <html><head><title>BIG.NET.au - User Details</title></head>
!     <BODY bgcolor="#ffffff">
!     <center>
!     <font size=+3>BIG.NET.au Customer Connection Details</font><br>
!     Date: $input{'Date'}
!     <table cellpadding=3 border=0><tr><td>
! 
!     <table border=4><tr><td>
!     <b>Name:</b></td>
!     <td>$input{'Contact'}</td></tr>
!     <tr><td>
!     <b>Address:</b></td>
!     <td>$input{'Address1'}<br>
!     $input{'Address2'} , $input{'Postcode'}</td></tr>
!     <tr><td>
!     <b>Phone:</b></td>
!     <td>$input{'Phone'}</td></tr>
!     <tr><td>
!     <b>Fax:</b></td>
!     <td>$input{'Fax'}</td></tr>
! 
!     <tr><td>
!     Username/Login:</td>
!     <td align=center>
!     <b>$input{'Login'}</b>
!     </td></tr>
!     <tr><td>
!     Dial-in Password:</td>
!     <td align=center>
!     <b>$input{'Dial-passwd'}</b>
!     </td></tr>
!     <tr><td>
!     Email Reply Address:</td>
!     <td align=center>
!     <b>$input{'Email-addr'}\@big.net.au</b>
!     </td></tr>
!     <tr><td>
!     Email Password:</td>
!     <td align=center>
!     <b>$input{'Email-passwd'}</b>
!     </td></tr>
!     </table>
!     </center>
! 
!     </td><td>
! 
!     <center>
!     <table border=5>
!     <tr><td>
!     Dial-in No:</td>
!     <td align=center>
!     <b>$dialup</b>
!     </td></tr>
!     <tr><td>
!     IP Address:</td>
!     <td align=center>
!     <b>$IPno</b>
!     </td></tr>
!     <tr><td>
!     Primary DNS:</td>
!     <td align=center>
!     <b>$DNSno</b>
!     </td></tr>
!     <tr><td>
!     Secondary DNS:</td>
!     <td align=center>
!     <b>$sDNSno</b>
!     </td></tr>
!     <tr><td>
!     Proxy Address:</td>
!     <td align=center>
!     <b>$proxy</b>
!     </td></tr>
!     <br>
!     <tr><td>
!     POP3 Server:</td>
!     <td align=center>
!     <b>mail.big.net.au</b>
!     </td></tr>
!     <tr><td>
!     SMTP Server:</td>
!     <td align=center>
!     <b>mail.big.net.au</b>
!     </td></tr>
!     <tr><td>
!     NNTP Server:</td>
!     <td align-center>
!     <b>$news</b>
!     </td></tr>
!     <tr><td>
!     Home Page:</td>
!     <td align=center>
!     <b>http://www.big.net.au</b>
!     </td></tr>
!     <tr><td>
!     Personal Home Page:</td>
!     <td align=center>
!     <b>http://www.big.net.ay/~$input{'Email-addr'}</b>
!     </td></tr>
!     </table>
!     </center>
! 
!     </td></tr></table>
! 
!     <center>
!     Please keep this Information Sheet somewhere <b>safe</b> for future reference
!     <hr>
  
!     
  
! _END_OF_HTML_
  
  
!     open(FLE, "/usr/local/apache/htdocs/useradd/footer.htm");
!     while(<FLE>){print ;}
!     close(FLE);
  
  
  
  }
