version 1.1042, 2009/11/06 01:49:10
|
version 1.1046, 2009/11/29 00:17:22
|
Line 2760 sub courserolelog {
|
Line 2760 sub courserolelog {
|
if (($trole eq 'cc') || ($trole eq 'in') || |
if (($trole eq 'cc') || ($trole eq 'in') || |
($trole eq 'ep') || ($trole eq 'ad') || |
($trole eq 'ep') || ($trole eq 'ad') || |
($trole eq 'ta') || ($trole eq 'st') || |
($trole eq 'ta') || ($trole eq 'st') || |
($trole=~/^cr/) || ($trole eq 'gr')) { |
($trole=~/^cr/) || ($trole eq 'gr') || |
|
($trole eq 'co')) { |
if ($area =~ m-^/($match_domain)/($match_courseid)/?([^/]*)-) { |
if ($area =~ m-^/($match_domain)/($match_courseid)/?([^/]*)-) { |
my $cdom = $1; |
my $cdom = $1; |
my $cnum = $2; |
my $cnum = $2; |
Line 3908 sub custom_roleprivs {
|
Line 3909 sub custom_roleprivs {
|
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
my ($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef); |
my ($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef); |
if (defined($syspriv)) { |
if (defined($syspriv)) { |
|
if ($trest =~ /^$match_community$/) { |
|
$syspriv =~ s/bre\&S//; |
|
} |
$$allroles{'cm./'}.=':'.$syspriv; |
$$allroles{'cm./'}.=':'.$syspriv; |
$$allroles{$spec.'./'}.=':'.$syspriv; |
$$allroles{$spec.'./'}.=':'.$syspriv; |
} |
} |
Line 5046 sub allowed {
|
Line 5050 sub allowed {
|
my $courseprivid=''; |
my $courseprivid=''; |
|
|
my $ownaccess; |
my $ownaccess; |
# Community Coordinator browsing resource space. |
# Community Coordinator or Assistant Co-author browsing resource space. |
if (($priv eq 'bro') && ($env{'user.author'})) { |
if (($priv eq 'bro') && ($env{'user.author'})) { |
if ($uri eq '') { |
if ($uri eq '') { |
$ownaccess = 1; |
$ownaccess = 1; |
Line 5095 sub allowed {
|
Line 5099 sub allowed {
|
# Course |
# Course |
|
|
if ($env{'user.priv.'.$env{'request.role'}.'./'}=~/\Q$priv\E\&([^\:]*)/) { |
if ($env{'user.priv.'.$env{'request.role'}.'./'}=~/\Q$priv\E\&([^\:]*)/) { |
unless (($priv eq 'bro' && !$ownaccess)) { |
unless (($priv eq 'bro') && (!$ownaccess)) { |
$thisallowed.=$1; |
$thisallowed.=$1; |
} |
} |
} |
} |
Line 5104 sub allowed {
|
Line 5108 sub allowed {
|
|
|
if ($env{'user.priv.'.$env{'request.role'}.'./'.(split(/\//,$uri))[0].'/'} |
if ($env{'user.priv.'.$env{'request.role'}.'./'.(split(/\//,$uri))[0].'/'} |
=~/\Q$priv\E\&([^\:]*)/) { |
=~/\Q$priv\E\&([^\:]*)/) { |
unless (($priv eq 'bro' && !$ownaccess)) { |
unless (($priv eq 'bro') && (!$ownaccess)) { |
$thisallowed.=$1; |
$thisallowed.=$1; |
} |
} |
} |
} |
Line 5116 sub allowed {
|
Line 5120 sub allowed {
|
|
|
if ($env{'user.priv.'.$env{'request.role'}.'.'.$courseuri} |
if ($env{'user.priv.'.$env{'request.role'}.'.'.$courseuri} |
=~/\Q$priv\E\&([^\:]*)/) { |
=~/\Q$priv\E\&([^\:]*)/) { |
unless (($priv eq 'bro' && !$ownaccess)) { |
unless (($priv eq 'bro') && (!$ownaccess)) { |
$thisallowed.=$1; |
$thisallowed.=$1; |
} |
} |
} |
} |
Line 6138 sub devalidate_getgroups_cache {
|
Line 6142 sub devalidate_getgroups_cache {
|
|
|
sub plaintext { |
sub plaintext { |
my ($short,$type,$cid,$forcedefault) = @_; |
my ($short,$type,$cid,$forcedefault) = @_; |
if ($short =~ /^cr/) { |
if ($short =~ m{^cr/}) { |
return (split('/',$short))[-1]; |
return (split('/',$short))[-1]; |
} |
} |
if (!defined($cid)) { |
if (!defined($cid)) { |
Line 6227 sub assignrole {
|
Line 6231 sub assignrole {
|
$refused = 1; |
$refused = 1; |
} |
} |
if ($refused) { |
if ($refused) { |
if (($selfenroll == 1) && ($role eq 'st') && ($udom eq $env{'user.domain'}) && ($uname eq $env{'user.name'})) { |
my ($cdom,$cnum) = ($cwosec =~ m{^/?($match_domain)/($match_courseid)$}); |
|
if (!$selfenroll && $context eq 'course') { |
|
my %crsenv; |
|
if ($role eq 'cc' || $role eq 'co') { |
|
%crsenv = &userenvironment($cdom,$cnum,('internal.courseowner')); |
|
if (($role eq 'cc') && ($cnum !~ /^$match_community$/)) { |
|
if ($env{'request.role'} eq 'cc./'.$cdom.'/'.$cnum) { |
|
if ($crsenv{'internal.courseowner'} eq |
|
$env{'user.name'}.':'.$env{'user.domain'}) { |
|
$refused = ''; |
|
} |
|
} |
|
} elsif (($role eq 'co') && ($cnum =~ /^$match_community$/)) { |
|
if ($env{'request.role'} eq 'co./'.$cdom.'/'.$cnum) { |
|
if ($crsenv{'internal.courseowner'} eq |
|
$env{'user.name'}.':'.$env{'user.domain'}) { |
|
$refused = ''; |
|
} |
|
} |
|
} |
|
} |
|
} elsif (($selfenroll == 1) && ($role eq 'st') && ($udom eq $env{'user.domain'}) && ($uname eq $env{'user.name'})) { |
$refused = ''; |
$refused = ''; |
} elsif ($context eq 'requestcourses') { |
} elsif ($context eq 'requestcourses') { |
my @possroles = ('st','ta','ep','in','cc','co'); |
my @possroles = ('st','ta','ep','in','cc','co'); |
if ((grep(/^\Q$role\E$/,@possroles)) && ($env{'user.name'} ne '' && $env{'user.domain'} ne '')) { |
if ((grep(/^\Q$role\E$/,@possroles)) && ($env{'user.name'} ne '' && $env{'user.domain'} ne '')) { |
my ($cdom,$cnum) = ($cwosec =~ m{^/?($match_domain)/($match_courseid)$}); |
|
my $wrongcc; |
my $wrongcc; |
if ($cnum =~ /^$match_community$/) { |
if ($cnum =~ /^$match_community$/) { |
$wrongcc = 1 if ($role eq 'cc'); |
$wrongcc = 1 if ($role eq 'cc'); |