--- loncom/auth/lonroles.pm 2017/01/28 03:48:52 1.325 +++ loncom/auth/lonroles.pm 2017/03/13 18:14:13 1.328 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.325 2017/01/28 03:48:52 raeburn Exp $ +# $Id: lonroles.pm,v 1.328 2017/03/13 18:14:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -674,6 +674,15 @@ ENDENTERKEY } } } + if (($dest =~ m{^\Q/public/$cdom/$cnum/syllabus\E.*(\?|\&)usehttp=1}) || + ($dest =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) { + if ($ENV{'SERVER_PORT'} == 443) { + my $hostname = $r->hostname(); + if ($hostname ne '') { + $dest = 'http://'.$hostname.$dest; + } + } + } if ($dest =~ m{^/enc/}) { if ($env{'request.role.adv'}) { $dest = &Apache::lonenc::unencrypted($dest); @@ -706,7 +715,7 @@ ENDENTERKEY unless (($dest =~ m{^/enc/}) || ($dest =~ /(\?|\&)symb=.+___\d+___.+/)) { if (($destsymb ne '') && ($destsymb !~ m{^/enc/})) { my $esc_symb = &escape($destsymb); - $dest .= '?symb='.$esc_symb; + $dest .= (($dest =~/\?/)? '&':'?').'symb='.$esc_symb; } } &redirect_user($r, &mt('Entering [_1]', @@ -1726,9 +1735,11 @@ sub privileges_info { sub build_roletext { my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$trole,$twhere, $tpstart,$tpend,$nochoose,$button,$switchserver,$reinit,$switchwarning,$skipcal) = @_; - my ($roletext,$roletext_end); - my $is_dc=($trolecode =~ m/^dc\./); - my $rowspan=($is_dc) ? '' + my ($roletext,$roletext_end,$poss_adhoc); + if ($trolecode =~ m/^d(c|h|a)\./) { + $poss_adhoc = 1; + } + my $rowspan=($poss_adhoc) ? '' : ' rowspan="2" '; unless ($nochoose) { @@ -1789,7 +1800,7 @@ sub build_roletext { .''.$twhere.'' .''.$tpstart.'' .''.$tpend.''; - if (!$is_dc) { + unless ($poss_adhoc) { $roletext_end = ''. $tremark.' '. ''; @@ -1820,7 +1831,7 @@ sub check_for_adhoc { my $numhelpdesk = 0; my $numadhoc = 0; my $num_custom_adhoc = 0; - if ($env{'user.adv'}) { + if (($env{'user.adv'}) || ($env{'user.rar'})) { foreach my $envkey (sort(keys(%env))) { if ($envkey=~/^user\.role\.(dc|dh|da)\.\/($match_domain)\/$/) { my $role = $1;