[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /lonnet/perl lonnet.pm
raeburn
raeburn@source.lon-capa.org
Tue, 05 Oct 2010 12:24:14 -0000
raeburn Tue Oct 5 12:24:14 2010 EDT
Modified files: (Branch: version_2_10_X)
/loncom/lonnet/perl lonnet.pm
Log:
- Backport 1.1088
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1056.4.11 loncom/lonnet/perl/lonnet.pm:1.1056.4.12
--- loncom/lonnet/perl/lonnet.pm:1.1056.4.11 Fri Oct 1 14:26:07 2010
+++ loncom/lonnet/perl/lonnet.pm Tue Oct 5 12:24:13 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1056.4.11 2010/10/01 14:26:07 raeburn Exp $
+# $Id: lonnet.pm,v 1.1056.4.12 2010/10/05 12:24:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4396,22 +4396,22 @@
}
sub check_adhoc_privs {
- my ($cdom,$cnum,$then,$refresh,$now,$checkrole) = @_;
+ my ($cdom,$cnum,$then,$refresh,$now,$checkrole,$caller) = @_;
my $cckey = 'user.role.'.$checkrole.'./'.$cdom.'/'.$cnum;
if ($env{$cckey}) {
my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus,$tpstart,$tpend);
&role_status($cckey,$then,$refresh,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend);
unless (($tstatus eq 'is') || ($tstatus eq 'will_not')) {
- &set_adhoc_privileges($cdom,$cnum,$checkrole);
+ &set_adhoc_privileges($cdom,$cnum,$checkrole,$caller);
}
} else {
- &set_adhoc_privileges($cdom,$cnum,$checkrole);
+ &set_adhoc_privileges($cdom,$cnum,$checkrole,$caller);
}
}
sub set_adhoc_privileges {
# role can be cc or ca
- my ($dcdom,$pickedcourse,$role) = @_;
+ my ($dcdom,$pickedcourse,$role,$caller) = @_;
my $area = '/'.$dcdom.'/'.$pickedcourse;
my $spec = $role.'.'.$area;
my %userroles = &set_arearole($role,$area,'','',$env{'user.domain'},
@@ -4421,14 +4421,16 @@
my ($author,$adv)= &set_userprivs(\%userroles,\%ccrole);
&appenv(\%userroles,[$role,'cm']);
&log($env{'user.domain'},$env{'user.name'},$env{'user.home'},"Role ".$role);
- &appenv( {'request.role' => $spec,
- 'request.role.domain' => $dcdom,
- 'request.course.sec' => ''
- }
- );
- my $tadv=0;
- if (&allowed('adv') eq 'F') { $tadv=1; }
- &appenv({'request.role.adv' => $tadv});
+ unless ($caller eq 'constructaccess' && $env{'request.course.id'}) {
+ &appenv( {'request.role' => $spec,
+ 'request.role.domain' => $dcdom,
+ 'request.course.sec' => ''
+ }
+ );
+ my $tadv=0;
+ if (&allowed('adv') eq 'F') { $tadv=1; }
+ &appenv({'request.role.adv' => $tadv});
+ }
}
# --------------------------------------------------------------- get interface