version 1.79, 2019/08/25 02:42:56
|
version 1.83, 2021/09/25 20:35:26
|
Line 570 sub javascript_validmail {
|
Line 570 sub javascript_validmail {
|
my %js_lt = &Apache::lonlocal::texthash ( |
my %js_lt = &Apache::lonlocal::texthash ( |
email => 'The e-mail address you entered', |
email => 'The e-mail address you entered', |
notv => 'is not a valid e-mail address', |
notv => 'is not a valid e-mail address', |
avae => 'A valid e-mail address is not formed when the value you entered', |
avae => 'A valid e-mail address is not formed when the value you entered is combined with the required domain', |
isco => 'is combined with the required domain', |
|
); |
); |
my $output = "\n".'<script type="text/javascript">'."\n". |
my $output = "\n".'<script type="text/javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
Line 583 function validate_email(client) {
|
Line 582 function validate_email(client) {
|
var condition = '$condition'; |
var condition = '$condition'; |
if (validmail(field,condition) == false) { |
if (validmail(field,condition) == false) { |
if ((condition != undefined) && (condition != '')) { |
if ((condition != undefined) && (condition != '')) { |
alert("$js_lt{'avae'}: "+field.value+" $js_lt{'isco'}: "+condition); |
alert("$js_lt{'avae'}: "+condition); |
} else { |
} else { |
alert("$js_lt{'email'}: "+field.value+" $js_lt{'notv'}."); |
alert("$js_lt{'email'}: "+field.value+" $js_lt{'notv'}."); |
} |
} |
Line 983 sub send_token {
|
Line 982 sub send_token {
|
$msg .= '</form></p>'; |
$msg .= '</form></p>'; |
return $msg; |
return $msg; |
} |
} |
my %info = ('ip' => $ENV{'REMOTE_ADDR'}, |
my $ip = &Apache::lonnet::get_requestor_ip(); |
|
my %info = ('ip' => $ip, |
'time' => $now, |
'time' => $now, |
'domain' => $domain, |
'domain' => $domain, |
'username' => $email, |
'username' => $email, |
Line 1099 sub process_mailtoken {
|
Line 1099 sub process_mailtoken {
|
&create_account($r,$domain,$domdesc,\%data); |
&create_account($r,$domain,$domdesc,\%data); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$msg = $output; |
$msg = $output; |
|
my $ip = &Apache::lonnet::get_requestor_ip(); |
my $shownow = &Apache::lonlocal::locallocaltime($now); |
my $shownow = &Apache::lonlocal::locallocaltime($now); |
my $mailmsg = &mt('A LON-CAPA account for the institution: [_1] has been created [_2] from IP address: [_3]. If you did not perform this action or authorize it, please contact the [_4] ([_5]).',$domdesc,$shownow,$ENV{'REMOTE_ADDR'},$contact_name,$contact_email)."\n"; |
my $mailmsg = &mt('A LON-CAPA account for the institution: [_1] has been created [_2] from IP address: [_3]. If you did not perform this action or authorize it, please contact the [_4] ([_5]).',$domdesc,$shownow,$ip,$contact_name,$contact_email)."\n"; |
my $mailresult = &Apache::resetpw::send_mail($domdesc,$data{'email'}, |
my $mailresult = &Apache::resetpw::send_mail($domdesc,$data{'email'}, |
$mailmsg,$contact_name, |
$mailmsg,$contact_name, |
$contact_email); |
$contact_email); |
Line 1196 sub print_dataentry_form {
|
Line 1197 sub print_dataentry_form {
|
$output .= ' |
$output .= ' |
<input type="hidden" name="crypt" value="" /> |
<input type="hidden" name="crypt" value="" /> |
<input type="hidden" name="code" value="" /> |
<input type="hidden" name="code" value="" /> |
|
<br /><br /> |
'; |
'; |
} elsif ($captcha eq 'recaptcha') { |
} elsif ($captcha eq 'recaptcha') { |
if ($recaptchaversion eq '2') { |
unless ($recaptchaversion eq '2') { |
$output .= "$captchaform\n"; |
|
undef($captchaform); |
|
} else { |
|
$output .= ' |
$output .= ' |
<input type="hidden" name="recaptcha_challenge_field" value="" /> |
<input type="hidden" name="recaptcha_challenge_field" value="" /> |
<input type="hidden" name="recaptcha_response_field" value="" /> |
<input type="hidden" name="recaptcha_response_field" value="" /> |
|
<br /><br /> |
'; |
'; |
} |
} |
} |
} |
Line 1406 sub create_account {
|
Line 1406 sub create_account {
|
unless (($inststatus eq 'default') || ($inststatus eq '')) { |
unless (($inststatus eq 'default') || ($inststatus eq '')) { |
&Apache::lonnet::put('environment',{inststatus => $inststatus},$domain,$username); |
&Apache::lonnet::put('environment',{inststatus => $inststatus},$domain,$username); |
} |
} |
$output .= '<br />'.&mt('Home server: [_1]',$uhome).' '. |
$output .= '<br />'.&mt('Home Server').": $uhome ". |
&Apache::lonnet::hostname($uhome).'<br /><br />'; |
&Apache::lonnet::hostname($uhome).'<br /><br />'; |
return ('ok',$output,$uhome); |
return ('ok',$output,$uhome); |
} else { |
} else { |
Line 1579 sub username_check {
|
Line 1579 sub username_check {
|
'<input type="hidden" name="udom" value="'.$domain.'" />'."\n". |
'<input type="hidden" name="udom" value="'.$domain.'" />'."\n". |
'<input type="hidden" name="phase" value="username_activation" />'; |
'<input type="hidden" name="phase" value="username_activation" />'; |
my $now = time; |
my $now = time; |
my %info = ('ip' => $ENV{'REMOTE_ADDR'}, |
my $ip = &Apache::lonnet::get_requestor_ip(); |
|
my %info = ('ip' => $ip, |
'time' => $now, |
'time' => $now, |
'domain' => $domain, |
'domain' => $domain, |
'username' => $username); |
'username' => $username); |