[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm
raeburn
raeburn at source.lon-capa.org
Thu Aug 10 17:14:58 EDT 2017
raeburn Thu Aug 10 21:14:58 2017 EDT
Modified files:
/loncom/interface loncreateuser.pm
Log:
- Assignment of DC roles via the web GUI may only be made to other domains
with the same "internet domain" as the current role.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.444 loncom/interface/loncreateuser.pm:1.445
--- loncom/interface/loncreateuser.pm:1.444 Mon Aug 7 20:22:13 2017
+++ loncom/interface/loncreateuser.pm Thu Aug 10 21:14:58 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.444 2017/08/07 20:22:13 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.445 2017/08/10 21:14:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2145,11 +2145,20 @@
'<th>'.&mt('Start').'</th><th>'.&mt('End').'</th>'.
&Apache::loncommon::end_data_table_header_row();
my @allroles = &Apache::lonuserutils::roles_by_context('domain');
+ my $uprimary = &Apache::lonnet::domain($env{'request.role.domain'},'primary');
+ my $uintdom = &Apache::lonnet::internet_dom($uprimary);
foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) {
foreach my $role (@allroles) {
next if ($role eq 'ad');
next if (($role eq 'au') && ($ccdomain ne $thisdomain));
if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) {
+ if ($role eq 'dc') {
+ unless ($thisdomain eq $env{'request.role.domain'}) {
+ my $domprim = &Apache::lonnet::domain($thisdomain,'primary');
+ my $intdom = &Apache::lonnet::internet_dom($domprim);
+ next unless ($uintdom eq $intdom);
+ }
+ }
my $plrole=&Apache::lonnet::plaintext($role);
my %lt=&Apache::lonlocal::texthash(
'ssd' => "Set Start Date",
More information about the LON-CAPA-cvs
mailing list