--- loncom/lonnet/perl/lonnet.pm 2024/09/25 17:29:15 1.1529 +++ loncom/lonnet/perl/lonnet.pm 2024/11/21 07:26:02 1.1530 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1529 2024/09/25 17:29:15 raeburn Exp $ +# $Id: lonnet.pm,v 1.1530 2024/11/21 07:26:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6749,18 +6749,22 @@ sub store { # -------------------------------------------------------------- Critical Store sub cstore { - my ($storehash,$symb,$namespace,$domain,$stuname,$laststore) = @_; + my ($storehash,$symb,$namespace,$domain,$stuname,$laststore,$ip,$nolog) = @_; my $home=''; if ($stuname) { $home=&homeserver($stuname,$domain); } - $symb=&symbclean($symb); + unless (($symb eq '_feedback') || ($symb eq '_discussion')) { + $symb=&symbclean($symb); + } if (!$symb) { unless ($symb=&symbread()) { return ''; } } if (!$domain) { $domain=$env{'user.domain'}; } if (!$stuname) { $stuname=$env{'user.name'}; } - &devalidate($symb,$stuname,$domain); + unless (($symb eq '_feedback') || ($symb eq '_discussion')) { + &devalidate($symb,$stuname,$domain); + } $symb=escape($symb); if (!$namespace) { @@ -6770,7 +6774,11 @@ sub cstore { } if (!$home) { $home=$env{'user.home'}; } - $$storehash{'ip'}=&get_requestor_ip(); + if ($ip ne '') { + $$storehash{'ip'} = $ip; + } else { + $$storehash{'ip'} = &get_requestor_ip(); + } $$storehash{'host'}=$perlvar{'lonHostID'}; my $namevalue=''; @@ -6778,7 +6786,9 @@ sub cstore { $namevalue.=&escape($key).'='.&freeze_escape($$storehash{$key}).'&'; } $namevalue=~s/\&$//; - &courselog($symb.':'.$stuname.':'.$domain.':CSTORE:'.$namevalue); + unless ($nolog) { + &courselog($symb.':'.$stuname.':'.$domain.':CSTORE:'.$namevalue); + } return critical ("store:$domain:$stuname:$namespace:$symb:$namevalue:$laststore","$home"); }