#!/usr/bin/perl
# addhostsuser.cgi
# ...  Servicios de Tarantella.

require './tarantella-lib.pl';

&header($text{'index_addhostsuser'}, "", "");
print "<hr><p>\n"; 
&foreign_require("proc", "proc-lib.pl");
&ReadParse();

 $type_cmd = $in{ttacmd};
 print "<table width=100% border>\n";
 print "<tr $tb> <td><b>$text{'titidx_adhostsuser'}</b></td> </tr>\n";
 print "<tr $cb> <td><table width=100%>\n";
 print "<center>\n";

 $hostname=$in{hostname};
 $username=$in{username};
 $descrip=$in{descrip};
 $password=$in{password};

 if ($username)  {
    $organizationname="";
    $dn_hostsuser="";
    $ens_hostsuser="";
           $lin_hostsuser=$username."::".$password."::".$descrip;
           &lock_file($config{'hostuser_list'});
	   open(FILEHOSTSUSER, ">>$config{'hostsuser_list'}");
           print FILEHOSTSUSER "$lin_hostsuser\n";
           close (FILEHOSTSUSER);
           $str=$text{'user_made'}.$username." ->  ".$in{userhostsuser};
           &additional_log('addhostsuser.cgi', undef, $str);
           &webmin_log($config{'hostuser_list'}, undef, "write");
           &unlock_file($config{'hostuser_list'});
           print "<tr><p><b>".$text{'user_made'}.$username." ->  ".$in{userhostsuser}."</b></tr>\n";
           print "<tr></tr>\n";
 }
 print "<tr><tr></table></table><hr><p>\n";
 &footer($config{'back_return'},$text{'index'});
 print "<p><p><p>\n";
 do "footer.pl";
 exit;

