[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /lonnet/perl lonnet.pm
raeburn
raeburn@source.lon-capa.org
Thu, 11 Nov 2010 20:56:04 -0000
raeburn Thu Nov 11 20:56:04 2010 EDT
Modified files: (Branch: version_2_9_X)
/loncom/lonnet/perl lonnet.pm
Log:
- Backport 1.1085, 1.1086.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1056.2.8 loncom/lonnet/perl/lonnet.pm:1.1056.2.9
--- loncom/lonnet/perl/lonnet.pm:1.1056.2.8 Tue Oct 5 12:53:30 2010
+++ loncom/lonnet/perl/lonnet.pm Thu Nov 11 20:56:04 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1056.2.8 2010/10/05 12:53:30 raeburn Exp $
+# $Id: lonnet.pm,v 1.1056.2.9 2010/11/11 20:56:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1577,7 +1577,8 @@
# If there is a role which has expired, return it.
#
$courseid = &courseid_to_courseurl($courseid);
- my %roleshash = &dump('roles',$udom,$unam,$courseid);
+ my $extra = &freeze_escape({'skipcheck' => 1});
+ my %roleshash = &dump('roles',$udom,$unam,$courseid,undef,$extra);
foreach my $key (keys(%roleshash)) {
next if ($key !~/^\Q$courseid\E(?:\/)*(\w+)*\_st$/);
my $section=$1;
@@ -2879,8 +2880,9 @@
unless (defined($uname)) { $uname=$env{'user.name'}; }
unless (defined($udom)) { $udom=$env{'user.domain'}; }
my (%dumphash,%nothide);
- if ($context eq 'userroles') {
- %dumphash = &dump('roles',$udom,$uname);
+ if ($context eq 'userroles') {
+ my $extra = &freeze_escape({'skipcheck' => 1});
+ %dumphash = &dump('roles',$udom,$uname,'.',undef,$extra);
} else {
%dumphash=
&dump('nohist_userroles',$udom,$uname);
@@ -4258,7 +4260,7 @@
# -------------------------------------------------------------- dump interface
sub dump {
- my ($namespace,$udomain,$uname,$regexp,$range)=@_;
+ my ($namespace,$udomain,$uname,$regexp,$range,$extra)=@_;
if (!$udomain) { $udomain=$env{'user.domain'}; }
if (!$uname) { $uname=$env{'user.name'}; }
my $uhome=&homeserver($uname,$udomain);
@@ -4267,7 +4269,7 @@
} else {
$regexp='.';
}
- my $rep=&reply("dump:$udomain:$uname:$namespace:$regexp:$range",$uhome);
+ my $rep=&reply("dump:$udomain:$uname:$namespace:$regexp:$range:$extra",$uhome);
my @pairs=split(/\&/,$rep);
my %returnhash=();
foreach my $item (@pairs) {
@@ -4943,6 +4945,11 @@
sub is_advanced_user {
my ($udom,$uname) = @_;
+ if ($udom ne '' && $uname ne '') {
+ if (($udom eq $env{'user.domain'}) && ($uname eq $env{'user.name'})) {
+ return $env{'user.adv'};
+ }
+ }
my %roleshash = &get_my_roles($uname,$udom,'userroles',undef,undef,undef,1);
my %allroles;
my $is_adv;
@@ -6228,7 +6235,8 @@
} else {
$grouplist = '';
my $courseurl = &courseid_to_courseurl($courseid);
- my %roleshash = &dump('roles',$udom,$uname,$courseurl);
+ my $extra = &freeze_escape({'skipcheck' => 1});
+ my %roleshash = &dump('roles',$udom,$uname,$courseurl,undef,$extra);
my $access_end = $env{'course.'.$courseid.
'.default_enrollment_end_date'};
my $now = time;