--- loncom/lonsql 2007/01/02 12:51:31 1.78 +++ loncom/lonsql 2007/04/03 17:51:45 1.80 @@ -3,7 +3,7 @@ # The LearningOnline Network # lonsql - LON TCP-MySQL-Server Daemon for handling database requests. # -# $Id: lonsql,v 1.78 2007/01/02 12:51:31 raeburn Exp $ +# $Id: lonsql,v 1.80 2007/04/03 17:51:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -425,6 +425,7 @@ sub make_new_child { } else { $result=&courselog($path,$command); } + $result = &escape($result); } else { &logthis('Unable to do log query: '.$uname.'@'.$udom); $result='no_such_file'; @@ -659,9 +660,9 @@ sub portfolio_table_update { } } if ($result eq 'ok') { - my ($uname,$udom) = split(/:/,&unescape($arg1)); + my ($uname,$udom,$group) = split(/:/,&unescape($arg1)); my $file_name = &unescape($arg2); - my $group = &unescape($arg3); + my $action = $arg3; my $is_course = 0; if ($group ne '') { $is_course = 1; @@ -677,15 +678,17 @@ sub portfolio_table_update { $fullpath = $pathstart.'/portfolio'.$file_name; $url = $urlstart.'/portfolio'.$file_name; } - my %access = &get_access_hash($uname,$udom,$group.$file_name); if ($query eq 'portfolio_metadata') { - if (-e $fullpath.'.meta') { + if ($action eq 'delete') { + my %loghash = &LONCAPA::lonmetadata::process_portfolio_metadata($dbh,undef,\%tablenames,$url,$fullpath,$is_course,$udom,$uname,$group,'update'); + } elsif (-e $fullpath.'.meta') { my %loghash = &LONCAPA::lonmetadata::process_portfolio_metadata($dbh,undef,\%tablenames,$url,$fullpath,$is_course,$udom,$uname,$group,'update'); if (keys(%loghash) > 0) { &portfolio_logging(%loghash); } } } elsif ($query eq 'portfolio_access') { + my %access = &get_access_hash($uname,$udom,$group.$file_name); my %loghash = &LONCAPA::lonmetadata::process_portfolio_access_data($dbh,undef, \%tablenames,$url,$fullpath,\%access,'update'); @@ -1049,11 +1052,13 @@ sub userlog { { $include=0; } if (($filters{'end'}) && ($timestamp>$filters{'end'})) { $include=0; } + if (($filters{'action'} eq 'Role') && ($log !~/^Role/)) + { $include=0; } if (($filters{'action'} eq 'log') && ($log!~/^Log/)) { $include=0; } if (($filters{'action'} eq 'check') && ($log!~/^Check/)) { $include=0; } if ($include) { - push(@results,$timestamp.':'.$log); + push(@results,$timestamp.':'.$host.':'.&escape($log)); } } close IN;