--- loncom/interface/loncss.pm 2006/05/08 18:54:00 1.1 +++ loncom/interface/loncss.pm 2011/05/27 21:53:41 1.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # gerenates a lon-capa CSS response # -# $Id: loncss.pm,v 1.1 2006/05/08 18:54:00 albertel Exp $ +# $Id: loncss.pm,v 1.9 2011/05/27 21:53:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,7 @@ use Apache::lonnet; use Apache::loncommon; use Apache::Constants qw(:common); use POSIX qw(strftime); +use LONCAPA; sub handler { my ($r) = @_; @@ -40,13 +41,21 @@ sub handler { $url =~ s{^/adm/css/}{}; $url =~ s{ \.css $ }{}xms; - my ($uname,$domain,$timestamp,$function,$domain,$bgcolor) = + my ($uname,$udom,$version,$timestamp,$function,$domain,$bgcolor) = split(':',$url); $r->content_type('text/css'); - my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime(time+600)); + my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime(time+86400)); $r->header_out("Expires" => $date); + $r->header_out("Cache-Control" => "public, no-transform"); + $r->send_http_header; + my $handle = &Apache::lonnet::check_for_valid_session($r); + if ($handle ne '' ) { + &Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), + $handle); + } + $r->print(&Apache::loncommon::standard_css($function,$domain,$bgcolor)); return OK;