--- loncom/interface/loncreateuser.pm 2012/08/14 15:45:06 1.362
+++ loncom/interface/loncreateuser.pm 2013/02/06 16:10:27 1.373
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.362 2012/08/14 15:45:06 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.373 2013/02/06 16:10:27 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -111,11 +111,11 @@ sub initialize_authen_forms {
sub auth_abbrev {
my %abv_auth = (
- krb5 => 'krb',
- krb4 => 'krb',
- internal => 'int',
- localuth => 'loc',
- unix => 'fsys',
+ krb5 => 'krb',
+ krb4 => 'krb',
+ internal => 'int',
+ localauth => 'loc',
+ unix => 'fsys',
);
return %abv_auth;
}
@@ -1651,7 +1651,7 @@ sub display_existing_roles {
$allowed=1;
}
unless ($allowed) {
- my $isowner = &is_courseowner($cid,$coursedata{'internal.courseowner'});
+ my $isowner = &Apache::lonuserutils::is_courseowner($cid,$coursedata{'internal.courseowner'});
if ($isowner) {
if (($role_code eq 'co') && ($class eq 'Community')) {
$allowed = 1;
@@ -1672,7 +1672,7 @@ sub display_existing_roles {
}
}
if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) {
- $carea.='
Section: '.$3;
+ $carea.='
'.&mt('Section: [_1]',$3);
$sortkey.="\0$3";
if (!$allowed) {
if ($env{'request.course.sec'} eq $3) {
@@ -1701,7 +1701,7 @@ sub display_existing_roles {
$allowed=1;
}
}
- if ($role_code eq 'ca' || $role_code eq 'au') {
+ if ($role_code eq 'ca' || $role_code eq 'au' || $role_code eq 'aa') {
$class='Construction Space';
} elsif ($role_code eq 'su') {
$class='System';
@@ -2432,13 +2432,14 @@ sub update_user_data {
# If they are creating a new user but have not specified login
# information this will be caught below.
} else {
- $r->print($error.&mt('Invalid login mode or password').$end.$rtnlink);
- return;
+ $r->print($error.&mt('Invalid login mode or password').$end.$rtnlink);
+ return;
}
$r->print('
'.&mt('Please be patient').'
'); + $env{'form.ccuname'}.' ('.&Apache::loncommon::plainname($env{'form.ccuname'}, + $env{'form.ccdomain'}).')', $env{'form.ccdomain'}).''); + my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,2); my (%alerts,%rulematch,%inst_results,%curr_rules); my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); @@ -2499,6 +2500,7 @@ sub update_user_data { } } } + &Apache::lonhtmlcommon::Increment_PrgWin($r, \%prog_state); # Call modifyuser my $result = &Apache::lonnet::modifyuser ($env{'form.ccdomain'},$env{'form.ccuname'},$env{'form.cid'}, @@ -2588,9 +2590,8 @@ sub update_user_data { $r->print($error.&mt('You do not have the authority to modify this users authentification information').'.'.$end); } } - $r->rflush(); # Finish display of header before time consuming actions start - + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state); ## my (@userroles,%userupdate,$cnum,$cdom,%namechanged); if ($context eq 'course') { @@ -2902,7 +2903,8 @@ sub update_user_data { $changeHash{'tools.'.$key}; } else { $newenvhash{'environment.availabletools.'.$key} = - &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, $key,'reload','tools'); + &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, + $key,'reload','tools'); } } } @@ -3005,6 +3007,7 @@ sub update_user_data { .&Apache::lonuserutils::print_namespacing_alerts($env{'form.ccdomain'},\%alerts,\%curr_rules) .''); } + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); if ($env{'form.action'} eq 'singlestudent') { &enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context,$crstype); $r->print('');
@@ -3036,10 +3039,9 @@ sub update_user_data {
if ($env{'form.popup'}) {
$r->print('');
} else {
- $r->print(' '
- .&mt('Modify this user: [_1]',''.$env{'form.ccuname'}.':'.$env{'form.ccdomain'}.' ('.$userinfo.')').''
- .(' 'x5).''
- .&mt('Create/Modify Another User').'
'.&Apache::lonhtmlcommon::actionbox([''
+ .&mt('Modify this user: [_1]',''.$env{'form.ccuname'}.':'.$env{'form.ccdomain'}.' ('.$userinfo.')').'',
+ ''.&mt('Create/Modify Another User').'']));
}
}
}
@@ -3060,7 +3062,7 @@ sub display_userinfo {
ref($newsetting) eq 'HASH' &&
ref($newsettingtext) eq 'HASH');
my %lt=&Apache::lonlocal::texthash(
- 'ui' => 'User Information (unchanged)',
+ 'ui' => 'User Information',
'uic' => 'User Information Changed',
'firstname' => 'First Name',
'middlename' => 'Middle Name',
@@ -3081,73 +3083,37 @@ sub display_userinfo {
'prvs' => 'Previous Value:',
'chto' => 'Changed To:'
);
- my $title = $lt{'ui'};
- if ($changed) {
- $title = $lt{'uic'};
- }
- $r->print('
'.&mt('No changes made to user information').'
'); } - $r->print(&Apache::loncommon::end_data_table().''.&mt('No roles to modify').'
'); } return @rolechanges; } @@ -3692,7 +3697,7 @@ sub get_defaultquota_text { sub update_result_form { my ($uhome) = @_; my $outcome = - ''."\n"; + '