[LON-CAPA-cvs] cvs: loncom / lond /interface loncommon.pm loncreateuser.pm longroup.pm lonuserutils.pm /lonnet/perl lonnet.pm
raeburn
raeburn at source.lon-capa.org
Wed Apr 25 17:22:28 EDT 2012
raeburn Wed Apr 25 21:22:28 2012 EDT
Modified files:
/loncom/interface loncommon.pm loncreateuser.pm lonuserutils.pm
longroup.pm
/loncom/lonnet/perl lonnet.pm
/loncom lond
Log:
- lond uses client's LON-CAPA version to determine whether checking a user's
course roles for version requirements needs to occur -- will be skipped
on 2.10 and later, as it occurs client-side in rolesinit when building
roles/courses display.
- No longer require sixth arg for lonnet::dump
(frozen hash containing skipcheck => 1).
- Reverse changes in loncommon.pm 1.982, longroup.pm rev 1.26, 1.27
loncreateuser.pm rev 1.350, lonuserutils.pm 1.127, 1.137,
lonnet.pm rev 1.1086, 1.1078 which used the "$extra" sixth arg.
-------------- next part --------------
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1072 loncom/interface/loncommon.pm:1.1073
--- loncom/interface/loncommon.pm:1.1072 Wed Apr 18 20:52:44 2012
+++ loncom/interface/loncommon.pm Wed Apr 25 21:22:01 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1072 2012/04/18 20:52:44 raeburn Exp $
+# $Id: loncommon.pm,v 1.1073 2012/04/25 21:22:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3990,9 +3990,7 @@
$udom = $env{'user.domain'};
}
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,'.',undef,
- $extra);
+ my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname);
if (!%roles) {
%roles = (
cc => 1,
@@ -7793,8 +7791,7 @@
sub check_user_status {
my ($udom,$uname,$cdom,$crs,$role,$sec) = @_;
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %userinfo = &Apache::lonnet::dump('roles',$udom,$uname,'.',undef,$extra);
+ my %userinfo = &Apache::lonnet::dump('roles',$udom,$uname);
my @uroles = keys %userinfo;
my $srchstr;
my $active_chk = 'none';
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.359 loncom/interface/loncreateuser.pm:1.360
--- loncom/interface/loncreateuser.pm:1.359 Thu Dec 8 22:10:18 2011
+++ loncom/interface/loncreateuser.pm Wed Apr 25 21:22:01 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.359 2011/12/08 22:10:18 www Exp $
+# $Id: loncreateuser.pm,v 1.360 2012/04/25 21:22:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1465,8 +1465,7 @@
$rolesdump{$newkey} = $newvalue;
}
} else {
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname,'.',undef,$extra);
+ %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname);
}
# Build up table of user roles to allow revocation and re-enabling of roles.
my ($tmp) = keys(%rolesdump);
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.137 loncom/interface/lonuserutils.pm:1.138
--- loncom/interface/lonuserutils.pm:1.137 Wed Apr 25 21:05:30 2012
+++ loncom/interface/lonuserutils.pm Wed Apr 25 21:22:01 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.137 2012/04/25 21:05:30 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.138 2012/04/25 21:22:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,8 +47,7 @@
# this one. If $csec is defined, drop them from all other sections of
# this course and add them to section $csec
my ($cnum,$cdom) = &get_course_identity($courseid);
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %roles = &Apache::lonnet::dump('roles',$udom,$unam,'.',undef,$extra);
+ my %roles = &Apache::lonnet::dump('roles',$udom,$unam);
my ($tmp) = keys(%roles);
# Bail out if we were unable to get the students roles
return "$1" if ($tmp =~ /^(con_lost|error|no_such_host)/i);
@@ -1423,7 +1422,7 @@
my ($crstype) = @_;
my %returnhash=();
my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %rolehash=&Apache::lonnet::dump('roles',undef,undef,'.',undef,$extra);
+ my %rolehash=&Apache::lonnet::dump('roles');
foreach my $key (keys(%rolehash)) {
if ($key=~/^rolesdef\_(\w+)$/) {
if ($crstype eq 'Community') {
Index: loncom/interface/longroup.pm
diff -u loncom/interface/longroup.pm:1.27 loncom/interface/longroup.pm:1.28
--- loncom/interface/longroup.pm:1.27 Sat Nov 13 04:45:17 2010
+++ loncom/interface/longroup.pm Wed Apr 25 21:22:02 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# accessor routines used to provide information about course groups
#
-# $Id: longroup.pm,v 1.27 2010/11/13 04:45:17 raeburn Exp $
+# $Id: longroup.pm,v 1.28 2012/04/25 21:22:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -291,8 +291,7 @@
}
if (@changegroups > 0) {
my %currpriv;
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,$cid,undef,$extra);
+ my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,$cid);
if (my $tmp = &Apache::lonnet::error(%roleshash)) {
&Apache::lonnet::logthis('Error retrieving roles: '.$tmp.
' for '.$uname.':'.$udom);
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1165 loncom/lonnet/perl/lonnet.pm:1.1166
--- loncom/lonnet/perl/lonnet.pm:1.1165 Tue Apr 24 20:31:59 2012
+++ loncom/lonnet/perl/lonnet.pm Wed Apr 25 21:22:15 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1165 2012/04/24 20:31:59 droeschl Exp $
+# $Id: lonnet.pm,v 1.1166 2012/04/25 21:22:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2155,8 +2155,7 @@
# If there is a role which has expired, return it.
#
$courseid = &courseid_to_courseurl($courseid);
- my $extra = &freeze_escape({'skipcheck' => 1});
- my %roleshash = &dump('roles',$udom,$unam,$courseid,undef,$extra);
+ my %roleshash = &dump('roles',$udom,$unam,$courseid);
foreach my $key (keys(%roleshash)) {
next if ($key !~/^\Q$courseid\E(?:\/)*(\w+)*\_st$/);
my $section=$1;
@@ -3620,8 +3619,7 @@
unless (defined($udom)) { $udom=$env{'user.domain'}; }
my (%dumphash,%nothide);
if ($context eq 'userroles') {
- my $extra = &freeze_escape({'skipcheck' => 1});
- %dumphash = &dump('roles',$udom,$uname,'.',undef,$extra);
+ %dumphash = &dump('roles',$udom,$uname);
} else {
%dumphash=
&dump('nohist_userroles',$udom,$uname);
@@ -4649,8 +4647,7 @@
my ($domain,$username,$authhost)=@_;
my $now=time;
my %userroles = ('user.login.time' => $now);
- my $extra = &freeze_escape({'skipcheck' => 1});
- my $rolesdump=reply("dump:$domain:$username:roles:.::$extra",$authhost);
+ my $rolesdump=reply("dump:$domain:$username:roles",$authhost);
if (($rolesdump eq 'con_lost') || ($rolesdump eq '') ||
($rolesdump =~ /^error:/)) {
return \%userroles;
@@ -5070,7 +5067,7 @@
# -------------------------------------------------------------- dump interface
sub dump {
- my ($namespace,$udomain,$uname,$regexp,$range,$extra)=@_;
+ my ($namespace,$udomain,$uname,$regexp,$range)=@_;
if (!$udomain) { $udomain=$env{'user.domain'}; }
if (!$uname) { $uname=$env{'user.name'}; }
my $uhome=&homeserver($uname,$udomain);
@@ -5079,7 +5076,7 @@
} else {
$regexp='.';
}
- my $rep=&reply("dump:$udomain:$uname:$namespace:$regexp:$range:$extra",$uhome);
+ my $rep=&reply("dump:$udomain:$uname:$namespace:$regexp:$range",$uhome);
my @pairs=split(/\&/,$rep);
my %returnhash=();
if (!($rep =~ /^error/ )) {
@@ -7289,8 +7286,7 @@
} else {
$grouplist = '';
my $courseurl = &courseid_to_courseurl($courseid);
- my $extra = &freeze_escape({'skipcheck' => 1});
- my %roleshash = &dump('roles',$udom,$uname,$courseurl,undef,$extra);
+ my %roleshash = &dump('roles',$udom,$uname,$courseurl);
my $access_end = $env{'course.'.$courseid.
'.default_enrollment_end_date'};
my $now = time;
Index: loncom/lond
diff -u loncom/lond:1.490 loncom/lond:1.491
--- loncom/lond:1.490 Wed Apr 11 21:32:28 2012
+++ loncom/lond Wed Apr 25 21:22:28 2012
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.490 2012/04/11 21:32:28 droeschl Exp $
+# $Id: lond,v 1.491 2012/04/25 21:22:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,7 +61,7 @@
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.490 $'; #' stupid emacs
+my $VERSION='$Revision: 1.491 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -3249,9 +3249,6 @@
# range - optional range of entries
# e.g., 10-20 would return the
# 10th to 19th items, etc.
-# extra - optional ref to hash of
-# additional args. currently
-# skipcheck is only key used.
# $client - Channel open on the client.
# Returns:
# 1 - Continue processing.
@@ -3273,7 +3270,7 @@
my $userinput = "$cmd:$tail";
- my ($udom,$uname,$namespace,$regexp,$range,$extra)=split(/:/,$tail);
+ my ($udom,$uname,$namespace,$regexp,$range)=split(/:/,$tail);
if (defined($regexp)) {
$regexp=&unescape($regexp);
} else {
@@ -3291,21 +3288,16 @@
}
my $hashref = &tie_user_hash($udom, $uname, $namespace,
&GDBM_READER());
- my $skipcheck;
if ($hashref) {
my $qresult='';
my $count=0;
#
# When dump is for roles.db, determine if LON-CAPA version checking is needed.
-# Sessions on 2.10 and later will include skipcheck => 1 in extra args ref,
-# to indicate no version checking is needed (in this case, checking occurs
+# Sessions on 2.10 and later do not require version checking, as that occurs
# on the server hosting the user session, when constructing the roles/courses
# screen).
-#
- if ($extra ne '') {
- $extra = &Apache::lonnet::thaw_unescape($extra);
- $skipcheck = $extra->{'skipcheck'};
- }
+#
+ my $skipcheck;
my @ids = &Apache::lonnet::current_machine_ids();
my (%homecourses,$major,$minor,$now);
#
@@ -3315,7 +3307,7 @@
# connection. For LON-CAPA 2.8 and older, the version is retrieved from
# the global %loncaparevs in lonnet.pm.
#
- if (($namespace eq 'roles') && (!$skipcheck)) {
+ if ($namespace eq 'roles') {
my $loncaparev = $clientversion;
if ($loncaparev eq '') {
$loncaparev = $Apache::lonnet::loncaparevs{$clientname};
@@ -3324,16 +3316,18 @@
$major = $1;
$minor = $2;
}
+ if (($major > 2) || (($major == 2) && ($minor > 9))) {
+ $skipcheck = 1;
+ }
$now = time;
}
while (my ($key,$value) = each(%$hashref)) {
- if ($namespace eq 'roles') {
+ if (($namespace eq 'roles') && (!$skipcheck)) {
if ($key =~ m{^/($LONCAPA::match_domain)/($LONCAPA::match_courseid)(/?[^_]*)_(cc|co|in|ta|ep|ad|st|cr)$}) {
my $cdom = $1;
my $cnum = $2;
- unless ($skipcheck) {
- my ($role,$roleend,$rolestart) = split(/\_/,$value);
- if (!$roleend || $roleend > $now) {
+ my ($role,$roleend,$rolestart) = split(/\_/,$value);
+ if (!$roleend || $roleend > $now) {
#
# For active course roles, check that requesting server is running a LON-CAPA
# version which meets any version requirements for the course. Do not include
@@ -3344,9 +3338,8 @@
# homeserver is the current server, or whether it is a different server.
# In both cases, the course's version requirement needs to be retrieved.
#
- next unless (&releasereqd_check($cnum,$cdom,$key,$value,$major,
- $minor,\%homecourses,\@ids));
- }
+ next unless (&releasereqd_check($cnum,$cdom,$key,$value,$major,
+ $minor,\%homecourses,\@ids));
}
}
}
More information about the LON-CAPA-cvs
mailing list