version 1.153, 2006/06/02 13:58:37
|
version 1.159, 2006/06/26 18:56:37
|
Line 88 sub error_page {
|
Line 88 sub error_page {
|
&Apache::lonmenu::rawconfig().'</script>'. |
&Apache::lonmenu::rawconfig().'</script>'. |
'<p>'.&mt('The following problems occurred:'). |
'<p>'.&mt('The following problems occurred:'). |
$error. |
$error. |
'</p><br /><a href="'.$dest.'>'.&mt('Continue').'</a>'. |
'</p><br /><a href="'.$dest.'">'.&mt('Continue').'</a>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 149 sub handler {
|
Line 149 sub handler {
|
|
|
# store role if recent_role list being kept |
# store role if recent_role list being kept |
if ($env{'environment.recentroles'}) { |
if ($env{'environment.recentroles'}) { |
|
my %frozen_roles = |
|
&Apache::lonhtmlcommon::get_recent_frozen('roles',$env{'environment.recentrolesn'}); |
&Apache::lonhtmlcommon::store_recent('roles', |
&Apache::lonhtmlcommon::store_recent('roles', |
$trolecode,' '); |
$trolecode,' ',$frozen_roles{$trolecode}); |
} |
} |
|
|
|
|
Line 265 ENDENTERKEY
|
Line 267 ENDENTERKEY
|
return OK; |
return OK; |
} else { |
} else { |
my $type = 'Course/Group'; |
my $type = 'Course/Group'; |
if ($env{'request.course.id'}) { |
if (!$env{'request.course.id'}) { |
if (defined($env{'course.'. |
$type = &Apache::loncommon::course_type(); |
$env{'request.course.id'}.'.type'})) { |
|
$type = $env{'course.'. |
|
$env{'request.course.id'}.'.type'}; |
|
} |
|
&Apache::lonnet::appenv( |
&Apache::lonnet::appenv( |
"request.course.id" => $cdom.'_'.$cnum); |
"request.course.id" => $cdom.'_'.$cnum); |
$furl='/adm/roles?tryagain=1'; |
$furl='/adm/roles?tryagain=1'; |
$msg= |
$msg= |
'<h1><font color="red">'. |
'<h1><span class="LC_error">'. |
&mt('Could not initialize [_1] at this time.',lc($type)). |
&mt('Could not initialize '.lc($type).' at this time.'). |
'</font></h1><h3>'.&mt('Please try again.').'</h3>'.$ferr; |
'</span></h1><h3>'.&mt('Please try again.').'</h3>'.$ferr; |
} |
} |
if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; } |
if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; } |
&Apache::lonnet::appenv('request.role.adv'=>$tadv); |
&Apache::lonnet::appenv('request.role.adv'=>$tadv); |
Line 305 ENDENTERKEY
|
Line 303 ENDENTERKEY
|
) { |
) { |
my $startpage = &courseloadpage($courseid); |
my $startpage = &courseloadpage($courseid); |
unless ($startpage eq 'firstres') { |
unless ($startpage eq 'firstres') { |
$msg = &mt('Entering [_1] ....',lc($type)); |
$msg = &mt('Entering '.lc($type).' ....'); |
&redirect_user($r,&mt('New in course'), |
&redirect_user($r,&mt('New in course'), |
'/adm/whatsnew?refpage=start',$msg, |
'/adm/whatsnew?refpage=start',$msg, |
$env{'environment.remotenavmap'}); |
$env{'environment.remotenavmap'}); |
Line 318 ENDENTERKEY
|
Line 316 ENDENTERKEY
|
# Guess not ... |
# Guess not ... |
$furl=&Apache::lonpageflip::first_accessible_resource(); |
$furl=&Apache::lonpageflip::first_accessible_resource(); |
} |
} |
$msg = &mt('Entering [_1] ...',lc($type)); |
$msg = &mt('Entering '.lc($type).' ...'); |
&redirect_user($r,&mt('Entering [_1]',$type), |
&redirect_user($r,&mt('Entering '.$type), |
$furl,$msg, |
$furl,$msg, |
$env{'environment.remotenavmap'}); |
$env{'environment.remotenavmap'}); |
} |
} |
Line 424 ENDHEADER
|
Line 422 ENDHEADER
|
} else { |
} else { |
if ($env{'user.error.msg'}) { |
if ($env{'user.error.msg'}) { |
$r->print( |
$r->print( |
'<h3><font color="red">'. |
'<h3><span class="LC_error">'. |
&mt('You need to choose another user role or enter a specific course for this function').'</font></h3>'); |
&mt('You need to choose another user role or enter a specific course for this function').'</span></h3>'); |
} |
} |
} |
} |
# -------------------------------------------------------- Choice or no choice? |
# -------------------------------------------------------- Choice or no choice? |
Line 518 ENDHEADER
|
Line 516 ENDHEADER
|
if ($tremark) { $tremark.='<br />'; } |
if ($tremark) { $tremark.='<br />'; } |
$tremark.=&mt('Defined by ').$rauthor. |
$tremark.=&mt('Defined by ').$rauthor. |
&mt(' at ').$rdomain.'.'; |
&mt(' at ').$rdomain.'.'; |
$trole=$rrole; |
} |
} else { |
$trole=Apache::lonnet::plaintext($role); |
$trole=Apache::lonnet::plaintext($role); |
|
} |
|
my $ttype; |
my $ttype; |
my $twhere; |
my $twhere; |
my ($tdom,$trest,$tsection)= |
my ($tdom,$trest,$tsection)= |
Line 745 ENDHEADER
|
Line 741 ENDHEADER
|
$ttype='Construction Space'; |
$ttype='Construction Space'; |
$twhere='User: '.$trest.', Domain: '.$tdom; |
$twhere='User: '.$trest.', Domain: '.$tdom; |
} else { |
} else { |
$ttype='Course'; |
$ttype= |
if (defined($env{'course.'.$tdom.'_'.$trest.'.type'})) { |
&Apache::loncommon::course_type($tdom.'_'.$trest); |
$ttype = $env{'course.'.$tdom.'_'.$trest.'.type'}; |
|
} |
|
$twhere=$env{'course.'.$tdom.'_'.$trest.'.description'}; |
$twhere=$env{'course.'.$tdom.'_'.$trest.'.description'}; |
if ($tsec) { |
if ($tsec) { |
$twhere.=' (Section: '.$tsec.')'; |
$twhere.=' (Section: '.$tsec.')'; |
Line 1037 sub set_privileges {
|
Line 1031 sub set_privileges {
|
my $area = '/'.$dcdom.'/'.$pickedcourse; |
my $area = '/'.$dcdom.'/'.$pickedcourse; |
my $role = 'cc'; |
my $role = 'cc'; |
my $spec = $role.'.'.$area; |
my $spec = $role.'.'.$area; |
my $userroles = &Apache::lonnet::set_arearole($role,$area,'','',$dcdom,$env{'user.name'}); |
my %userroles = &Apache::lonnet::set_arearole($role,$area,'','',$dcdom,$env{'user.name'}); |
my %ccrole = (); |
my %ccrole = (); |
&Apache::lonnet::standard_roleprivs(\%ccrole,$role,$dcdom,$spec,$pickedcourse,$area); |
&Apache::lonnet::standard_roleprivs(\%ccrole,$role,$dcdom,$spec,$pickedcourse,$area); |
my ($author,$adv)= &Apache::lonnet::set_userprivs(\$userroles,\%ccrole); |
my ($author,$adv)= &Apache::lonnet::set_userprivs(\%userroles,\%ccrole); |
my @newprivs = split/\n/,$userroles; |
&Apache::lonnet::appenv(%userroles); |
my %newccroles = (); |
|
foreach (@newprivs) { |
|
my ($key,$val) = split/=/,$_; |
|
$newccroles{$key} = $val; |
|
} |
|
&Apache::lonnet::appenv(%newccroles); |
|
&Apache::lonnet::log($env{'user.domain'}, |
&Apache::lonnet::log($env{'user.domain'}, |
$env{'user.name'}, |
$env{'user.name'}, |
$env{'user.home'}, |
$env{'user.home'}, |