--- loncom/auth/lonroles.pm 2008/01/26 21:12:32 1.182
+++ loncom/auth/lonroles.pm 2008/03/04 22:44:21 1.184
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.182 2008/01/26 21:12:32 www Exp $
+# $Id: lonroles.pm,v 1.184 2008/03/04 22:44:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -134,10 +134,12 @@ sub handler {
last;
}
# Is this a recent ad-hoc CA-role?
- if (my ($domain,$coursenum) =
- ($envkey =~ m-^form\.ca\./($match_domain)/($match_courseid)$-)) {
- if ($dcroles{$domain}) {
- &check_privs($domain,$coursenum,$then,$now,'ca');
+ if (my ($domain,$user) =
+ ($envkey =~ m-^form\.ca\./($match_domain)/($match_username)$-)) {
+ if (($dcroles{$domain}) && (&is_author_homeserver($user,$domain))) {
+ &check_privs($domain,$user,$then,$now,'ca');
+ } else {
+ delete($env{$envkey});
}
last;
}
@@ -147,7 +149,7 @@ sub handler {
if ($dcroles{$domain}) {
my $user=$env{'form.adhoccauname.'.$domain};
if (!$user) { $user=$env{'form.adhoccaunamerecent.'.$domain} };
- if (($user) && ($user=~/$match_username/)) {
+ if (($user) && ($user=~/$match_username/) && (&is_author_homeserver($user,$domain))) {
&check_privs($domain,$user,$then,$now,'ca');
$env{'form.ca./'.$domain.'/'.$user}=1;
}
@@ -387,7 +389,7 @@ ENDENTERKEY
my $start_page=&Apache::loncommon::start_page('User Roles');
my $standby=&mt('Role selected. Please stand by.');
$standby=~s/\n/\\n/g;
- my $noscript=''.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will ba unavailable.').'
';
+ my $noscript=''.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will be unavailable.').'
';
$r->print(< "Please use the 'Select Course' link to open a separate pick course window where you may select the course you wish to enter.",
+ youc => 'You can only use this screen to select courses in the current domain.',
+ );
my $verify_script = <<"END";