--- loncom/interface/loncreateuser.pm 2014/03/03 17:11:41 1.396
+++ loncom/interface/loncreateuser.pm 2016/02/19 02:39:07 1.409
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.396 2014/03/03 17:11:41 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.409 2016/02/19 02:39:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2164,7 +2164,7 @@ sub modify_login_block {
sub personal_data_display {
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,
- $now,$captchaform,$emailusername,$usertype) = @_;
+ $now,$captchaform,$emailusername,$usertype,$recaptchaversion) = @_;
my ($output,%userenv,%canmodify,%canmodify_status);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
@@ -2244,8 +2244,8 @@ sub personal_data_display {
'';
$rowcount ++;
$output .= &Apache::lonhtmlcommon::row_closure(1);
- my $upassone = '';
- my $upasstwo = '';
+ my $upassone = '';
+ my $upasstwo = '';
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'*',
'LC_pick_box_title',
'LC_oddrow_value')."\n".
@@ -2282,19 +2282,15 @@ sub personal_data_display {
}
} else {
if ($context eq 'selfcreate') {
- if (($item eq 'permanentemail') && ($newuser eq 'email')) {
- $row .= $ccuname;
- } else {
- if ($canmodify{$item}) {
- if ($newuser eq 'email') {
- $row .= '';
- } else {
- $row .= '';
- }
- $editable ++;
+ if ($canmodify{$item}) {
+ if ($newuser eq 'email') {
+ $row .= '';
} else {
- $hiderow = 1;
+ $row .= '';
}
+ $editable ++;
+ } else {
+ $hiderow = 1;
}
} else {
$row .= '';
@@ -2356,8 +2352,11 @@ sub personal_data_display {
if (($context eq 'selfcreate') && ($newuser eq 'email')) {
if ($captchaform) {
$output .= &Apache::lonhtmlcommon::row_title($lt{'valid'},
- 'LC_pick_box_title')."\n".
- $captchaform."\n".'
'.
+ 'LC_pick_box_title')."\n";
+ if ($recaptchaversion >=2) {
+ $output .= ''."\n";
+ }
+ $output .= $captchaform."\n".'
'.
&Apache::lonhtmlcommon::row_closure(1);
$rowcount ++;
}
@@ -3048,7 +3047,7 @@ sub update_user_data {
my %newenvhash;
foreach my $key (keys(%changed)) {
if (($key eq 'official') || ($key eq 'unofficial')
- || ($key eq 'community')) {
+ || ($key eq 'community') || ($key eq 'textbook')) {
$newenvhash{'environment.requestcourses.'.$key} =
$changeHash{'requestcourses.'.$key};
if ($changeHash{'requestcourses.'.$key}) {
@@ -3114,7 +3113,7 @@ sub update_user_data {
\%newsettingstext);
if ($env{'form.cid'} ne $userenv{'id'}) {
&Apache::lonnet::idput($env{'form.ccdomain'},
- ($env{'form.ccuname'} => $env{'form.cid'}));
+ {$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids');
if (($recurseid) &&
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
my $idresult =
@@ -3156,9 +3155,9 @@ sub update_user_data {
$rolestr = &mt('No roles');
}
if ($context eq 'course') {
- $contextname = &mt('course');
+ $contextname = 'course';
} elsif ($context eq 'author') {
- $contextname = &mt('co-author');
+ $contextname = 'co-author';
}
$r->print(&mt('The following fields were not updated: ').'
'.$visactions->{'vis'}.'
'; + + my $visactions = &cat_visibility(); + my ($cathash,%cattype); + my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); + if (ref($domconfig{'coursecategories'}) eq 'HASH') { + $cathash = $domconfig{'coursecategories'}{'cats'}; + $cattype{'auth'} = $domconfig{'coursecategories'}{'auth'}; + $cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'}; + if ($cattype{'auth'} eq '') { + $cattype{'auth'} = 'std'; + } + if ($cattype{'unauth'} eq '') { + $cattype{'unauth'} = 'std'; + } + } else { + $cathash = {}; + $cattype{'auth'} = 'std'; + $cattype{'unauth'} = 'std'; + } + if (($cattype{'auth'} eq 'none') && ($cattype{'unauth'} eq 'none')) { + $r->print(''.$visactions->{'miss'}.'
' - .$visactions->{'yous'}. - ''.$visactions->{'gen'}.'
'.$visactions->{'coca'};
- if (ref($vismsgs) eq 'ARRAY') {
- $output .= '
'.$visactions->{'make'}.'
'.$visactions->{'vis'}.'
'; + } else { + $output .= ''.$visactions->{'miss'}.'
' + .$visactions->{'yous'}. + ''.$visactions->{'gen'}.'
'.$visactions->{'coca'};
+ if (ref($vismsgs) eq 'ARRAY') {
+ $output .= '
'.$visactions->{'make'}.'