#!/usr/bin/perl

print "Content-Type: Text/HTML\n\n";

use CGI ':standard';
use Vpanel 1.00;
require $header;
require $accountinfo;
$domainname = find_domain ($mainuser);

# Define the tab which appears to the front
$tab_section = $tabnum_website;

# Output the content associated with this tab
print "<body class=section-$tab_section>";

# display tabs
require $tabdisplay;

print_header ("Creation of a password protected area on www.$domainname");

$pw_protect_user = "pw" . $mainuser;

print "

	Please choose the folder and password before clicking on the button to install this feature:
	<BR>
	<form action=/$script_bin/$confirm_create_password_protection method=post class=text>
	<b>Directory</b>:<BR>
	<select name=directory><BR><BR>
";

system "./listdirectories.sh $domainname";
print "</select>";

print "<BR><BR><B>Password protection user:</b>:<BR>$pw_protect_user";
print "<input type=hidden name=user value=$pw_protect_user>";
print "<BR><BR><B>Password:</b><BR><select name=password>";
for ( $i = 1 ; $i <= $numpasswords ; $i++ )
{
	@new_password = ();
	@new_password = create_new_password();
	$password = $new_password[0];
	$pronounciation = $new_password[1];
	print "<option name=password value=$password>$password ($pronounciation)";
}
print "</select>";
print "<BR>(The password's pronounciation is in brackets)";

print_end_of_form();

require $footer;
