version 1.406.2.3, 2016/09/18 18:10:54
|
version 1.409, 2016/02/19 02:39:07
|
Line 813 sub entry_form {
|
Line 813 sub entry_form {
|
} |
} |
my $cancreate = |
my $cancreate = |
&Apache::lonuserutils::can_create_user($dom,$context,$usertype); |
&Apache::lonuserutils::can_create_user($dom,$context,$usertype); |
my ($userpicker,$cansearch) = |
my $userpicker = |
&Apache::loncommon::user_picker($dom,$srch,$forcenewuser, |
&Apache::loncommon::user_picker($dom,$srch,$forcenewuser, |
'document.crtuser',$cancreate,$usertype); |
'document.crtuser',$cancreate,$usertype); |
my $srchbutton = &mt('Search'); |
my $srchbutton = &mt('Search'); |
Line 822 sub entry_form {
|
Line 822 sub entry_form {
|
} elsif ($cancreate && $responsemsg ne '' && $inexact) { |
} elsif ($cancreate && $responsemsg ne '' && $inexact) { |
$srchbutton = &mt('Search or Add New User'); |
$srchbutton = &mt('Search or Add New User'); |
} |
} |
my $output; |
my $output = <<"ENDBLOCK"; |
if ($cansearch) { |
|
$output = <<"ENDBLOCK"; |
|
<form action="/adm/createuser" method="post" name="crtuser"> |
<form action="/adm/createuser" method="post" name="crtuser"> |
<input type="hidden" name="action" value="$env{'form.action'}" /> |
<input type="hidden" name="action" value="$env{'form.action'}" /> |
<input type="hidden" name="phase" value="get_user_info" /> |
<input type="hidden" name="phase" value="get_user_info" /> |
Line 832 $userpicker
|
Line 830 $userpicker
|
<input name="userrole" type="button" value="$srchbutton" onclick="javascript:validateEntry(document.crtuser)" /> |
<input name="userrole" type="button" value="$srchbutton" onclick="javascript:validateEntry(document.crtuser)" /> |
</form> |
</form> |
ENDBLOCK |
ENDBLOCK |
} else { |
|
$output = '<p>'.$userpicker.'</p>'; |
|
} |
|
if ($env{'form.phase'} eq '') { |
if ($env{'form.phase'} eq '') { |
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); |
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); |
Line 2169 sub modify_login_block {
|
Line 2164 sub modify_login_block {
|
|
|
sub personal_data_display { |
sub personal_data_display { |
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray, |
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray, |
$now,$captchaform,$emailusername,$usertype) = @_; |
$now,$captchaform,$emailusername,$usertype,$recaptchaversion) = @_; |
my ($output,%userenv,%canmodify,%canmodify_status); |
my ($output,%userenv,%canmodify,%canmodify_status); |
my @userinfo = ('firstname','middlename','lastname','generation', |
my @userinfo = ('firstname','middlename','lastname','generation', |
'permanentemail','id'); |
'permanentemail','id'); |
Line 2356 sub personal_data_display {
|
Line 2351 sub personal_data_display {
|
} |
} |
if (($context eq 'selfcreate') && ($newuser eq 'email')) { |
if (($context eq 'selfcreate') && ($newuser eq 'email')) { |
if ($captchaform) { |
if ($captchaform) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'valid'}.'*', |
$output .= &Apache::lonhtmlcommon::row_title($lt{'valid'}, |
'LC_pick_box_title')."\n". |
'LC_pick_box_title')."\n"; |
$captchaform."\n".'<br /><br />'. |
if ($recaptchaversion >=2) { |
|
$output .= '<script src="https://www.google.com/recaptcha/api.js"></script>'."\n"; |
|
} |
|
$output .= $captchaform."\n".'<br /><br />'. |
&Apache::lonhtmlcommon::row_closure(1); |
&Apache::lonhtmlcommon::row_closure(1); |
$rowcount ++; |
$rowcount ++; |
} |
} |
Line 3115 sub update_user_data {
|
Line 3113 sub update_user_data {
|
\%newsettingstext); |
\%newsettingstext); |
if ($env{'form.cid'} ne $userenv{'id'}) { |
if ($env{'form.cid'} ne $userenv{'id'}) { |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
($env{'form.ccuname'} => $env{'form.cid'})); |
{$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids'); |
if (($recurseid) && |
if (($recurseid) && |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
my $idresult = |
my $idresult = |
Line 6831 sub user_search_result {
|
Line 6829 sub user_search_result {
|
$response = '<span class="LC_warning">'.$response.'</span>'; |
$response = '<span class="LC_warning">'.$response.'</span>'; |
} |
} |
if ($srch->{'srchin'} eq 'instd') { |
if ($srch->{'srchin'} eq 'instd') { |
my $instd_chk = &instdirectorysrch_check($srch); |
my $instd_chk = &directorysrch_check($srch); |
if ($instd_chk ne 'ok') { |
if ($instd_chk ne 'ok') { |
my $domd_chk = &domdirectorysrch_check($srch); |
$response = '<span class="LC_warning">'.$instd_chk.'</span>'. |
$response = '<span class="LC_warning">'.$instd_chk.'</span><br />'; |
'<br />'.&mt('You may want to search in the LON-CAPA domain instead of the institutional directory.').'<br /><br />'; |
if ($domd_chk eq 'ok') { |
|
$response = &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'); |
|
} |
|
$response .= '<br /><br />'; |
|
} |
|
} else { |
|
unless (($context eq 'requestcrs') && ($srch->{'srchtype'} eq 'exact')) { |
|
my $domd_chk = &domdirectorysrch_check($srch); |
|
if ($domd_chk ne 'ok') { |
|
my $instd_chk = &instdirectorysrch_check($srch); |
|
$response = '<span class="LC_warning">'.$domd_chk.'</span><br />'; |
|
if ($instd_chk eq 'ok') { |
|
$response = &mt('You may want to search in the institutional directory instead of the LON-CAPA domain.'); |
|
} |
|
$response .= '<br /><br />'; |
|
} |
|
} |
} |
} |
} |
if ($response ne '') { |
if ($response ne '') { |
Line 7025 sub user_search_result {
|
Line 7007 sub user_search_result {
|
return ($currstate,$response,$forcenewuser,\%srch_results); |
return ($currstate,$response,$forcenewuser,\%srch_results); |
} |
} |
|
|
sub domdirectorysrch_check { |
sub directorysrch_check { |
my ($srch) = @_; |
|
my $response; |
|
my %dom_inst_srch = &Apache::lonnet::get_dom('configuration', |
|
['directorysrch'],$srch->{'srchdomain'}); |
|
my $showdom = &display_domain_info($srch->{'srchdomain'}); |
|
if (ref($dom_inst_srch{'directorysrch'}) eq 'HASH') { |
|
if ($dom_inst_srch{'directorysrch'}{'lcavailable'} eq '0') { |
|
return &mt('LON-CAPA directory search is not available in domain: [_1]',$showdom); |
|
} |
|
if ($dom_inst_srch{'directorysrch'}{'lclocalonly'}) { |
|
if ($env{'request.role.domain'} ne $srch->{'srchdomain'}) { |
|
return &mt('LON-CAPA directory search in domain: [_1] is only allowed for users with a current role in the domain.',$showdom); |
|
} |
|
} |
|
} |
|
return 'ok'; |
|
} |
|
|
|
sub instdirectorysrch_check { |
|
my ($srch) = @_; |
my ($srch) = @_; |
my $can_search = 0; |
my $can_search = 0; |
my $response; |
my $response; |