--- loncom/auth/lonroles.pm 2017/01/28 03:48:52 1.325 +++ loncom/auth/lonroles.pm 2017/05/19 19:47:40 1.331 @@ -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.331 2017/05/19 19:47:40 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]', @@ -1088,9 +1097,11 @@ ENDHEADER # ----------------------------------------------------------------------- Table if (($numdc > 0) || (($numhelpdesk > 0) && ($numadhoc > 0))) { - $r->print(&coursepick_jscript()); - $r->print(&Apache::loncommon::coursebrowser_javascript(). - &Apache::loncommon::authorbrowser_javascript()); + $r->print(&coursepick_jscript(). + &Apache::loncommon::coursebrowser_javascript()); + } + if ($numdc > 0) { + $r->print(&Apache::loncommon::authorbrowser_javascript()); } unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) { @@ -1726,9 +1737,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 +1802,7 @@ sub build_roletext { .''.$twhere.'' .''.$tpstart.'' .''.$tpend.''; - if (!$is_dc) { + unless ($poss_adhoc) { $roletext_end = ''. $tremark.' '. ''; @@ -1820,7 +1833,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; @@ -2052,9 +2065,9 @@ sub adhoc_roles_row { my ($dcdom,$rowtype) = @_; my $output = &Apache::loncommon::continue_data_table_row() .' ' - .&mt('[_1]Ad hoc[_2] roles in domain [_3] --' + .&mt('[_1]Ad hoc[_2] roles in domain [_3]' ,'','',$dcdom) - .' '; + .' -- '; my $role = 'cc'; my $selectcclink = &courselink($dcdom,$rowtype,$role); my $ccrole = &Apache::lonnet::plaintext('co',undef,undef,1); @@ -2082,9 +2095,9 @@ sub adhoc_customroles_row { if (scalar(keys(%{$domdefaults{'adhocroles'}})) > 0) { return &Apache::loncommon::continue_data_table_row() .' ' - .&mt('[_1]Ad hoc[_2] course/community roles in domain [_3] --', + .&mt('[_1]Ad hoc[_2] course/community roles in domain [_3]', '','',$dhdom) - .' '.&courselink($dhdom,$rowtype,$role); + .' -- '.&courselink($dhdom,$rowtype,$role); } } return;