#!/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 "\n"; print "\n"; print "\n"; print "

\n"; print "

$text{'titidx_brandmgr'}"; print "     \n"; print "Webmin $ver - $hostname - $ostr"; print "
$minfo{name} -- $minfo{version} -- $minfo{brand} -- $minfo{stamp}
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\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 ""; print ""; } else { print ""; print ""; } if ( $st[7] ne $item->{'size'} || $data_check eq "false" ) { print ""; $brand_warn="1"; $touchFiles++; } else { print ""; } print ""; print ""; print "\n"; } print "
".$text{f_filelistName} . "
".$text{f_fsize} . "
".$text{brand_data} . "
".$text{brand_desc} . "
{'fname'}&password=$password&task=fix\">$item->{'fname'}
$item->{'fname'}"; } 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 "$item->{'size'} $item->{'brand'}$item->{'descrip'}

\n"; print "

".&text('l_total',$lins)."

\n"; if ( $brand_warn eq "1" ) { print "warn ".&text("msgerr_brandinfo",$touchFiles)."      $totSize $text{changed}
"; } &footer($config{'back_return'},$text{'index'}); print "

\n"; do "footer.pl"; exit;