Changeset 138

Show
Ignore:
Timestamp:
05/09/06 17:15:26 (3 years ago)
Author:
ludo
Message:

v 2.6.4: base to local feature, static dhcp fixes (from r3364)

Files:

Legend:

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

    r44 r138  
    7373        $job->{'command'} =~ s/\\%/\0/g; 
    7474        $job->{'command'} =~ s/$config{'wake'}\s+//g; 
     75        $job->{'command'} =~ s/>\/dev\/null//g; 
    7576        @lines = split(/%/ , $job->{'command'}); 
    7677        if ($in{ext_cmd} ne "") { 
  • trunk/webmin/lbs/cron/index.cgi

    r44 r138  
    7878                        local $cmd = $job->{'command'}; 
    7979                        $cmd =~ s/$config{'wake'}/Wake On Lan, /; 
     80                        $cmd =~ s/>.dev.null//; 
    8081                        $cmd =~ s/\\%/\0/g; $cmd =~ s/%.*$//; 
    8182                        $cmd =~ s/\0/%/g; 
  • trunk/webmin/lbs/cron/save_cron.cgi

    r44 r138  
    3838$in{cmd} =~ s/%/\\%/g; 
    3939$in{cmd} =~ s/[\n\r ]+/ /g; 
    40 $in{cmd} = $config{'wake'}." ".$in{'cmd'}
     40$in{cmd} = $config{'wake'}." ".$in{'cmd'}." >/dev/null"
    4141$job->{'active'} = $in{'active'}; 
    4242$job->{'command'} = $in{'cmd'}; 
  • trunk/webmin/lbs/debian/changelog

    r130 r138  
    1 webmin-lbs (2.6.3) stable; urgency=low 
     1webmin-lbs (2.6.4) stable; urgency=low 
    22 
    33  * New release. 
  • trunk/webmin/lbs/delete.cgi

    r92 r138  
    9696                $mesg = text("msg_delete_ok",$name,$mac); 
    9797                lbs_common::print_header( $text{'tit_delete'}, "index", $VERSION); 
    98                 lbs_common::print_html_tabs(['system_backup', "delete_machine"]); 
     98                lbs_common::print_html_tabs(['system_backup', "delete_machine"]); 
     99 
     100                # delete for other modules 
     101                # ...will be moved to lbs_common soon 
     102                foreach my $mod ("lbs", "lrs-inventory", "backuppc") { 
     103                    if (-x "../$mod/lrs-admin") { 
     104                        system("unset SERVER_SOFTWARE;unset SERVER_NAME;unset GATEWAY_INTERFACE;unset REQUEST_METHOD;unset SCRIPT_FILENAME;unset QUERY_STRING;../$mod/lrs-admin remove $mac $name >/dev/null"); 
     105                    } 
     106                } 
    99107 
    100108                print "<h2>$mesg</h2>\n" ; 
  • trunk/webmin/lbs/help/imgbase.fr.html

    r4 r138  
    3737    de configuration des machines utilisatrices. 
    3838    </li> 
     39    <li><b>Conv en Locale</b><br> 
     40    Permet de convertir une image partagée en image locale, si elle n'est 
     41    pas utilisée par plus d'un client. 
     42    </li> 
    3943</ul> 
    4044 
  • trunk/webmin/lbs/help/imgbase.html

    r4 r138  
    1919 
    2020<p> 
     21The <b>Used by</b> column is useful to know which host(s) are currently 
     22using a particular image in its boot menu. 
     23Note that each host name (if any) in this column is a link to this host 
     24local images configuration. 
     25</p> 
     26 
     27<p> 
    2128In the <b>Remove</b> column are links to completely erase one or more images. 
    2229Note that you can't remove an image if it is currently used in a host's boot 
     
    2633 
    2734<p> 
    28 The <b>Used by</b> column is useful to know which host(s) are currently 
    29 using a particular image in its boot menu. 
    30 Note that each host name (if any) in this column is a link to this host 
    31 local images configuration. 
     35The <b>Conv to Local</b> column allow you to convert a shared image 
     36to a local one if it's not used by more than one client. 
    3237</p> 
  • trunk/webmin/lbs/help/index.html

    r4 r138  
    1212On <b>LRS</b> homepage, an array of <b>registered hosts</b> is displayed. 
    1313It contains a list of all hosts which have been registered on the LRS server. 
    14 Each hostname in the <b>name column </b> is a link on its b>boot menu</b> 
     14Each hostname in the <b>name column </b> is a link on its <b>boot menu</b> 
    1515configuration. 
    1616 
  • trunk/webmin/lbs/imgbase.cgi

    r4 r138  
    2626 
    2727# ... and vars 
    28 use vars qw (%access %config %in %lbsconf %text $VERSION); 
     28use vars qw (%access %config %in %lbsconf %text $VERSION $current_lang); 
    2929lbs_common::init_lbs_conf() or exit(0) ; 
    3030 
     
    8585        footer("", $text{'index'}) ; 
    8686 
     87} elsif (exists($in{'imgtolocal'}) and exists($in{'apply'}) and exists($in{'image'})) { 
     88 
     89        # move the data 
     90        my $from = $lbs_home . "/imgbase/". $in{'image'}; 
     91        my $to = $lbs_home . "/images/". lbs_common::mac_remove_columns($in{'imgtolocal'}); 
     92 
     93        # new name 
     94        my $lref = &read_file_lines($to."/COPYNUM"); 
     95 
     96        my $nextref = $$lref[0]; 
     97        $nextref =~ s/[^0-9]+//; 
     98        $$lref[0] = ($nextref + 1);     # increment COPYNUM 
     99        &flush_file_lines(); 
     100 
     101        if ( -l $to."/".$in{'image'} ) { 
     102                # the shared image is in the menu  
     103                unlink($to."/".$in{'image'}); 
     104                system("mv $from $to ; cd $to ; mv ".$in{'image'}." Local-$nextref"); 
     105                # modify header.lst* 
     106                foreach my $name ("/header.lst", "/header.lst.wol") { 
     107                        my $href = &read_file_lines($to.$name); 
     108                        for (@$href) { 
     109                                s/=$in{'image'}\//=Local-$nextref\//; 
     110                                s/=$in{'image'}$/=Local-$nextref/; 
     111                        } 
     112                        &flush_file_lines(); 
     113                } 
     114                 
     115        } else { 
     116                # the shared image is not in any menu 
     117                system("mv $from $to ; cd $to ; mv ".$in{'image'}." Local-$nextref"); 
     118        } 
     119 
     120        redirect("imgbase.cgi") ; 
     121        exit(0) ; 
     122         
     123 
     124} elsif (exists($in{'imgtolocal'})) { 
     125     
     126        my $options; 
     127        my %einfo; 
     128         
     129        my $etherfile = $lbs_home . "/etc/ether" ; 
     130        etherLoad($etherfile, \%einfo) or error( lbsGetError() ) ; 
     131 
     132        # the header 
     133        lbs_common::print_header( $text{'tit_imgbase'}, "imgbase", $VERSION); 
     134        lbs_common::print_html_tabs(['list_of_machines', 'shared_images']); 
     135         
     136        if (exists($in{'mac'})) { 
     137                my $name = etherGetNameByMac(\%einfo, $in{'mac'}); 
     138                $options = "<option value=\"$in{mac}\">$name</option>"; 
     139        } else { 
     140                my @all = etherGetNames(\%einfo); 
     141                foreach my $n (@all) { 
     142                        my $mac = etherGetMacByName(\%einfo, $n); 
     143                        $options .= "<option value=\"$mac\">$n</option>\n"; 
     144                } 
     145        } 
     146         
     147        # then the main part 
     148        my $t = new Qtpl("./tmpl/$current_lang/basetolocal.tpl"); 
     149        $t->assign('IMAGE', $in{'imgtolocal'}); 
     150        $t->assign('OPTIONS', $options); 
     151        $t->parse('all'); 
     152        $t->out('all'); 
     153         
     154        # end of tabs                                                            
     155        lbs_common::print_end_menu();                                            
     156        lbs_common::print_end_menu();                                            
     157        # footer                                                                 
     158        lbs_common::footer("", $text{'index'}) ; 
     159 
    87160} else {                                                                # show images array 
    88161        imgBaseUsage($lbs_home, \%busage) or error(lbsGetError()) ; 
  • trunk/webmin/lbs/lang/en

    r93 r138  
    6868lab_commands=Commandss 
    6969lab_comments=Comments 
     70lab_convtolocal=Conv. to Local 
    7071lab_copyfile=Enter the name of the copy of $1 
    7172lab_createfile=Enter the name of the file to create 
  • trunk/webmin/lbs/lang/fr

    r93 r138  
    6868lab_commands=Commandes 
    6969lab_comments=Commentaires 
     70lab_convtolocal=Conv. en Locale 
    7071lab_copyfile=Indiquez le nom de la copie de $1 
    7172lab_createfile=Indiquez le nom du fichier à créer 
  • trunk/webmin/lbs/lbs.pl

    r134 r138  
    5858my $etherfile = $lbs_home . "/etc/ether" ; 
    5959my $img_base = $lbs_home."/imgbase"; 
    60 my ($busage,$btitle,$bdesc,$bstat,$imgdir) = @_ ; 
    61 my (@lol, @lsdel, @lsused, @lsdesc, @lstitle,@sizes,@burn,@details) ; 
     60my ($busage, $btitle, $bdesc, $bstat, $imgdir) = @_ ; 
     61my (@lol, @lsdel, @lsused, @lsdesc, @lstitle, @sizes, @burn, @details, @lsconv) ; 
    6262my %tabattr ; 
    6363 
     
    6565etherLoad($etherfile, \%einfo) or error( lbsGetError() ) ; 
    6666 
    67 my $delicon;                                                            # « delete » icon 
    68 my @images; 
     67my ($delicon, $mvicon, $delref, $mvref, $mvmac, @images); 
    6968my @toprow = ( 
    7069        $text{'lab_baseimg'}, 
     
    7473        $text{'lab_size'}, 
    7574        $text{'lab_rm'}, 
     75        $text{'lab_convtolocal'}, 
    7676        $text{'lab_burn'}, 
    7777        $text{'lab_details'}, 
     
    8282                my $size = scalar(@ls); 
    8383                my @uls=(); 
     84                my $first = $ls[0]; 
    8485                 
    8586                push @images, $k ; 
    86          
    87                 if (not $size) {                                        # if there are no images attached 
     87 
     88                $mvmac = ""; 
     89                if ($size == 0 && $k ne "Base-0") {                     # if there are no images attached 
    8890                        $delicon = "trash.gif"; 
     91                        $mvicon = "up1.gif"; 
     92                        $delref = "<a href=\"imgbase.cgi?imgbase=".urlize($k)."\">"; 
     93                        $mvref = "<a href=\"imgbase.cgi?imgtolocal=".urlize($k)."\">"; 
    8994                        @uls = ( $text{"lab_none"} ) ; 
    9095                } else {                                                # else we built an anchor list 
    9196                        $delicon = "cross.gif"; 
     97                        $mvicon = "cross.gif"; 
     98                        $delref = ""; 
     99                        $mvref = ""; 
    92100                        foreach my $i (@ls)  
    93101                          { 
     
    98106                          } 
    99107                } 
     108 
     109                if ($size == 1 && $k ne "Base-0") { 
     110                        my $sname = $first; 
     111                        $sname =~ s/.*\///; 
     112                        $mvicon = "up1.gif"; 
     113                        $mvref = "<a href=\"imgbase.cgi?imgtolocal=".urlize($k). 
     114                                "&mac=".etherGetMacByName(\%einfo, $first)."\">"; 
     115                } 
    100116         
    101117                push @lsused, "<small>" . join("<br>", @uls) . "</small>" ;# which we attach with som "<br>" between each 
    102118 
    103119                push @lsdel, 
    104                         "<center>" 
    105                         ."<a href=\"imgbase.cgi?imgbase=" 
    106                         .urlize($k) 
    107                         ."\">" 
    108                         ."<img src=\"images/$delicon\" " 
     120                        "<center>$delref<img src=\"images/$delicon\" " 
    109121                        ."border=no alt=\"" 
    110122                        .$text{'lab_rm'} 
     123                        ." $k\"></a></center>" ; 
     124 
     125                push @lsconv, 
     126                        "<center>$mvref<img src=\"images/$mvicon\" " 
     127                        ."border=no alt=\"" 
     128                        .$text{'lab_convtolocal'} 
    111129                        ." $k\"></a></center>" ; 
    112130 
     
    129147        } 
    130148 
    131         push @lol, [ @images ],[ @lstitle ],[ @lsdesc ],[ @lsused ], [@sizes],[ @lsdel ], [@burn], [@details] ; 
     149        push @lol, [ @images ],[ @lstitle ],[ @lsdesc ],[ @lsused ], [@sizes],[ @lsdel ], [@lsconv], [@burn], [@details] ; 
    132150        lbs_common::lolRotate(\@lol) ; 
    133151   
  • trunk/webmin/lbs/log.cgi

    r107 r138  
    138138              ); 
    139139 
    140   if ($log =~ /([0-9A-E:]+) backup started \((.*)\)/) { 
     140  if ($log =~ /([0-9A-F:]+) backup started \((.*)\)/) { 
    141141    # add backup progress info 
    142142    my $name = $2; 
     
    153153  } 
    154154 
    155   if ($log =~ /([0-9A-E:]+) restoration started \((.*)\)/) { 
     155  if ($log =~ /([0-9A-F:]+) restoration started \((.*)\)/) { 
    156156    # add restoration progress info 
    157157    my $name = $2; 
     
    165165  } 
    166166 
    167   if ($log =~ /([0-9A-E:]+) postinstall started/) { 
     167  if ($log =~ /([0-9A-F:]+) postinstall started/) { 
    168168    # add restoration progress info 
    169169    my $name = $2; 
  • trunk/webmin/lbs/module.info

    r130 r138  
    77 
    88depends=0.94 lbs_common proc at 
    9 version=2.6.3 
     9version=2.6.4 
  • trunk/webmin/lbs/rename.cgi

    r132 r138  
    8484        $t =~ s|[^a-z0-9\.\-\+]|_|gi;   # translate unauthorized characters into underscores 
    8585 
     86        if ($t eq "") { error($text{'err_name_mandat'}); } 
     87 
    8688        # group parsing: 
    8789        chomp($g);                      # remove leading and trailing spaces 
     
    109111        # rename for other modules 
    110112        # ...will be moved to lbs_common soon 
    111         foreach my $mod ("lrs-inventory", "backuppc") { 
     113        foreach my $mod ("lbs", "lrs-inventory", "backuppc") { 
    112114                if (-x "../$mod/lrs-admin") { 
    113115                        system("unset SERVER_SOFTWARE;unset SERVER_NAME;unset GATEWAY_INTERFACE;unset REQUEST_METHOD;unset SCRIPT_FILENAME;unset QUERY_STRING;../$mod/lrs-admin rename $mac $old $t >/dev/null");