lilalo

diff l3-cgi @ 38:466bea239d25

1) В случае, если команда является повторяющейся,
показывать только последнюю версию команды.
2) lm-install неправильно определял hostname в FreeBSD. Исправлено.
author devi
date Tue Nov 22 20:46:46 2005 +0200 (2005-11-22)
parents e22df843b512
children aa788e638a9d
line diff
     1.1 --- a/l3-cgi	Mon Nov 14 09:16:28 2005 +0200
     1.2 +++ b/l3-cgi	Tue Nov 22 20:46:46 2005 +0200
     1.3 @@ -9,13 +9,10 @@
     1.4  	require l3config;
     1.5  };
     1.6  
     1.7 -my @filter;
     1.8 +my %filter;
     1.9  
    1.10 -for my $i (qw(host)) {
    1.11 -	my $value = param("$i");
    1.12 -	if ($value) {
    1.13 -		push @filter, "$i=$value";
    1.14 -	}
    1.15 +for my $key (qw(login_from)) {
    1.16 +	$filter{$key} =  param($key) if param($key);
    1.17  }
    1.18  
    1.19  my %Trainings;
    1.20 @@ -117,7 +114,10 @@
    1.21  	if ($course ne 'current') {
    1.22  		push @args, 	("--backend_datafile"	=>	"/var/lilalo/lablogs-xml/$course/$host/$user.xml");
    1.23  	} else {
    1.24 -		push @args, ("--filter" => "hostname=".$host."&user=".$user);
    1.25 +		$filter{hostname} = $host if $host;
    1.26 +		$filter{user} = $user if $user;
    1.27 +		push @args, ("--filter" => join ("&", (map("$_=$filter{$_}", keys %filter))));
    1.28 +		#push @args, ("--filter" => "hostname=".$host."&user=".$user);
    1.29  	}
    1.30  
    1.31  	open (FRONTEND, "./l3-frontend ".join(" ",map("\"$_\"",@args))." |");