stta/stta/stta_brandlst.cgi
2021-10-01 20:35:43 +01:00

136 lines
4.9 KiB
Perl
Executable File

#!/usr/bin/perl
# stta_installupd.cgi
# ... Init Update Services with Tarantella.
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo --- license GNU GPL
# stta: (@#) 1.31051043346- [2004_01_29_102036]
require '../web-lib.pl';
do 'web-lib.pl';
do 'global-lib.pl';
do 'lists-lib.pl';
do 'html-lib.pl';
do 'print-lib.pl';
&init_config();
&load_dataconf();
$white="#ffffff";
$hostname = &get_system_hostname();
$ver = &get_webmin_version();
&get_miniserv_config(\%miniserv);
if ($gconfig{'real_os_type'}) {
if ($gconfig{'os_version'} eq "*") {
$ostr = $gconfig{'real_os_type'};
}
else {
$ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
}
}
else {
$ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
}
%access = &get_module_acl();
%ttaprops=();
@ttahosts=();
%sttaparams=();
$cginame= $0 =~ /([^\/]+)$/ ? $1 : '-';
$ldap_ok=true;
$ldapcache_ok=true;
$tta_ok=true;
$button_lock=0;
@access_types = $access{'types'} eq '*' ? (0 .. 100)
: split(/\s+/, $access{'types'});
map { $access_types{$_}++ } @access_types;
$debug=$config{debug_code};
$debug=3;
&ReadParse();
$task=$in{task} || "";
$fileName=$in{file} || "" ;
$brandid=$in{brandid} || "" ;
$password=$in{password} || "" ;
$now = time();
$passData=`cat $root_directory/$module_name/install/.passwd 2>/dev/null`;
$passData=~ s/\r|\n//g;
if ( ! $access{'global'} || $access{'admin'} ne 1) { $redir="stta" };
if ( $redir ne "" ) {
&headerstta($text{'index_title'}, "images/$current_lang/stta_stta.gif", "sttaintro",undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
do "index/insupd.pl";
do "footer.pl";
exit;
}
if ( $config{check_brand} eq "true" ) { &check_brand_cgi() }
&headerstta($text{'brand_list'}, "", "brand_list" ,undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}");
local %minfo=&load_minfo("$root_directory/$module_name/");
sub err_file_open
{
$err_msg="$text{f_error} $fileName";
&footHere;
exit;
}
print "<table width=100% border>\n";
print "<tr $tb> <td valig=top><font color='$revtext'><b> $text{'titidx_brandmgr'}</b>";
print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
print "Webmin $ver - $hostname - $ostr";
print "</td></td> </tr>\n";
print "<tr><td><b> $minfo{name} -- $minfo{version} -- $minfo{brand} -- $minfo{stamp} </b></td></tr>\n";
print "<tr><td><table width=100% >\n";
print "<tr $tb>\n";
print "<td><font color='$revtext'><center><B>".$text{f_filelistName} . "</B></center></font></td>\n";
print "<td><font color='$revtext'><center><B>".$text{f_fsize} . "</B></center></font></td>\n";
print "<td><font color='$revtext'><center><B>".$text{brand_data} . "</B></center></font></td>\n";
print "<td><font color='$revtext'><center><B>".$text{brand_desc} . "</B></center></font></td>\n";
%h_brandInfo=&load_brandinfo();
$lins=0;
$touchFiles=0;
foreach $item (keys (%h_brandInfo)) { push (@brandInfoList,$h_brandInfo{$item}); }
@brandInfo = sort {$a->{fname} cmp $b->{fname}} @brandInfoList;
$brand_warn="0";
$totSize=0;
foreach $item (@brandInfo) {
$lins++;
my @st = stat("$root_directory/$item->{fname}");
my $data_check=&check_brand_data($item->{fname});
if ( $st[7] ne $item->{'size'} || $data_check eq "false" ) {
print "<tr $cb>";
print "<td><a class=\"menu1\" href=\"/stta/stta_brandmgr.cgi?file=$item->{'fname'}&password=$password&task=fix\">$item->{'fname'}</a></td>";
} else {
print "<tr background=\"$config{'bgimage'}\">";
print "<td>$item->{'fname'}</td>";
}
if ( $st[7] ne $item->{'size'} || $data_check eq "false" ) { print "<td>"; }
if ( $st[7] ne $item->{'size'} ) {
$n=0;
$n= $n + $item->{'size'};
$n= $st[7] - $n;
print " $item->{'size'} != $st[7] = $n ";
$totSize=$totSize + $n;
}
if ( $data_check eq "false" ) { print " $text{changed} ";}
if ( $st[7] ne $item->{'size'} || $data_check eq "false" ) {
print "</td>";
$brand_warn="1";
$touchFiles++;
} else {
print "<td>$item->{'size'} </td>";
}
print "<td>$item->{'brand'}</td>";
print "<td>$item->{'descrip'}</td>";
print "</tr>\n";
}
print "</table></td></tr><p>\n";
print "<tr><tr></table></table><p>\n";
print "<p><tr><td><b> ".&text('l_total',$lins)."</b></td><td><p>\n";
if ( $brand_warn eq "1" ) {
print "<img align=middle border=0 alt= 'warn ' src='images/warn.gif'> <font size=+1><b>".&text("msgerr_brandinfo",$touchFiles)."</b> &nbsp;&nbsp;&nbsp;&nbsp; $totSize $text{changed}</font><br>";
}
&footer($config{'back_return'},$text{'index'});
print "<p><p><p>\n";
do "footer.pl";
exit;