Changeset 107
- Timestamp:
- 01/13/06 12:33:02 (3 years ago)
- Files:
-
- trunk/webmin/lbs/admin.cgi (added)
- trunk/webmin/lbs/bootmenu.cgi (modified) (9 diffs)
- trunk/webmin/lbs/config (modified) (2 diffs)
- trunk/webmin/lbs/config.info (modified) (1 diff)
- trunk/webmin/lbs/config.info.fr (modified) (1 diff)
- trunk/webmin/lbs/debian/changelog (modified) (1 diff)
- trunk/webmin/lbs/desc2.cgi (modified) (2 diffs)
- trunk/webmin/lbs/images/detail-small.gif (added)
- trunk/webmin/lbs/lbs.pl (modified) (7 diffs)
- trunk/webmin/lbs/log.cgi (modified) (7 diffs)
- trunk/webmin/lbs/module.info (modified) (2 diffs)
- trunk/webmin/lbs/title2.cgi (modified) (2 diffs)
- trunk/webmin/lbs/wol.cgi (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/webmin/lbs/bootmenu.cgi
r44 r107 29 29 lbs_common::init_lbs_conf() or exit(0) ; 30 30 31 my ( @titles, @presel, @schedpresel, @desc, @menus, @schedmenus, @newmenus, @newschedmenus, @status, @schedstatus );31 my ( @titles, @presel, @schedpresel, @desc, @menus, @schedmenus, @newmenus, @newschedmenus, @status, @schedstatus, @images); 32 32 my ( %einfo, %hdr, %schedhdr, %parm ); 33 33 my ( $macaddr, $profile, $group, $umac, $macfile, $name, $defaultmenu, $scheddefaultmenu, $mesg, $mode); … … 46 46 'tr_body' => $cb, 47 47 ); 48 48 49 49 50 error( text( "err_dnf", $lbs_home ) ) if ( not -d $lbs_home ); … … 322 323 $mode = "MONO" if (($in{'mac'}) or ( $in{'name'})); 323 324 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 325 $mode = "SKEL" if ($in{'skel'}); 324 326 325 327 # get the computer (One Computer Mode) … … 341 343 $cfgfile = "$cfgpath/header.lst"; 342 344 create_group_dir($cfgpath); 343 } 345 } elsif ($mode eq "SKEL") { 346 $cfgpath="$lbs_home/images/imgskel"; 347 $cfgfile = "$cfgpath/header.lst"; 348 } 344 349 345 350 # load the needed header.lst … … 363 368 $defaultmenu = ''; 364 369 $scheddefaultmenu = ''; 370 @images = (); 365 371 foreach $i (@menus) { 366 372 # gather params for regular entries … … 375 381 $defaultmenu = $i if ( grep m/^y/i, $parm{'def'} ); 376 382 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'}; 377 393 } 378 394 … … 389 405 # header 390 406 lbs_common::print_header( $text{'tit_bmenu'}, "bootmenu", $VERSION); 391 392 407 # tabs 393 408 lbs_common::print_html_tabs(['system_backup', 'boot_menu']); 394 409 395 410 # boot menu, FIXME i18n 396 if ( $mode eq "MONO") { # only one client selected411 if (($mode eq "MONO")) { # only one client selected 397 412 print "<h2 align=center>Client $name ($macaddr)</h2>"; 398 413 print_bootmenu_form( … … 407 422 \@desc, 408 423 \@status, 409 \@schedstatus 424 \@schedstatus, 425 \@images 410 426 ); 411 } elsif ( $mode eq "MULTI") { # a group / profile selected427 } elsif (($mode eq "MULTI") or ($mode eq "SKEL")) { # a group / profile selected 412 428 my @local_title; 413 429 print "<h2 align=center>"; … … 427 443 \@desc, 428 444 \@status, 429 \@schedstatus 445 \@schedstatus, 446 \@images 430 447 ); 431 448 } trunk/webmin/lbs/config
r4 r107 1 1 tc_iface=eth0 2 tc_rate=100 Mbit3 tc_limit=100 Mbit2 tc_rate=1000Mbit 3 tc_limit=1000Mbit 4 4 5 restore_type= 05 restore_type=1 6 6 mtftp_wait=5 7 7 … … 10 10 11 11 grub_splashimage= 12 warning_message= 12 warning_message=Warning ! Your PC is being backed up or restored. Do not reboot ! trunk/webmin/lbs/config.info
r93 r107 15 15 line3=Misc,11 16 16 wake=Binary to wake PCs,0 17 wake_ip=List of broadcast addresses for WOL packets,0 17 18 chemin_basedir=Path to the LRS Basedir (aka tftpboot),0 18 19 add_password=Password for adding a new client,12 trunk/webmin/lbs/config.info.fr
r93 r107 15 15 line3=Divers,11 16 16 wake=Executable pour reveiller les PCs,0 17 wake_ip=Liste d'adresses de broadcast pour le WOL,0 17 18 chemin_basedir=Path to the LRS Basedir (aka tftpboot),0 18 19 add_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=low1 webmin-lbs (2.6.0) stable; urgency=low 2 2 3 3 * New release. trunk/webmin/lbs/desc2.cgi
r4 r107 53 53 54 54 if ( $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'}"; 57 60 } else { 58 $redir_flag = "imgbase";59 $redir = "imgbase.cgi";61 $redir_flag = "imgbase"; 62 $redir = "imgbase.cgi"; 60 63 } 61 64 … … 64 67 } 65 68 66 $in{'conf'} =~ s/^ [\.\/]+//;69 $in{'conf'} =~ s/^\.[\.]+//g; 67 70 $hdrname = $lbs_home . "/" . $in{'conf'} . "/conf.txt" ; 68 71 my $data; trunk/webmin/lbs/lbs.pl
r85 r107 179 179 my $but_cancel = $text{'but_cancel'} ; 180 180 my $lab_title = $text{$label} ; 181 my $more = ""; 182 183 if ($in{'group'} ne "") { 184 $more .= "<input type=hidden name=group value=\"$in{'group'}\">"; 185 } 186 if ($in{'profile'} ne "") { 187 $more .= "<input type=hidden name=profile value=\"$in{'profile'}\">"; 188 } 181 189 182 190 print <<EOF; 183 191 <p>$mesg</p> 184 192 <form action="$action"> 193 $more 185 194 <input type=hidden name=mac value="$mac"> 186 195 <input type=hidden name=conf value="$conf"> … … 356 365 } 357 366 358 # void print BootMenuForm($mac, $default, \@items, \@titles, \@presel, \@desc, \@status)367 # void print_bootmenu_form($mac, $default, \@items, \@titles, \@presel, \@desc, \@status) 359 368 # args: 360 369 # $mac: adresse MAC la machine … … 378 387 my $status = $_[9]; 379 388 my $schedstatus = $_[10]; 389 my $images = $_[11]; 380 390 my $i; 381 391 my $item; … … 440 450 $umenu = urlize($item); 441 451 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>"; 444 454 445 455 # default choices for scheduled boot … … 637 647 638 648 my $params = ""; 649 my $impath; 639 650 if ($mac) { 640 651 $params="mac=$umac"; 652 $impath="images/$smac"; 641 653 } elsif ($group or $profile) { 642 654 $params="group=$group&profile=$profile"; 655 $impath="imgbase"; 643 656 } 644 657 … … 650 663 $escapedtitles = html_escape($$titles[$i]) if (defined$$titles[$i]); 651 664 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>" ; 654 668 655 669 push @tolocal, "<center>" … … 938 952 } 939 953 940 954 # 955 # not used anymore ? 956 # 941 957 sub print_bootoptions_form { 942 958 my $mac = $_[0]; trunk/webmin/lbs/log.cgi
r4 r107 24 24 # stay strict 25 25 use strict; 26 use DB_File; ;26 use DB_File; 27 27 use Fcntl; 28 28 # get some common functions ... 29 29 require 'lbs.pl'; 30 require '../lbs_common/lbs_common_priv.pl'; 30 31 31 32 # ... and vars … … 33 34 use vars qw (%in %text $root_directory %gconfig $VERSION $LRS_HERE @LRS_MODULES %config %lbsconf $lbs_home $current_lang); 34 35 36 cookie_send_group(%in); 37 35 38 lbs_common::init_lbs_conf() or exit(0) ; 36 39 $lbs_home = $lbs_common::lbsconf{'basedir'}; 37 # entete 40 38 41 lbs_common::print_header( $text{'tit_index'}, "index", $VERSION); 42 43 cookie_get_group(\%in); 39 44 40 45 if (!defined $in{mac}) { … … 54 59 55 60 lbs_common::print_machines_list( 56 { 57 }, 58 \@labelfunctions, 59 \@bodyfunctions 61 { 62 }, 63 \@labelfunctions, 64 \@bodyfunctions, 65 %in 60 66 ); 67 68 } elsif (defined $in{postinst}) { 69 # log details 70 lbs_common::print_html_tabs(['system_backup', 'logs']); 71 72 &postlog($in{mac}); 73 61 74 } else { 62 75 # log details … … 151 164 } 152 165 } 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 153 178 # cut long image names 154 179 $log =~ s/\(Base-([0-9A-F]+)-/\(Base- $1-/; … … 235 260 236 261 # more log details 237 sub morelog 262 sub morelog($) 238 263 { 239 264 my $smac = lbs_common::mac_remove_columns(shift); … … 243 268 { 244 269 my $all = read_file_lines($file); 245 my $num = @$all;270 #my $num = @$all; 246 271 247 272 print "<h2>$text{lab_status}:</h2>"; 248 273 print "<pre>"; 249 foreach my $l ( @$all) {274 foreach my $l (reverse(@$all)) { 250 275 print logfile2txt_date($l)."<br>"; 251 276 } … … 255 280 256 281 } 282 283 # postinstall log details 284 sub 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 2 304 2005-06-13 09:00:17Z root $1 # $Id: module.info 2934 2005-12-06 17:19:04Z root $ 2 2 name=lrs 3 3 os_support= … … 7 7 8 8 depends=0.94 lbs_common proc at 9 version=2. 5.69 version=2.6.0 trunk/webmin/lbs/title2.cgi
r4 r107 55 55 if ( $ENV{'HTTP_REFERER'} =~ "/move.cgi" or $redir_flag eq "move" ) { 56 56 $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'}"; 58 61 } else { 59 62 $redir_flag = "imgbase"; … … 63 66 error($text{'err_invalcgi_nomenu'}) if (not exists $in{'conf'}); 64 67 65 $in{'conf'} =~ s/^ [\.\/]+//;68 $in{'conf'} =~ s/^\.[\.]+//g; 66 69 $hdrname = $lbs_home . "/" . $in{'conf'} . "/conf.txt" ; 67 70 trunk/webmin/lbs/wol.cgi
r67 r107 69 69 foreach my $k (etherGetMacs(\%einfo)) { 70 70 my $n = $einfo{$k}[1]; 71 if ( $n =~ m|([^:]* ):?([^:]+)/([^/]+)$| ) {71 if ( $n =~ m|([^:]*:)?/?([^:]+)/([^/]+)$| ) { 72 72 # group found 73 73 if (index ($2,$in{'group'}) != 0) { next; } … … 81 81 my $macs = ""; 82 82 83 foreach my $k (etherGetMacsFilterName(\%einfo, $in{'profile'} )) {83 foreach my $k (etherGetMacsFilterName(\%einfo, $in{'profile'}.":")) { 84 84 my $n = $einfo{$k}[1]; 85 85 if ( $n =~ m|^([^:]+):| ) {
