[LON-CAPA-cvs] cvs: loncom(version_2_8_X) /lonnet/perl lonnet.pm
raeburn
raeburn@source.lon-capa.org
Thu, 18 Dec 2008 17:43:53 -0000
raeburn Thu Dec 18 17:43:53 2008 EDT
Modified files: (Branch: version_2_8_X)
/loncom/lonnet/perl lonnet.pm
Log:
- Backport 1.978.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.976 loncom/lonnet/perl/lonnet.pm:1.976.2.1
--- loncom/lonnet/perl/lonnet.pm:1.976 Mon Dec 8 23:00:47 2008
+++ loncom/lonnet/perl/lonnet.pm Thu Dec 18 17:43:53 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.976 2008/12/08 23:00:47 raeburn Exp $
+# $Id: lonnet.pm,v 1.976.2.1 2008/12/18 17:43:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4375,7 +4375,7 @@
}
sub usertools_access {
- my ($uname,$udom,$tool) = @_;
+ my ($uname,$udom,$tool,$action) = @_;
my $access;
my %tools = (
aboutme => 1,
@@ -4389,10 +4389,10 @@
$uname = $env{'user.name'};
}
- my $hashid=$uname.':'.$udom;
- my ($result,$cached) = &is_cached_new('usertools.'.$tool,$hashid);
- if (defined($cached)) {
- return $result;
+ if (($udom eq $env{'user.domain'}) && ($uname eq $env{'user.name'})) {
+ if ($action ne 'reload') {
+ return $env{'environment.availabletools.'.$tool};
+ }
}
my ($toolstatus,$inststatus);
@@ -4412,7 +4412,6 @@
} else {
$access = 0;
}
- &do_cache_new('usertools.'.$tool,$hashid,$access,600);
return $access;
}
@@ -4426,7 +4425,6 @@
} else {
$access = 0;
}
- &do_cache_new('usertools.'.$tool,$hashid,$access,600);
return $access;
}
}
@@ -4447,7 +4445,6 @@
} elsif ($hasnoaccess) {
$access = 0;
}
- &do_cache_new('usertools.'.$tool,$hashid,$access,600);
return $access;
}
} else {
@@ -4457,13 +4454,11 @@
} elsif ($domdef{$tool}{'default'} == 0) {
$access = 0;
}
- &do_cache_new('usertools.'.$tool,$hashid,$access,600);
return $access;
}
}
} else {
$access = 1;
- &do_cache_new('usertools.'.$tool,$hashid,$access,600);
return $access;
}
}