Changeset 107

Show
Ignore:
Timestamp:
01/13/06 12:33:02 (3 years ago)
Author:
ludo
Message:

big svn sync with 2.6.0 (small bug fixes)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/webmin/lbs/bootmenu.cgi

    r44 r107  
    2929lbs_common::init_lbs_conf() or exit(0) ; 
    3030 
    31 my ( @titles, @presel, @schedpresel, @desc, @menus, @schedmenus, @newmenus, @newschedmenus, @status, @schedstatus); 
     31my ( @titles, @presel, @schedpresel, @desc, @menus, @schedmenus, @newmenus, @newschedmenus, @status, @schedstatus, @images); 
    3232my ( %einfo, %hdr, %schedhdr, %parm ); 
    3333my ( $macaddr, $profile, $group, $umac, $macfile, $name, $defaultmenu, $scheddefaultmenu, $mesg, $mode); 
     
    4646        'tr_body'   => $cb, 
    4747); 
     48 
    4849 
    4950error( text( "err_dnf", $lbs_home ) )  if ( not -d $lbs_home ); 
     
    322323        $mode = "MONO"  if (($in{'mac'}) or ( $in{'name'})); 
    323324        $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 
     325        $mode = "SKEL" if ($in{'skel'}); 
    324326         
    325327        # get the computer (One Computer Mode) 
     
    341343                $cfgfile = "$cfgpath/header.lst"; 
    342344                create_group_dir($cfgpath); 
    343         } 
     345        } elsif ($mode eq "SKEL") { 
     346                $cfgpath="$lbs_home/images/imgskel"; 
     347                $cfgfile = "$cfgpath/header.lst"; 
     348        } 
    344349 
    345350        # load the needed header.lst 
     
    363368        $defaultmenu            = ''; 
    364369        $scheddefaultmenu       = ''; 
     370        @images                 = (); 
    365371        foreach $i (@menus) { 
    366372                # gather params for regular entries 
     
    375381                        $defaultmenu = $i       if ( grep m/^y/i, $parm{'def'} ); 
    376382                        push @status, 0; 
     383                         
     384                        my $impath; 
     385                        if ($mode eq "MONO") { 
     386                                my $smac = $macaddr; 
     387                                $smac =~ s/://g; 
     388                                $impath = "images/".$smac; 
     389                        } else { 
     390                                $impath = "imgbase/"; 
     391                        } 
     392                        push @images, $impath."/".$parm{'image'}; 
    377393                } 
    378394                 
     
    389405        # header 
    390406        lbs_common::print_header( $text{'tit_bmenu'}, "bootmenu", $VERSION); 
    391  
    392407        # tabs 
    393408        lbs_common::print_html_tabs(['system_backup', 'boot_menu']); 
    394409   
    395410        # boot menu, FIXME i18n 
    396         if ($mode eq "MONO") {          # only one client selected 
     411        if (($mode eq "MONO")) {          # only one client selected 
    397412                print "<h2 align=center>Client $name ($macaddr)</h2>"; 
    398413                print_bootmenu_form( 
     
    407422                        \@desc, 
    408423                        \@status, 
    409                         \@schedstatus 
     424                        \@schedstatus, 
     425                        \@images 
    410426                ); 
    411         } elsif ($mode eq "MULTI") {    # a group / profile selected 
     427        } elsif (($mode eq "MULTI") or ($mode eq "SKEL")) {    # a group / profile selected 
    412428                my @local_title; 
    413429                print "<h2 align=center>"; 
     
    427443                        \@desc, 
    428444                        \@status, 
    429                         \@schedstatus 
     445                        \@schedstatus, 
     446                        \@images 
    430447                ); 
    431448        } 
  • trunk/webmin/lbs/config

    r4 r107  
    11tc_iface=eth0 
    2 tc_rate=100Mbit 
    3 tc_limit=100Mbit 
     2tc_rate=1000Mbit 
     3tc_limit=1000Mbit 
    44 
    5 restore_type=0 
     5restore_type=1 
    66mtftp_wait=5 
    77 
     
    1010 
    1111grub_splashimage= 
    12 warning_message= 
     12warning_message=Warning ! Your PC is being backed up or restored. Do not reboot ! 
  • trunk/webmin/lbs/config.info

    r93 r107  
    1515line3=Misc,11 
    1616wake=Binary to wake PCs,0 
     17wake_ip=List of broadcast addresses for WOL packets,0 
    1718chemin_basedir=Path to the LRS Basedir (aka tftpboot),0 
    1819add_password=Password for adding a new client,12 
  • trunk/webmin/lbs/config.info.fr

    r93 r107  
    1515line3=Divers,11 
    1616wake=Executable pour reveiller les PCs,0 
     17wake_ip=Liste d'adresses de broadcast pour le WOL,0 
    1718chemin_basedir=Path to the LRS Basedir (aka tftpboot),0 
    1819add_password=Mot de passe pour l'ajout de clients,12 
  • trunk/webmin/lbs/debian/changelog

    r93 r107  
    1 webmin-lbs (2.5.6) stable; urgency=low 
     1webmin-lbs (2.6.0) stable; urgency=low 
    22 
    33  * New release. 
  • trunk/webmin/lbs/desc2.cgi

    r4 r107  
    5353 
    5454if ( $ENV{'HTTP_REFERER'} =~ "/move.cgi" or $redir_flag eq "move" ) { 
    55     $redir_flag = "move"; 
    56     $redir = "move.cgi?mac=$mac&form=move"; 
     55        $redir_flag = "move"; 
     56        $redir = "move.cgi?mac=$mac&form=move&group=$in{'group'}&profile=$in{'profile'}"; 
     57} elsif ( $ENV{'HTTP_REFERER'} =~ "/bootmenu.cgi" or $redir_flag eq "boot" ) { 
     58        $redir_flag = "boot"; 
     59        $redir = "bootmenu.cgi?mac=$mac&group=$in{'group'}&profile=$in{'profile'}"; 
    5760} else { 
    58     $redir_flag = "imgbase"; 
    59     $redir = "imgbase.cgi"; 
     61       $redir_flag = "imgbase"; 
     62       $redir = "imgbase.cgi"; 
    6063} 
    6164 
     
    6467} 
    6568 
    66 $in{'conf'} =~ s/^[\.\/]+//
     69$in{'conf'} =~ s/^\.[\.]+//g
    6770$hdrname = $lbs_home . "/" . $in{'conf'} . "/conf.txt" ; 
    6871my $data;        
  • trunk/webmin/lbs/lbs.pl

    r85 r107  
    179179my $but_cancel = $text{'but_cancel'} ; 
    180180my $lab_title = $text{$label} ; 
     181my $more = ""; 
     182 
     183if ($in{'group'} ne "") { 
     184        $more .= "<input type=hidden name=group value=\"$in{'group'}\">"; 
     185} 
     186if ($in{'profile'} ne "") { 
     187        $more .= "<input type=hidden name=profile value=\"$in{'profile'}\">"; 
     188} 
    181189 
    182190print <<EOF; 
    183191<p>$mesg</p> 
    184192<form action="$action"> 
     193   $more 
    185194   <input type=hidden name=mac value="$mac"> 
    186195   <input type=hidden name=conf value="$conf"> 
     
    356365} 
    357366 
    358 # void printBootMenuForm($mac, $default, \@items, \@titles, \@presel, \@desc, \@status) 
     367# void print_bootmenu_form($mac, $default, \@items, \@titles, \@presel, \@desc, \@status) 
    359368# args: 
    360369#   $mac: adresse MAC la machine 
     
    378387my $status      = $_[9]; 
    379388my $schedstatus = $_[10]; 
     389my $images      = $_[11]; 
    380390my $i; 
    381391my $item; 
     
    440450                        $umenu = urlize($item); 
    441451                         
    442                         $$titles[$i] = "<a href=\"title.cgi?mac=$umac&obj=title&menu=$umenu\" $decor>" . html_escape( $$titles[$i] ) . "</a>"; 
    443                         $$desc[$i] = "<a href=\"desc.cgi?mac=$umac&obj=desc&menu=$umenu\" $decor>" . html_escape( $$desc[$i] ) . "</a>"; 
     452                        $$titles[$i] = "<a href=\"title2.cgi?mac=$umac&conf=$$images[$i]&redir_flag=boot\" $decor>" . html_escape( $$titles[$i] ) . "</a>"; 
     453                        $$desc[$i] = "<a href=\"desc2.cgi?mac=$umac&conf=$$images[$i]&redir_flag=boot\" $decor>" . html_escape( $$desc[$i] ) . "</a>"; 
    444454 
    445455                        # default choices for scheduled boot 
     
    637647 
    638648                my $params = ""; 
     649                my $impath; 
    639650                if ($mac) { 
    640651                        $params="mac=$umac"; 
     652                        $impath="images/$smac"; 
    641653                } elsif ($group or $profile) { 
    642654                        $params="group=$group&profile=$profile"; 
     655                        $impath="imgbase"; 
    643656                } 
    644657                 
     
    650663                $escapedtitles  = html_escape($$titles[$i]) if (defined$$titles[$i]); 
    651664 
    652                 $$desc[$i] = "<a href=\"desc.cgi?$params&obj=desc&menu=$urlizedmenu\" $decor>$escapeddesc</a>" ; 
    653                 $$titles[$i] = "<a href=\"title.cgi?$params&obj=title&menu=$urlizedmenu\" $decor>$escapedtitles</a>" ; 
     665                # the rename in group may not work properly 
     666                $$desc[$i] = "<a href=\"desc2.cgi?$params&conf=$impath/$$dirs[$i]&redir_flag=move\" $decor>$escapeddesc</a>" ; 
     667                $$titles[$i] = "<a href=\"title2.cgi?$params&conf=$impath/$$dirs[$i]&redir_flag=move\" $decor>$escapedtitles</a>" ; 
    654668 
    655669                push @tolocal, "<center>" 
     
    938952} 
    939953 
    940  
     954
     955# not used anymore ? 
     956
    941957sub print_bootoptions_form { 
    942958    my $mac     = $_[0]; 
  • trunk/webmin/lbs/log.cgi

    r4 r107  
    2424# stay strict 
    2525use strict; 
    26 use DB_File;; 
     26use DB_File; 
    2727use Fcntl; 
    2828# get some common functions ... 
    2929require 'lbs.pl'; 
     30require '../lbs_common/lbs_common_priv.pl'; 
    3031 
    3132# ... and vars 
     
    3334use vars qw (%in %text $root_directory %gconfig $VERSION $LRS_HERE @LRS_MODULES %config %lbsconf $lbs_home $current_lang); 
    3435 
     36cookie_send_group(%in); 
     37 
    3538lbs_common::init_lbs_conf() or exit(0) ; 
    3639$lbs_home = $lbs_common::lbsconf{'basedir'}; 
    37 # entete 
     40 
    3841lbs_common::print_header( $text{'tit_index'}, "index", $VERSION); 
     42 
     43cookie_get_group(\%in); 
    3944 
    4045if (!defined $in{mac}) { 
     
    5459 
    5560  lbs_common::print_machines_list( 
    56                                         { 
    57                                         }, 
    58                                         \@labelfunctions, 
    59                                         \@bodyfunctions 
     61                                  { 
     62                                  }, 
     63                                  \@labelfunctions, 
     64                                  \@bodyfunctions, 
     65                                  %in 
    6066                                ); 
     67 
     68} elsif (defined $in{postinst}) { 
     69  # log details 
     70  lbs_common::print_html_tabs(['system_backup', 'logs']); 
     71 
     72  &postlog($in{mac}); 
     73 
    6174} else { 
    6275  # log details 
     
    151164    } 
    152165  } 
     166 
     167  if ($log =~ /([0-9A-E:]+) postinstall started/) { 
     168    # add restoration progress info 
     169    my $name = $2; 
     170    my $mac = $1; 
     171    my $smac = lbs_common::mac_remove_columns($mac); 
     172    my $f = "$lbs_home/images/$smac/postinst.log"; 
     173    if (-r $f) { 
     174      $log .= " <a href='log.cgi?mac=$mac&postinst=1'><img src='images/detail-small.gif'></a>"; 
     175    } 
     176  } 
     177 
    153178  # cut long image names 
    154179  $log =~ s/\(Base-([0-9A-F]+)-/\(Base- $1-/; 
     
    235260 
    236261# more log details 
    237 sub morelog 
     262sub morelog($) 
    238263{ 
    239264  my $smac = lbs_common::mac_remove_columns(shift); 
     
    243268    { 
    244269      my $all = read_file_lines($file); 
    245       my $num = @$all; 
     270      #my $num = @$all; 
    246271 
    247272      print "<h2>$text{lab_status}:</h2>"; 
    248273      print "<pre>"; 
    249       foreach my $l (@$all) { 
     274      foreach my $l (reverse(@$all)) { 
    250275        print logfile2txt_date($l)."<br>"; 
    251276      } 
     
    255280   
    256281} 
     282 
     283# postinstall log details 
     284sub postlog($) 
     285{ 
     286  my $smac = lbs_common::mac_remove_columns(shift); 
     287 
     288  my $file = "$lbs_home/images/$smac/postinst.log"; 
     289  my $all = read_file_lines($file); 
     290 
     291  print "<h2>$text{lab_status} : postinst.log</h2>"; 
     292  print "<pre>".join("\n", @$all)."</pre>"; 
     293} 
  • trunk/webmin/lbs/module.info

    r93 r107  
    1 # $Id: module.info 2304 2005-06-13 09:00:17Z root $ 
     1# $Id: module.info 2934 2005-12-06 17:19:04Z root $ 
    22name=lrs 
    33os_support= 
     
    77 
    88depends=0.94 lbs_common proc at 
    9 version=2.5.6 
     9version=2.6.0 
  • trunk/webmin/lbs/title2.cgi

    r4 r107  
    5555if ( $ENV{'HTTP_REFERER'} =~ "/move.cgi" or $redir_flag eq "move" ) { 
    5656    $redir_flag = "move"; 
    57     $redir = "move.cgi?mac=$mac&form=move"; 
     57    $redir = "move.cgi?mac=$mac&form=move&group=$in{'group'}&profile=$in{'profile'}"; 
     58} elsif ( $ENV{'HTTP_REFERER'} =~ "/bootmenu.cgi" or $redir_flag eq "boot" ) { 
     59    $redir_flag = "boot"; 
     60    $redir = "bootmenu.cgi?mac=$mac&group=$in{'group'}&profile=$in{'profile'}"; 
    5861} else { 
    5962    $redir_flag = "imgbase"; 
     
    6366error($text{'err_invalcgi_nomenu'}) if (not exists $in{'conf'}); 
    6467 
    65 $in{'conf'} =~ s/^[\.\/]+//
     68$in{'conf'} =~ s/^\.[\.]+//g
    6669$hdrname = $lbs_home . "/" . $in{'conf'} . "/conf.txt" ; 
    6770         
  • trunk/webmin/lbs/wol.cgi

    r67 r107  
    6969        foreach my $k (etherGetMacs(\%einfo)) { 
    7070            my $n = $einfo{$k}[1]; 
    71             if ( $n =~ m|([^:]*):?([^:]+)/([^/]+)$| ) { 
     71            if ( $n =~ m|([^:]*:)?/?([^:]+)/([^/]+)$| ) { 
    7272                # group found 
    7373                if (index ($2,$in{'group'}) != 0) { next; } 
     
    8181        my $macs = ""; 
    8282 
    83         foreach my $k (etherGetMacsFilterName(\%einfo, $in{'profile'})) { 
     83        foreach my $k (etherGetMacsFilterName(\%einfo, $in{'profile'}.":")) { 
    8484            my $n = $einfo{$k}[1]; 
    8585            if ( $n =~ m|^([^:]+):| ) {