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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
#!/usr/local/bin/perl
# import_form.cgi
# Display a form for importing an existing mail domain, dns zone, apache
# virtual host and mysql database so that they can be controlled by this module.
require './virtual-server-lib.pl';
$access{'create'} && $access{'import'} || &error($text{'import_ecannot'});
&ui_print_header(undef, $text{'import_title'}, "");
print "$text{'import_desc1'}<p>\n";
print "$text{'import_desc2'}<p>\n";
print "$text{'import_desc3'}<p>\n";
print "<form action=import.cgi method=post>\n";
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'import_header'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
print "<tr> <td><b>$text{'import_dom'}</b></td>\n";
print "<td colspan=3><input name=dom size=40></td> </tr>\n";
print "<tr> <td valign=top><b>$text{'import_user'}</b></td> <td colspan=3>\n";
print "<input type=radio name=user_def value=1> $text{'import_ucr'}<br>\n";
print "<input type=radio name=user_def value=0 checked> $text{'import_uex'}\n";
print &unix_user_input("user"),"</td>\n";
print "<tr> <td valign=top><b>$text{'import_group'}</b></td> <td colspan=3>\n";
print "<input type=radio name=group_def value=1> $text{'import_gdf'}<br>\n";
print "<input type=radio name=group_def value=0 checked> $text{'import_gex'}\n";
print &unix_group_input("group"),"</td>\n";
print "<tr> <td><b>$text{'import_pass'}</b></td>\n";
print "<td><input name=pass size=20 type=password></td>\n";
print "<td><b>$text{'import_webmin'}</b></td>\n";
print "<td><input type=radio name=webmin value=1 checked> $text{'yes'}\n";
print "<input type=radio name=webmin value=0> $text{'no'}</td> </tr>\n";
$defip = &get_default_ip();
print "<tr> <td><b>$text{'import_ip'}</b></td>\n";
print "<td><input name=ip size=15 value='$defip'></td>\n";
print "<td><b>$text{'import_hasvirt'}</b></td>\n";
print "<td><input type=radio name=virt value=1> $text{'yes'}";
print "<input type=radio name=virt value=0 checked> $text{'no'}</td> </tr>\n";
if ($config{'home_quotas'}) {
print "<tr> <td><b>$text{'form_quota'}</b></td>\n";
@defquota = split (/ /,$config{'defquota'});
if ( !@defquota or $#defquota eq 0 ) {
print "<td>","a_input("quota", $config{'defquota'},
$config{'home_quotas'}),"</td>\n";
} else {
print "<td><select name=quota>\n";
foreach $i (@defquota) {
chomp $i;
print "<option value=\"$i\">$i</option>\n";
}
print "<option value=\"-1\">$text{'other'}</option></select>\n";
print "a_input("otherquota", "",
$config{'home_quotas'}),"</td>\n";
}
print "</tr>\n";
}
if ($config{'mysql'}) {
print "<tr> <td><b>$text{'import_db_mysql'}</b></td>\n";
print "<td colspan=3><input name=db_mysql size=40></td> </tr>\n";
}
if ($config{'postgres'}) {
print "<tr> <td><b>$text{'import_db_postgres'}</b></td>\n";
print "<td colspan=3><input name=db_postgres size=40></td> </tr>\n";
}
print "</table></td></tr></table>\n";
print "<input type=submit value='$text{'import_show'}'></form>\n";
&ui_print_footer("", $text{'index_return'});
|