--- loncom/interface/lonparmset.pm 2000/11/27 15:12:42 1.14
+++ loncom/interface/lonparmset.pm 2000/11/27 16:08:55 1.15
@@ -248,6 +248,8 @@ sub handler {
# ---------------------------------------------------------- Anything to store?
if ($ENV{'form.pres_marker'}) {
my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'});
+ $spnam=~s/\_/\./;
+# ---------------------------------------------------------- Construct prefixes
my $symbparm=$symbp{$sresid}.'.'.$spnam;
my $mapparm=$mapp{$sresid}.'___(all).'.$spnam;
@@ -276,19 +278,32 @@ sub handler {
if ($snum==6) { $storeunder=$seclevel; }
if ($snum==5) { $storeunder=$seclevelm; }
if ($snum==4) { $storeunder=$seclevelr; }
+ $storeunder=&Apache::lonnet::escape($storeunder);
+
+ my $storecontent=
+ $storeunder.'='.&Apache::lonnet::escape($ENV{'form.pres_value'}).'&'.
+ $storeunder.'.type='.&Apache::lonnet::escape($ENV{'form.pres_type'});
-
- $message.="
Storing $ENV{'form.pres_value'} type $ENV{'form.pres_type'} under $ENV{'form.pres_marker'} in $storeunder
";
-
-
-# ---------------------------------------------------------- Construct prefixes
+ my $reply='';
if ($snum>3) {
# ---------------------------------------------------------------- Store Course
+ $reply=&Apache::lonnet::critical('put:'.
+ $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.':'.
+ $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.':resourcedata:'.
+ $storecontent,
+ $ENV{'course.'.$ENV{'request.course.id'}.'.home'});
} else {
# ------------------------------------------------------------------ Store User
- }
- }
+ $reply=
+ &Apache::lonnet::critical('put:'.$udom.':'.$uname.':resourcedata:'.
+ $storecontent,$uhome);
+ }
+ if ($reply=~/^error\:(.*)/) {
+ $message.="Write Error: $1
";
+ }
+# ---------------------------------------------------------------- Done storing
+ }
# -------------------------------------------------------------- Get coursedata
my $reply=&Apache::lonnet::reply('dump:'.
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.':'.
@@ -297,7 +312,8 @@ sub handler {
if ($reply!~/^error\:/) {
map {
my ($name,$value)=split(/\=/,$_);
- $courseopt{unescape($name)}=unescape($value);
+ $courseopt{&Apache::lonnet::unescape($name)}=
+ &Apache::lonnet::unescape($value);
} split(/\&/,$reply);
}
# --------------------------------------------------- Get userdata (if present)
@@ -307,7 +323,8 @@ sub handler {
if ($reply!~/^error\:/) {
map {
my ($name,$value)=split(/\=/,$_);
- $useropt{unescape($name)}=unescape($value);
+ $useropt{&Apache::lonnet::unescape($name)}=
+ &Apache::lonnet::unescape($value);
} split(/\&/,$reply);
}
}