Changeset 130
- Timestamp:
- 03/01/06 15:14:08 (3 years ago)
- Files:
-
- trunk/webmin/lbs/bootmenu.cgi (modified) (7 diffs)
- trunk/webmin/lbs/bootoptions.cgi (modified) (8 diffs)
- trunk/webmin/lbs/debian/changelog (modified) (1 diff)
- trunk/webmin/lbs/lbs.pl (modified) (2 diffs)
- trunk/webmin/lbs/module.info (modified) (1 diff)
- trunk/webmin/lbs/move.cgi (modified) (5 diffs)
- trunk/webmin/lbs/wol.cgi (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/webmin/lbs/bootmenu.cgi
r107 r130 55 55 56 56 etherLoad( $etherfile, \%einfo ) or error( lbsGetError() ); 57 58 # make sure to use the 'all' directory when any profile is requested 59 my $oprofile = $in{'profile'}; 60 if (exists($in{'profile'}) && ($in{'profile'} eq "")) { 61 $in{'profile'} = "all"; 62 } 57 63 58 64 # On effectue une modif si presence du param cgi 'apply' (on ignore sa valeur). … … 102 108 103 109 # Mode Selection 110 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 104 111 $mode = "MONO" if (($in{'mac'})); 105 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'}));106 112 107 113 # Get the computer (One Computer Mode) … … 179 185 my $group = $in{'group'} or ""; 180 186 187 if ($profile eq "all") { $profile = ""; } # filter_machines_names does not like profile=all 188 181 189 lbs_common::etherLoad("$home/etc/ether", \%ether); 182 lbs_common::filter_machines_names($ in{'profile'}, $in{'group'}, \%ether);190 lbs_common::filter_machines_names($profile, $in{'group'}, \%ether); 183 191 184 192 foreach my $name (etherGetNames(\%ether)) { … … 240 248 } else { 241 249 $mesg = text( "msg_bootmenu_groupwriteok", "$in{'profile'}:$in{'group'}"); 242 print "<script>setTimeout(\"location='bootmenu.cgi?group=$in{'group'}&profile=$ in{'profile'}&random='+Math.random();\",2000)</script>";250 print "<script>setTimeout(\"location='bootmenu.cgi?group=$in{'group'}&profile=$oprofile&random='+Math.random();\",2000)</script>"; 243 251 print "<p>$mesg</p>\n"; 244 print "<a href=\"bootmenu.cgi?group=$in{'group'}&profile=$ in{'profile'}\">$but_return</a>";252 print "<a href=\"bootmenu.cgi?group=$in{'group'}&profile=$oprofile\">$but_return</a>"; 245 253 } 246 254 print "<p> </p>\n"; … … 256 264 257 265 # Mode Selection 266 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 258 267 $mode = "MONO" if (($in{'mac'})); 259 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'}));260 268 261 269 # grab the path of our menu … … 287 295 } else { 288 296 $mesg = text( "msg_bootmenu_groupwriteok", "$in{'profile'}:$in{'group'}"); 289 print "<script>setTimeout(\"location='bootmenu.cgi?group=$in{'group'}&profile=$ in{'profile'}&random='+Math.random();\",2000)</script>";297 print "<script>setTimeout(\"location='bootmenu.cgi?group=$in{'group'}&profile=$oprofile&random='+Math.random();\",2000)</script>"; 290 298 print "<p>$mesg</p>\n"; 291 print "<a href=\"bootmenu.cgi?group=$in{'group'}&profile=$ in{'profile'}\">$but_return</a>";299 print "<a href=\"bootmenu.cgi?group=$in{'group'}&profile=$oprofile\">$but_return</a>"; 292 300 } 293 301 print "<p> </p>\n"; … … 321 329 lbsClearError(); 322 330 331 $mode = "MULTI" if (($in{'group'}) or exists($in{'profile'})); 323 332 $mode = "MONO" if (($in{'mac'}) or ( $in{'name'})); 324 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'}));325 333 $mode = "SKEL" if ($in{'skel'}); 326 334 trunk/webmin/lbs/bootoptions.cgi
r93 r130 151 151 etherLoad( $etherfile, \%einfo ) or error( lbsGetError() ); 152 152 153 # make sure to use the 'all' directory when any profile is requested 154 my $oprofile = $in{'profile'}; 155 if (exists($in{'profile'}) && ($in{'profile'} eq "")) { 156 $in{'profile'} = "all"; 157 } 158 153 159 # On effectue une modif si presence du param cgi 'apply' (on ignore sa valeur). 154 160 # Ou on redirige sur index.cgi si presence du param cgi 'cancel'. … … 170 176 171 177 if ( exists( $in{'form2'} ) ) { 178 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 172 179 $mode = "MONO" if (($in{'mac'})); 173 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'}));174 180 175 181 # get the computer (One Computer Mode) … … 202 208 203 209 lbs_common::etherLoad("$home/etc/ether", \%ether); 204 lbs_common::filter_machines_names($ in{'profile'}, $in{'group'}, \%ether);210 lbs_common::filter_machines_names($oprofile, $in{'group'}, \%ether); 205 211 206 212 foreach my $name (etherGetNames(\%ether)) { … … 259 265 redirect("bootoptions.cgi?mac=$umac") ; 260 266 } elsif ($mode eq "MULTI") { 261 redirect("bootoptions.cgi?group=$in{'group'}&profile=$ in{'profile'}") ;267 redirect("bootoptions.cgi?group=$in{'group'}&profile=$oprofile") ; 262 268 } 263 269 exit; … … 269 275 # Must define a default menu: 270 276 error( $text{'err_bootmenu_mustdef'} ) if ( not exists( $in{'default'} ) ); 277 278 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 271 279 $mode = "MONO" if (($in{'mac'})); 272 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'}));273 280 274 281 # get the computer (One Computer Mode) … … 346 353 } elsif ($mode eq "MULTI") { 347 354 print "<p>$mesg</p>\n"; 348 print "<a href=\"bootoptions.cgi?group=$in{'group'}&profile=$ in{'profile'}\">$but_return</a>";355 print "<a href=\"bootoptions.cgi?group=$in{'group'}&profile=$oprofile\">$but_return</a>"; 349 356 print "<p> </p>\n"; 350 357 } … … 378 385 lbsClearError(); 379 386 387 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 380 388 $mode = "MONO" if (($in{'mac'}) or ( $in{'name'})); 381 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'}));382 389 383 390 # get the computer (One Computer Mode) … … 581 588 } elsif ($mode eq "MULTI") { 582 589 print "<input type=hidden name=group value=\"$in{'group'}\">\n"; 583 print "<input type=hidden name=profile value=\"$ in{'profile'}\">\n";590 print "<input type=hidden name=profile value=\"$oprofile\">\n"; 584 591 } 585 592 trunk/webmin/lbs/debian/changelog
r109 r130 1 webmin-lbs (2.6. 1) stable; urgency=low1 webmin-lbs (2.6.3) stable; urgency=low 2 2 3 3 * New release. trunk/webmin/lbs/lbs.pl
r109 r130 536 536 537 537 sub checkhostname { 538 return 0 if ( not grep(m/^[0-9a-z\.:\/- ]+$/i, $_[0]) ) ;538 return 0 if ( not grep(m/^[0-9a-z\.:\/-_]+$/i, $_[0]) ) ; 539 539 1; 540 540 } … … 896 896 $arrow = "doubleup1.gif" if ($$flags[$i]); 897 897 898 if (( $profile ne "") or ($group ne"")) {898 if ((($profile ne "") or ($group ne "")) and ($mac eq "")) { 899 899 push @tohdr, "<center><a href=\"move.cgi?profile=$profile&group=$group&img=$uitem&op=b2h\">" 900 900 . "<img src=\"images/$arrow\" border=no " trunk/webmin/lbs/module.info
r109 r130 7 7 8 8 depends=0.94 lbs_common proc at 9 version=2.6. 19 version=2.6.3 trunk/webmin/lbs/move.cgi
r44 r130 55 55 ReadParse() ; 56 56 57 # make sure to use the 'all' directory when any profile is requested 58 my $oprofile = $in{'profile'}; 59 if (exists($in{'profile'}) && ($in{'profile'} eq "")) { 60 $in{'profile'} = "all"; 61 } 62 63 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 57 64 $mode = "MONO" if (($in{'mac'}) or ( $in{'name'})); 58 $mode = "MULTI" if (($in{'group'}) or ( $in{'profile'})); 59 65 60 66 if ($mode eq "MONO") { 61 67 if (not exists($in{'mac'})) { … … 112 118 unlink("$lbs_home/images/$macfile/$img") if (-l "$lbs_home/images/$macfile/$img"); 113 119 } elsif ($mode eq "MULTI") { 114 moveHdr2Local_Multi($lbs_home, $cfgpath, $img); 115 116 # to do this, we need the entire mac list to be loaded 117 my $home=$lbs_common::lbsconf{'basedir'}; 118 my %ether; 119 120 # and normalized 121 lbs_common::etherLoad("$home/etc/ether", \%ether); 122 lbs_common::filter_machines_names($in{'profile'}, $in{'group'}, \%ether); 123 124 my $profile = $in{'profile'} or ""; 125 my $group = $in{'group'} or ""; 126 127 foreach my $name (etherGetNames(\%ether)) { 128 my $macaddr = etherGetMacByName (\%ether, $name); 129 my $macfile = toMacFileName($macaddr); 130 my $cfgpath = "$home/images/$macfile"; 131 if (opendir CFGPATH, $cfgpath) { 132 unlink map "$cfgpath/$_", grep { -l "$cfgpath/$_"} readdir(CFGPATH); 133 closedir CFGPATH; 134 } 135 my $origpath = "$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}"; 136 if (opendir ORIGPATH, $origpath) { 137 my $cmd = "cp -a " . join " ", map "$origpath/$_", grep { -l "$origpath/$_" or $_ eq "header.lst" or $_ eq "header.lst.$WOL_EXTENSION" } readdir(ORIGPATH); 138 closedir CFGPATH; 139 $cmd .= " $cfgpath"; 140 system($cmd); 141 } 142 } 143 144 # foreach my $name (etherGetNames(\%ether)) { 145 # my $macaddr = etherGetMacByName (\%ether, $name); 146 # $macfile = toMacFileName($macaddr); 147 # moveHdr2Local($lbs_home, $macaddr, $img, undef, 1); 148 # unlink("$lbs_home/images/$macfile/$img") if (-l "$lbs_home/images/$macfile/$img"); 149 # } 150 120 moveHdr2Local_Multi($lbs_home, $cfgpath, $img); 151 121 } 152 122 } elsif ($op eq "l2h") { # from local to host … … 159 129 } elsif ($mode eq "MULTI") { 160 130 moveBase2Hdr_Multi($lbs_home, $cfgpath, $img); 161 162 # then save the checked values for every machine of our group / profile163 my $profile=$in{'profile'};164 my $group=$in{'group'};165 166 # to do this, we need the entire mac list to be loaded167 my $home=$lbs_common::lbsconf{'basedir'};168 my %ether;169 170 # and normalized171 lbs_common::etherLoad("$home/etc/ether", \%ether);172 lbs_common::filter_machines_names($in{'profile'}, $in{'group'}, \%ether);173 174 foreach my $name (etherGetNames(\%ether)) {175 my $macaddr = etherGetMacByName (\%ether, $name);176 my $macfile = toMacFileName($macaddr);177 my $cfgpath = "$home/images/$macfile";178 if (opendir CFGPATH, $cfgpath) {179 unlink map "$cfgpath/$_", grep { -l "$cfgpath/$_"} readdir(CFGPATH);180 closedir CFGPATH;181 }182 my $origpath = "$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}";183 if (opendir ORIGPATH, $origpath) {184 my $cmd = "cp -a " . join " ", map "$origpath/$_", grep { -l "$origpath/$_" or $_ eq "header.lst" or $_ eq "header.lst.$WOL_EXTENSION" } readdir(ORIGPATH);185 closedir CFGPATH;186 $cmd .= " $cfgpath";187 system($cmd);188 }189 }190 191 # foreach my $name (etherGetNames(\%ether)) {192 # moveBase2Hdr($lbs_home, etherGetMacByName (\%ether, $name), $img, undef, 1);193 # }194 131 } 195 132 } elsif ($op eq "del") { # deletion … … 204 141 redirect("move.cgi?mac=$umac") ; 205 142 } elsif ($mode eq "MULTI") { 206 redirect("move.cgi?group=$in{'group'}&profile=$ in{'profile'}") ;143 redirect("move.cgi?group=$in{'group'}&profile=$oprofile") ; 207 144 } 208 145 … … 329 266 addBackupProgressInfo($f, \$d); 330 267 331 push @basetitles, "<a href='title2.cgi?group=$in{'group'}&profile=$ in{'profile'}&conf=$ff' $decor>$t</a>";332 push @basedescs, "<a href='desc2.cgi?group=$in{'group'}&profile=$ in{'profile'}&conf=$ff' $decor>$d</a>" ;268 push @basetitles, "<a href='title2.cgi?group=$in{'group'}&profile=$oprofile&conf=$ff' $decor>$t</a>"; 269 push @basedescs, "<a href='desc2.cgi?group=$in{'group'}&profile=$oprofile&conf=$ff' $decor>$d</a>" ; 333 270 } else { 334 271 push @basetitles, "(storage?)" ; trunk/webmin/lbs/wol.cgi
r107 r130 64 64 #redirect($redir) ; 65 65 } 66 elsif ( exists$in{'group'}) {66 elsif ($in{'group'}) { 67 67 my $macs = ""; 68 68 … … 81 81 my $macs = ""; 82 82 83 foreach my $k (etherGetMacsFilterName(\%einfo, $in{'profile'}.":")) { 83 my $filt = $in{'profile'}.":"; 84 if ($filt eq ":") { $filt = "" }; 85 86 foreach my $k (etherGetMacsFilterName(\%einfo, $filt)) { 84 87 my $n = $einfo{$k}[1]; 85 88 if ( $n =~ m|^([^:]+):| ) { 86 # groupfound89 # prof found 87 90 if (index ($1,$in{'profile'}) != 0) { next; } 88 91 $macs .= $k." "; 92 } elsif ( $filt eq "" ) { 93 $macs .= $k." "; 89 94 } 90 95 }
