--- loncom/interface/slotrequest.pm 2025/03/31 13:55:06 1.151
+++ loncom/interface/slotrequest.pm 2025/04/02 23:44:01 1.152
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for requesting to have slots added to a students record
#
-# $Id: slotrequest.pm,v 1.151 2025/03/31 13:55:06 raeburn Exp $
+# $Id: slotrequest.pm,v 1.152 2025/04/02 23:44:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -83,6 +83,9 @@ sub start_page {
($env{'form.command'} eq 'remove_registration')))) {
if ($env{'form.symb'}) {
my $symb=&unescape($env{'form.symb'});
+ if ($symb =~ m{^/enc/}) {
+ $symb = &Apache::lonenc::unencrypted($symb);
+ }
my ($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($symb);
if ($resurl =~ /ext\.tool$/) {
my $target;
@@ -714,7 +717,11 @@ sub remove_registration_user {
my $name = &Apache::loncommon::plainname($env{'form.uname'},
$env{'form.udom'});
- my $title = &Apache::lonnet::gettitle($env{'form.symb'});
+ my $symb = &unescape($env{'form.symb'});
+ if ($symb =~ m{^/enc/}) {
+ $symb = &Apache::lonenc::unencrypted($symb);
+ }
+ my $title = &Apache::lonnet::gettitle($symb);
my $msg = &mt('Remove [_1] from slot [_2] for [_3]',
$name,$slot_name,$title);
@@ -796,6 +803,9 @@ sub release_slot {
if ($mgr eq 'F'
&& defined($env{'form.symb'})) {
$symb = &unescape($env{'form.symb'});
+ if ($symb =~ m{^/enc/}) {
+ $symb = &Apache::lonenc::unencrypted($symb);
+ }
}
my ($result,$msg) =
@@ -1548,6 +1558,15 @@ ENDSCRIPT
'
'.&mt('Action').' | '.&mt('Name').' | '.
&Apache::loncommon::end_data_table_header_row();
}
+ my $shownsymb;
+ if ($env{'request.role.adv'}) {
+ $shownsymb = $symb;
+ } elsif (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i) {
+ $shownsymb = &Apache::lonenc::encrypted($symb);
+ } else {
+ $shownsymb = $symb;
+ }
+ $shownsymb = &escape($shownsymb);
foreach my $slot (@{$available}) {
my $description=&get_description($slot,$slots->{$slot});
my $form;
@@ -1572,7 +1591,6 @@ ENDSCRIPT
}
}
}
- my $escsymb=&escape($symb);
if (!$form) {
my $name;
if ($formname) {
@@ -1585,7 +1603,7 @@ ENDSCRIPT
$form=<
-
+
@@ -1698,11 +1716,20 @@ sub remove_link {
undef($udom);
}
+ my $shownsymb;
+ if ($env{'request.role.adv'}) {
+ $shownsymb = $symb;
+ } elsif (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i) {
+ $shownsymb = &Apache::lonenc::encrypted($symb);
+ } else {
+ $shownsymb = $symb;
+ }
+
$slotname = &escape($slotname);
$entry = &escape($entry);
$uname = &escape($uname);
$udom = &escape($udom);
- $symb = &escape($symb);
+ $symb = &escape($shownsymb);
return <<"END_LINK";
symb();
+ my $src = $resource->src();
+ my ($shownsymb,$shownsrc);
+ $shownsymb = $resource->shown_symb();
+ if ($resource->encrypted()) {
+ $shownsrc = &Apache::lonenc::encrypted($src);
+ } else {
+ $shownsrc = $src;
+ }
next if (!$resource->is_problem() && !$resource->is_tool() &&
!$resource->is_sequence() && !$resource->is_page());
$count ++;
@@ -2409,7 +2444,7 @@ sub manage_reservations {
for (my $i=0; $i<$depth; $i++) {
$r->print('
');
}
- $r->print(''.
+ $r->print(''.
'
$crumb_titles{$env{'form.command'}}});
}
} elsif ($env{'form.context'} eq 'user') {
- if ($env{'form.symb'}) {
- $symb=&unescape($env{'form.symb'});
- $brcrum = &get_user_breadcrumbs($symb);
- } else {
- $brcrum =[];
- }
+ if ($env{'form.symb'}) {
+ $symb = &unescape($env{'form.symb'});
+ if ($symb =~ m{^/enc/}) {
+ $symb = &Apache::lonenc::unencrypted($symb);
+ }
+ $brcrum = &get_user_breadcrumbs($symb);
+ } else {
+ $brcrum =[];
+ }
}
} elsif (($env{'form.command'} eq 'get') && ($env{'form.context'} eq 'user')) {
if ($env{'form.symb'}) {
$symb=&unescape($env{'form.symb'});
+ if ($symb =~ m{^/enc/}) {
+ $symb = &Apache::lonenc::unencrypted($symb);
+ }
$brcrum = &get_user_breadcrumbs($symb);
} else {
$brcrum =[];
@@ -3654,6 +3698,9 @@ sub handler {
&show_reservations_log($r);
} else {
$symb = &unescape($env{'form.symb'});
+ if ($symb =~ m{^/enc/}) {
+ $symb = &Apache::lonenc::unencrypted($symb);
+ }
if (!defined($symb)) {
&fail($r,'not_valid');
return OK;