version 1.936, 2007/12/25 04:02:00
|
version 1.937, 2008/01/01 20:27:20
|
Line 2399 sub get_course_adv_roles {
|
Line 2399 sub get_course_adv_roles {
|
my %coursehash=&coursedescription($cid); |
my %coursehash=&coursedescription($cid); |
my %nothide=(); |
my %nothide=(); |
foreach my $user (split(/\s*\,\s*/,$coursehash{'nothideprivileged'})) { |
foreach my $user (split(/\s*\,\s*/,$coursehash{'nothideprivileged'})) { |
$nothide{join(':',split(/[\@\:]/,$user))}=1; |
if ($user !~ /:/) { |
|
$nothide{join(':',split(/[\@]/,$user))}=1; |
|
} else { |
|
$nothide{$user}=1; |
|
} |
} |
} |
my %returnhash=(); |
my %returnhash=(); |
my %dumphash= |
my %dumphash= |
Line 2427 sub get_course_adv_roles {
|
Line 2431 sub get_course_adv_roles {
|
} |
} |
|
|
sub get_my_roles { |
sub get_my_roles { |
my ($uname,$udom,$context,$types,$roles,$roledoms,$withsec)=@_; |
my ($uname,$udom,$context,$types,$roles,$roledoms,$withsec,$hidepriv)=@_; |
unless (defined($uname)) { $uname=$env{'user.name'}; } |
unless (defined($uname)) { $uname=$env{'user.name'}; } |
unless (defined($udom)) { $udom=$env{'user.domain'}; } |
unless (defined($udom)) { $udom=$env{'user.domain'}; } |
my %dumphash; |
my (%dumphash,%nothide); |
if ($context eq 'userroles') { |
if ($context eq 'userroles') { |
%dumphash = &dump('roles',$udom,$uname); |
%dumphash = &dump('roles',$udom,$uname); |
} else { |
} else { |
%dumphash= |
%dumphash= |
&dump('nohist_userroles',$udom,$uname); |
&dump('nohist_userroles',$udom,$uname); |
|
if ($hidepriv) { |
|
my %coursehash=&coursedescription($udom.'_'.$uname); |
|
foreach my $user (split(/\s*\,\s*/,$coursehash{'nothideprivileged'})) { |
|
if ($user !~ /:/) { |
|
$nothide{join(':',split(/[\@]/,$user))} = 1; |
|
} else { |
|
$nothide{$user} = 1; |
|
} |
|
} |
|
} |
} |
} |
my %returnhash=(); |
my %returnhash=(); |
my $now=time; |
my $now=time; |
Line 2486 sub get_my_roles {
|
Line 2500 sub get_my_roles {
|
} |
} |
} |
} |
} |
} |
|
if ($hidepriv) { |
|
if ((&privileged($username,$domain)) && |
|
(!$nothide{$username.':'.$domain})) { |
|
next; |
|
} |
|
} |
if ($withsec) { |
if ($withsec) { |
$returnhash{$username.':'.$domain.':'.$role.':'.$section} = |
$returnhash{$username.':'.$domain.':'.$role.':'.$section} = |
$tstart.':'.$tend; |
$tstart.':'.$tend; |