Changeset 257
- Timestamp:
- 06/26/07 15:50:37 (1 year ago)
- Files:
-
- trunk/webmin/lbs/bootmenu.cgi (modified) (4 diffs)
- trunk/webmin/lbs/bootoptions.cgi (modified) (3 diffs)
- trunk/webmin/lbs/lbs.pl (modified) (2 diffs)
- trunk/webmin/lbs/move.cgi (modified) (1 diff)
- trunk/webmin/lbs/rename.cgi (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/webmin/lbs/bootmenu.cgi
r219 r257 141 141 142 142 # load the needed header.lst.$WOL_EXTENSION (schedule mode), create it if needed (should'nt append here) 143 system("cp -a $cfgfile $cfgfile.$WOL_EXTENSION") unless -f "$cfgfile.$WOL_EXTENSION";143 system("cp -a \"$cfgfile\" \"$cfgfile.$WOL_EXTENSION\"") unless -f "$cfgfile.$WOL_EXTENSION"; 144 144 hdrLoad( "$cfgfile.$WOL_EXTENSION", \%schedhdr ) or error( lbsGetError() ); 145 145 # and parse it … … 201 201 my $origpath = "$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}"; 202 202 if (opendir ORIGPATH, $origpath) { 203 my $cmd = "cp -a " . join " ", map " $origpath/$_", grep { -l "$origpath/$_" or $_ eq "header.lst" or $_ eq "header.lst.$WOL_EXTENSION" } readdir(ORIGPATH);203 my $cmd = "cp -a " . join " ", map "\"$origpath/$_\"", grep { -l "$origpath/$_" or $_ eq "header.lst" or $_ eq "header.lst.$WOL_EXTENSION" } readdir(ORIGPATH); 204 204 closedir CFGPATH; 205 205 $cmd .= " $cfgpath"; … … 364 364 365 365 # load the needed header.lst.$WOL_EXTENSION (schedule mode), create it if needed 366 $cfgfile =~ s/[^a-z0-9\.\/_-]//gi; 367 system("cp -a $cfgfile $cfgfile.$WOL_EXTENSION") unless -f "$cfgfile.$WOL_EXTENSION"; 366 system("cp -a \"$cfgfile\" \"$cfgfile.$WOL_EXTENSION\"") unless -f "$cfgfile.$WOL_EXTENSION"; 368 367 hdrLoad( "$cfgfile.$WOL_EXTENSION", \%schedhdr ) or error( lbsGetError() ); 369 368 # and parse it … … 419 418 lbs_common::print_html_tabs(['system_backup', 'boot_menu']); 420 419 lbs_common::checkforspace(); 420 421 421 # boot menu, FIXME i18n 422 422 if (($mode eq "MONO")) { # only one client selected trunk/webmin/lbs/bootoptions.cgi
r170 r257 194 194 $cfgfile = "$lbs_home/images/$macfile/header.lst"; 195 195 } else { 196 $cfgpath ="$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}";196 $cfgpath = "$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}"; 197 197 $cfgfile = "$cfgpath/header.lst"; 198 198 } 199 199 200 200 save_bootmenu_options($cfgfile, %einfo); 201 202 201 if ($mode eq "MULTI") { # in multi mode we have to to the while thing once again for every client TODO: subfunction for this ? 203 202 # to do this, we need the entire mac list to be loaded … … 208 207 my $group = $in{'group'} or ""; 209 208 209 if ($profile eq "all") {$profile = "";} 210 210 211 lbs_common::etherLoad("$home/etc/ether", \%ether); 211 lbs_common::filter_machines_names($ oprofile, $in{'group'}, \%ether);212 lbs_common::filter_machines_names($profile, $group, \%ether); 212 213 213 214 foreach my $name (etherGetNames(\%ether)) { … … 221 222 my $origpath = "$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}"; 222 223 if (opendir ORIGPATH, $origpath) { 223 my $cmd = "cp -a " . join " ", map " $origpath/$_", grep { -l "$origpath/$_" or $_ eq "header.lst" } readdir(ORIGPATH);224 my $cmd = "cp -a " . join " ", map "\"$origpath/$_\"", grep { -l "$origpath/$_" or $_ eq "header.lst" } readdir(ORIGPATH); 224 225 closedir CFGPATH; 225 226 $cmd .= " $cfgpath"; trunk/webmin/lbs/lbs.pl
r206 r257 137 137 if ( ($siz =~ m/\d+k/i) || ($siz =~ m/\d+o/i)) { # images below 1 MB aren't shown 138 138 push @burn, "<center> </center>"; 139 push @details, "<center> </center>";140 139 } else { 141 140 push @burn, "<center><a href='/lbs-cd/?dir=".urlize($lbs_home."/imgbase/$k/")."'><img border=1 src='images/burn.gif'></a></center>"; 142 push @details, "<center><a href='details.cgi?conf=".urlize("/imgbase/$k/")."&mac=".urlize($in{'mac'})."'><img border=1 src='images/detail.gif'></a></center>"; 141 } 142 143 if ( (($siz =~ m/\d+k/i) || ($siz =~ m/\d+o/i)) && !($k =~ m/Base-/i)) { # images below 1 MB aren't shown 144 push @details, "<center> </center>"; 145 } else { 146 push @details, "<center><a href='details.cgi?conf=".urlize("/imgbase/$k/")."&mac=".urlize($in{'mac'})."'><img border=1 src='images/detail.gif'></a></center>"; 143 147 } 144 148 … … 1226 1230 my $lbs_home = $lbs_common::lbsconf{'basedir'}; 1227 1231 1228 $cfgpath =~ s/[^a-z0-9\/_ -]//gi;1232 $cfgpath =~ s/[^a-z0-9\/_ -]//gi; 1229 1233 1230 1234 my $cfgfile="$cfgpath/header.lst"; 1231 1235 1232 1236 if (not -e $cfgfile) { 1233 `mkdir -p $cfgpath`;1234 `cp -a $lbs_home/imgskel/header.lst $cfgpath`;1235 `cp -a $lbs_home/imgskel/COPYNUM $cfgpath`;1236 `cp -a $lbs_home/imgskel/symlinks $cfgpath`;1237 `cat $lbs_home/imgskel/symlinks | sed "s/\\.\\.\\/\\.\\./\\/tftpboot\\/revoboot/" > $cfgpath/symlinks`;1238 `cd $cfgpath&& ./symlinks`;1237 `mkdir -p "$cfgpath"`; 1238 `cp -a $lbs_home/imgskel/header.lst "$cfgpath"`; 1239 `cp -a $lbs_home/imgskel/COPYNUM "$cfgpath"`; 1240 `cp -a $lbs_home/imgskel/symlinks "$cfgpath"`; 1241 `cat $lbs_home/imgskel/symlinks | sed "s/\\.\\.\\/\\.\\./\\/tftpboot\\/revoboot/" > "$cfgpath/symlinks"`; 1242 `cd "$cfgpath" && ./symlinks`; 1239 1243 } 1240 1244 trunk/webmin/lbs/move.cgi
r219 r257 93 93 $cfgfile = "$cfgpath/header.lst"; 94 94 } elsif ($mode eq "MULTI") { 95 $cfgpath ="$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}";95 $cfgpath = "$lbs_home/imgprofiles/$in{'profile'}/$in{'group'}"; 96 96 $cfgfile = "$cfgpath/header.lst"; 97 97 create_group_dir($cfgpath); trunk/webmin/lbs/rename.cgi
r235 r257 91 91 $g =~ s|^/+(.*)$|$1|; # remove leading "/" 92 92 $g =~ s|^(.*)/$|$1|gi; # remove trailing "/" 93 $g =~ s|[^a-z0-9\.\-/\+ ]|_|gi; # translate unauthorized characters into underscores93 $g =~ s|[^a-z0-9\.\-/\+ ]|_|gi; # translate unauthorized characters into underscores 94 94 95 95 # profile parsing: … … 97 97 $p =~ s|^/+(.*)$|$1|; # remove leading "/" 98 98 $p =~ s|^(.*)/$|$1|gi; # remove trailing "/" 99 $p =~ s|[^a-z0-9\.\-/\:\+ ]|_|gi;# translate unauthorized characters into underscores99 $p =~ s|[^a-z0-9\.\-/\:\+ ]|_|gi;# translate unauthorized characters into underscores 100 100 101 101 $t = "$p:$g/$t";
