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

require './tarantella-lib.pl';

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

 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";

 $profilename=$in{profilename};

 if ($profilename)  {
           $userhostname=$in{userhostname};
           $descrip=$in{descrip};
           $usergrphosts=$in{usergrphosts};
           $hostname=$in{hostname};
           $username=$in{username}; 
           $userou=$in{userou}; 
           $lin_profile=$profilename."::".$descrip."::".$userhostname;
           $lin_profile=$lin_profile."::".$hostname."::".$usergrphosts;
           $lin_profile=$lin_profile."::".$username."::".$userou;
           &lock_file($config{'profcache_list'});
	   open(FILEHOSTSUSER, ">>$config{'profcache_list'}");
           print FILEHOSTSUSER "$lin_profile\n";
           close (FILEHOSTSUSER);
           $str=$text{'user_made'}.$profilename." ->  ".$descrip;
           &additional_log('addprofcache.cgi', undef, $str);
           &webmin_log($config{'profcache_list'}, undef, "write");
           &unlock_file($config{'profcache_list'});
           print "<tr><p><b>".$text{'user_made'}.$profilename." ->  ".$descrip."</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;

