version 1.160.6.68, 2016/08/07 00:28:39
|
version 1.160.6.69, 2016/08/12 19:49:56
|
Line 4542 sub email_as_username {
|
Line 4542 sub email_as_username {
|
|
|
sub captcha_choice { |
sub captcha_choice { |
my ($context,$settings,$itemcount) = @_; |
my ($context,$settings,$itemcount) = @_; |
my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext); |
my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext, |
|
$vertext,$currver); |
my %lt = &captcha_phrases(); |
my %lt = &captcha_phrases(); |
$keyentry = 'hidden'; |
$keyentry = 'hidden'; |
if ($context eq 'cancreate') { |
if ($context eq 'cancreate') { |
Line 4560 sub captcha_choice {
|
Line 4561 sub captcha_choice {
|
$pubtext = $lt{'pub'}; |
$pubtext = $lt{'pub'}; |
$privtext = $lt{'priv'}; |
$privtext = $lt{'priv'}; |
$keyentry = 'text'; |
$keyentry = 'text'; |
|
$vertext = $lt{'ver'}; |
|
$currver = $settings->{'recaptchaversion'}; |
|
if ($currver ne '2') { |
|
$currver = 1; |
|
} |
} |
} |
if (ref($settings->{'recaptchakeys'}) eq 'HASH') { |
if (ref($settings->{'recaptchakeys'}) eq 'HASH') { |
$currpub = $settings->{'recaptchakeys'}{'public'}; |
$currpub = $settings->{'recaptchakeys'}{'public'}; |
Line 4593 sub captcha_choice {
|
Line 4599 sub captcha_choice {
|
$currpub.'" size="40" /></span><br />'."\n". |
$currpub.'" size="40" /></span><br />'."\n". |
'<span class="LC_nobreak"><span id="'.$context.'_recaptchaprivtxt">'.$privtext.'</span> '."\n". |
'<span class="LC_nobreak"><span id="'.$context.'_recaptchaprivtxt">'.$privtext.'</span> '."\n". |
'<input type="'.$keyentry.'" id="'.$context.'_recaptchapriv" name="'.$context.'_recaptchapriv" value="'. |
'<input type="'.$keyentry.'" id="'.$context.'_recaptchapriv" name="'.$context.'_recaptchapriv" value="'. |
$currpriv.'" size="40" /></span></td></tr></table>'."\n". |
$currpriv.'" size="40" /></span><br />'. |
|
'<span class="LC_nobreak"><span id="'.$context.'_recaptchavertxt">'.$vertext.'</span> '."\n". |
|
'<input type="'.$keyentry.'" id="'.$context.'_recaptchaversion" name="'.$context.'_recaptchaversion" value="'. |
|
$currver.'" size="3" /></span><br />'. |
|
'</td></tr></table>'."\n". |
'</td></tr>'; |
'</td></tr>'; |
return $output; |
return $output; |
} |
} |
Line 6380 sub modify_login {
|
Line 6390 sub modify_login {
|
$chgtxt .= '</ul>'; |
$chgtxt .= '</ul>'; |
$resulttext .= '<li>'.$chgtxt.'</li>'; |
$resulttext .= '<li>'.$chgtxt.'</li>'; |
} |
} |
|
} elsif ($item eq 'recaptchaversion') { |
|
if (ref($loginhash{'login'}) eq 'HASH') { |
|
if ($loginhash{'login'}{'captcha'} eq 'recaptcha') { |
|
$resulttext .= '<li>'.&mt('ReCAPTCHA for helpdesk form set to version [_1]',$loginhash{'login'}{'recaptchaversion'}). |
|
'</li>'; |
|
} |
|
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
} |
} |
Line 8601 sub modify_usercreation {
|
Line 8618 sub modify_usercreation {
|
if (ref($domconfig{'usercreation'}{$key}) eq 'HASH') { |
if (ref($domconfig{'usercreation'}{$key}) eq 'HASH') { |
foreach my $item (keys(%{$domconfig{'usercreation'}{$key}})) { |
foreach my $item (keys(%{$domconfig{'usercreation'}{$key}})) { |
if (($item eq 'selfcreate') || ($item eq 'statustocreate') || |
if (($item eq 'selfcreate') || ($item eq 'statustocreate') || |
($item eq 'captcha') || ($item eq 'recaptchakeys')) { |
($item eq 'captcha') || ($item eq 'recaptchakeys') || |
|
($item eq 'recaptchaversion')) { |
$save_usercreate{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
$save_usercreate{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
} else { |
} else { |
$curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
$curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
Line 8825 sub modify_selfcreation {
|
Line 8843 sub modify_selfcreation {
|
foreach my $item (keys(%{$domconfig{'usercreation'}{$key}})) { |
foreach my $item (keys(%{$domconfig{'usercreation'}{$key}})) { |
if (($item eq 'selfcreate') || ($item eq 'statustocreate') || |
if (($item eq 'selfcreate') || ($item eq 'statustocreate') || |
($item eq 'captcha') || ($item eq 'recaptchakeys') || |
($item eq 'captcha') || ($item eq 'recaptchakeys') || |
|
($item eq 'recaptchaversion') || |
($item eq 'emailusername') || ($item eq 'notify') || |
($item eq 'emailusername') || ($item eq 'notify') || |
($item eq 'selfcreateprocessing') || ($item eq 'shibenv')) { |
($item eq 'selfcreateprocessing') || ($item eq 'shibenv')) { |
$curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
$curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
Line 9154 sub modify_selfcreation {
|
Line 9173 sub modify_selfcreation {
|
# |
# |
$save_usercreate{'cancreate'}{'captcha'} = $savecaptcha{'captcha'}; |
$save_usercreate{'cancreate'}{'captcha'} = $savecaptcha{'captcha'}; |
$save_usercreate{'cancreate'}{'recaptchakeys'} = $savecaptcha{'recaptchakeys'}; |
$save_usercreate{'cancreate'}{'recaptchakeys'} = $savecaptcha{'recaptchakeys'}; |
|
$save_usercreate{'cancreate'}{'recaptchaversion'} = $savecaptcha{'recaptchaversion'}; |
$save_usercreate{'cancreate'}{'selfcreate'} = $cancreate{'selfcreate'}; |
$save_usercreate{'cancreate'}{'selfcreate'} = $cancreate{'selfcreate'}; |
if (ref($cancreate{'notify'}) eq 'HASH') { |
if (ref($cancreate{'notify'}) eq 'HASH') { |
$save_usercreate{'cancreate'}{'notify'} = $cancreate{'notify'}; |
$save_usercreate{'cancreate'}{'notify'} = $cancreate{'notify'}; |
Line 9315 sub modify_selfcreation {
|
Line 9335 sub modify_selfcreation {
|
$chgtext .= '<li>'.&mt('Private key set to [_1]',$pubkey).'</li>'; |
$chgtext .= '<li>'.&mt('Private key set to [_1]',$pubkey).'</li>'; |
} |
} |
$chgtext .= '</ul>'; |
$chgtext .= '</ul>'; |
|
} elsif ($type eq 'recaptchaversion') { |
|
if ($savecaptcha{'captcha'} eq 'recaptcha') { |
|
$chgtext .= &mt('ReCAPTCHA set to version [_1]',$savecaptcha{$type}); |
|
} |
} elsif ($type eq 'emailusername') { |
} elsif ($type eq 'emailusername') { |
if (ref($cancreate{'emailusername'}) eq 'HASH') { |
if (ref($cancreate{'emailusername'}) eq 'HASH') { |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
Line 9435 sub process_captcha {
|
Line 9459 sub process_captcha {
|
$changes->{'captcha'} = 1; |
$changes->{'captcha'} = 1; |
} |
} |
} |
} |
my ($newpub,$newpriv,$currpub,$currpriv); |
my ($newpub,$newpriv,$currpub,$currpriv,$newversion,$currversion); |
if ($newsettings->{'captcha'} eq 'recaptcha') { |
if ($newsettings->{'captcha'} eq 'recaptcha') { |
$newpub = $env{'form.'.$container.'_recaptchapub'}; |
$newpub = $env{'form.'.$container.'_recaptchapub'}; |
$newpriv = $env{'form.'.$container.'_recaptchapriv'}; |
$newpriv = $env{'form.'.$container.'_recaptchapriv'}; |
Line 9445 sub process_captcha {
|
Line 9469 sub process_captcha {
|
public => $newpub, |
public => $newpub, |
private => $newpriv, |
private => $newpriv, |
}; |
}; |
|
$newversion = $env{'form.'.$container.'_recaptchaversion'}; |
|
$newversion =~ s/\D//g; |
|
if ($newversion ne '2') { |
|
$newversion = 1; |
|
} |
|
$newsettings->{'recaptchaversion'} = $newversion; |
} |
} |
if (ref($current->{'recaptchakeys'}) eq 'HASH') { |
if (ref($current->{'recaptchakeys'}) eq 'HASH') { |
$currpub = $current->{'recaptchakeys'}{'public'}; |
$currpub = $current->{'recaptchakeys'}{'public'}; |
Line 9456 sub process_captcha {
|
Line 9486 sub process_captcha {
|
} |
} |
} |
} |
} |
} |
|
if ($current->{'captcha'} eq 'recaptcha') { |
|
$currversion = $current->{'recaptchaversion'}; |
|
if ($currversion ne '2') { |
|
$currversion = 1; |
|
} |
|
} |
|
if ($currversion ne $newversion) { |
|
if ($container eq 'cancreate') { |
|
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
|
push(@{$changes->{'cancreate'}},'recaptchaversion'); |
|
} elsif (!defined($changes->{'cancreate'})) { |
|
$changes->{'cancreate'} = ['recaptchaversion']; |
|
} |
|
} else { |
|
$changes->{'recaptchaversion'} = 1; |
|
} |
|
} |
if (($newpub ne $currpub) || ($newpriv ne $currpriv)) { |
if (($newpub ne $currpub) || ($newpriv ne $currpriv)) { |
if ($container eq 'cancreate') { |
if ($container eq 'cancreate') { |
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
if (ref($changes->{'cancreate'}) eq 'ARRAY') { |
Line 12136 function updateCaptcha(caller,context) {
|
Line 12183 function updateCaptcha(caller,context) {
|
var pubitem; |
var pubitem; |
var privtext; |
var privtext; |
var pubtext; |
var pubtext; |
|
var versionitem; |
|
var versiontext; |
if (document.getElementById(context+'_recaptchapub')) { |
if (document.getElementById(context+'_recaptchapub')) { |
pubitem = document.getElementById(context+'_recaptchapub'); |
pubitem = document.getElementById(context+'_recaptchapub'); |
} else { |
} else { |
Line 12156 function updateCaptcha(caller,context) {
|
Line 12205 function updateCaptcha(caller,context) {
|
} else { |
} else { |
return; |
return; |
} |
} |
|
if (document.getElementById(context+'_recaptchaversion')) { |
|
versionitem = document.getElementById(context+'_recaptchaversion'); |
|
} else { |
|
return; |
|
} |
|
if (document.getElementById(context+'_recaptchavertxt')) { |
|
versiontext = document.getElementById(context+'_recaptchavertxt'); |
|
} else { |
|
return; |
|
} |
if (caller.checked) { |
if (caller.checked) { |
if (caller.value == 'recaptcha') { |
if (caller.value == 'recaptcha') { |
pubitem.type = 'text'; |
pubitem.type = 'text'; |
Line 12164 function updateCaptcha(caller,context) {
|
Line 12223 function updateCaptcha(caller,context) {
|
privitem.size = '40'; |
privitem.size = '40'; |
pubtext.innerHTML = "$lt{'pub'}"; |
pubtext.innerHTML = "$lt{'pub'}"; |
privtext.innerHTML = "$lt{'priv'}"; |
privtext.innerHTML = "$lt{'priv'}"; |
|
versionitem.type = 'text'; |
|
versionitem.size = '3'; |
|
versiontext.innerHTML = "$lt{'ver'}"; |
} else { |
} else { |
pubitem.type = 'hidden'; |
pubitem.type = 'hidden'; |
privitem.type = 'hidden'; |
privitem.type = 'hidden'; |
|
versionitem.type = 'hidden'; |
pubtext.innerHTML = ''; |
pubtext.innerHTML = ''; |
privtext.innerHTML = ''; |
privtext.innerHTML = ''; |
|
versiontext.innerHTML = ''; |
} |
} |
} |
} |
return; |
return; |
Line 12234 sub captcha_phrases {
|
Line 12298 sub captcha_phrases {
|
original => 'original (CAPTCHA)', |
original => 'original (CAPTCHA)', |
recaptcha => 'successor (ReCAPTCHA)', |
recaptcha => 'successor (ReCAPTCHA)', |
notused => 'unused', |
notused => 'unused', |
|
ver => 'ReCAPTCHA version (1 or 2)', |
); |
); |
} |
} |
|
|