--- loncom/interface/loncreateuser.pm 2010/08/20 04:19:38 1.295.2.35
+++ loncom/interface/loncreateuser.pm 2009/11/28 21:33:53 1.329
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.295.2.35 2010/08/20 04:19:38 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.329 2009/11/28 21:33:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -219,7 +219,7 @@ END_SCRIPT
sub build_tools_display {
my ($ccuname,$ccdomain,$context) = @_;
my (@usertools,%userenv,$output,@options,%validations,%reqtitles,%reqdisplay,
- $colspan,$isadv,%domconfig);
+ $colspan);
my %lt = &Apache::lonlocal::texthash (
'blog' => "Personal User Blog",
'aboutme' => "Personal Information Page",
@@ -243,9 +243,6 @@ sub build_tools_display {
%reqtitles = &courserequest_titles();
%reqdisplay = &courserequest_display();
$colspan = ' colspan="2"';
- %domconfig =
- &Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain);
- $isadv = &Apache::lonnet::is_advanced_user($ccuname,$ccdomain);
} else {
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
'tools.aboutme','tools.portfolio','tools.blog');
@@ -292,14 +289,7 @@ sub build_tools_display {
&Apache::loncommon::start_data_table_row()."\n";
if ($context eq 'requestcourses') {
my ($curroption,$currlimit);
- if ($userenv{$context.'.'.$item} ne '') {
- $curroption = $userenv{$context.'.'.$item};
- } else {
- my (@inststatuses);
- $curroption =
- &Apache::loncoursequeueadmin::get_processtype($ccuname,$ccdomain,$isadv,$ccdomain,
- $item,\@inststatuses,\%domconfig);
- }
+ $curroption = $userenv{$context.'.'.$item};
if (!$curroption) {
$curroption = 'norequest';
}
@@ -685,7 +675,7 @@ ENDBLOCK
);
my $sellink=&Apache::loncommon::selectstudent_link('crtusername','srchterm','srchdomain');
my ($title,$buttontext,$showresponse);
- if ($env{'form.action'} eq 'singlestudent') {
+ if ($env{'form.action'} eq 'singlestudent') {
if ($crstype eq 'Community') {
$title = $lt{'enrm'};
} else {
@@ -945,7 +935,7 @@ sub print_user_modification_page {
);
my $response;
if ($env{'form.origform'} eq 'crtusername') {
- $response = ''.&mt('No match found for the username [_1] in LON-CAPA domain: [_2]',''.$ccuname.'',$ccdomain).
+ $response = ''.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).
' '
@@ -1053,8 +1043,8 @@ ENDFORMINFO
}
} else {
foreach my $key (keys(%env)) {
- if ($key=~/^user\.priv\.cm\.\/($match_domain)\/($match_username)/) {
- $inccourses{$1.'_'.$2}=1;
+ if ($key=~/^user\.priv\.cm\.\/($match_domain)\/($match_username)/) {
+ $inccourses{$1.'_'.$2}=1;
}
}
}
@@ -1428,7 +1418,7 @@ sub display_existing_roles {
my (%rolesdump,%roletext,%sortrole,%roleclass,%rolepriv);
if ($context eq 'course' || $context eq 'author') {
my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype);
- my %roleshash =
+ my %roleshash =
&Apache::lonnet::get_my_roles($ccuname,$ccdomain,'userroles',
['active','previous','future'],\@roles,$roledom,1);
foreach my $key (keys(%roleshash)) {
@@ -1455,8 +1445,6 @@ sub display_existing_roles {
$newkey .= '_'.$newrole;
if ($start ne '' && $end ne '') {
$newvalue .= '_'.$end.'_'.$start;
- } elsif ($end ne '') {
- $newvalue .= '_'.$end;
}
$rolesdump{$newkey} = $newvalue;
}
@@ -1499,7 +1487,7 @@ sub display_existing_roles {
if (defined($coursedata{'description'})) {
$carea=$coursedata{'description'}.
'
';
}
$response .= '
'.&mt('Domain').': '.$coursedom.(' 'x8).
- &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$coursedir,$coursedom);
+ &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$coursedir,$coursedom);
$sortkey.="\0".$coursedata{'description'};
} else {
if ($class eq 'Community') {
@@ -1525,10 +1513,10 @@ sub display_existing_roles {
$allowed = 1;
}
}
- }
+ }
if ((&Apache::lonnet::allowed('dro',$coursedom)) ||
(&Apache::lonnet::allowed('dro',$ccdomain))) {
- $delallowed=1;
+ $delallowed=1;
}
# - custom role. Needs more info, too
if ($croletitle) {
@@ -1541,11 +1529,11 @@ sub display_existing_roles {
$carea.='
Section: '.$3;
$sortkey.="\0$3";
if (!$allowed) {
- if ($env{'request.course.sec'} eq $3) {
- if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2.'/'.$3)) {
- $allowed = 1;
- }
- }
+ if ($env{'request.course.sec'} eq $3) {
+ if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2.'/'.$3)) {
+ $allowed = 1;
+ }
+ }
}
}
$area=$carea;
@@ -1554,8 +1542,8 @@ sub display_existing_roles {
# Determine if current user is able to revoke privileges
if ($area=~m{^/($match_domain)/}) {
if ((&Apache::lonnet::allowed('c'.$role_code,$1)) ||
- (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) {
- $allowed=1;
+ (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) {
+ $allowed=1;
}
if (((&Apache::lonnet::allowed('dro',$1)) ||
(&Apache::lonnet::allowed('dro',$ccdomain))) &&
@@ -1613,16 +1601,13 @@ sub display_existing_roles {
$plaintext=&Apache::lonnet::plaintext($role_code,$class)
} else {
$plaintext=
- &mt('Customrole [_1][_2]defined by [_3]',
- '"'.$croletitle.'"',
- '
',
- $croleuname.':'.$croleudom);
+ "Customrole '$croletitle'
defined by $croleuname\@$croleudom";
}
$row.= '
'.&mt('Please be patient').'
'); my (%alerts,%rulematch,%inst_results,%curr_rules); - my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); my @usertools = ('aboutme','blog','portfolio'); my @requestcourses = ('official','unofficial','community'); my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); - my %canmodify_status = - &Apache::lonuserutils::can_modify_userinfo($context,$env{'form.ccdomain'}, - ['inststatus']); if ($env{'form.makeuser'}) { $r->print(''.&mt('After:'). - ' | '.$startform.' |
'.&mt('Before:').' | '. - $endform.' |
'.&mt('After:'). + ' | '.$startform.' |
'.&mt('Before:').' | '. + ''.$endform.' |