| Line 357... |
Line 357... |
| 357 |
my $PEEPSAUTH_cookie = CGI::Cookie->new(-name=>'PEEPSAUTH',-value=>$authenticated->{cookie_string});
|
357 |
my $PEEPSAUTH_cookie = CGI::Cookie->new(-name=>'PEEPSAUTH',-value=>$authenticated->{cookie_string});
|
| 358 |
my $PEEPSMFA_cookie = $FORM{saveMFA} ?
|
358 |
my $PEEPSMFA_cookie = $FORM{saveMFA} ?
|
| 359 |
CGI::Cookie->new(-name=>'PEEPS_MFA_UUID',-value=>$authenticated->{MFA_UUID},-expires=>'+5y') :
|
359 |
CGI::Cookie->new(-name=>'PEEPS_MFA_UUID',-value=>$authenticated->{MFA_UUID},-expires=>'+5y') :
|
| 360 |
CGI::Cookie->new(-name=>'PEEPS_MFA_UUID',-value=>$authenticated->{MFA_UUID});
|
360 |
CGI::Cookie->new(-name=>'PEEPS_MFA_UUID',-value=>$authenticated->{MFA_UUID});
|
| Line 361... |
Line 361... |
| 361 |
|
361 |
|
| 362 |
$ENV{HTTPS} = 'ON';
|
362 |
$ENV{HTTPS} = 'ON' if $ENV{SERVER_NAME} =~ /^peeps/;
|
| 363 |
my $destination = url ();
|
363 |
my $destination = url ();
|
| 364 |
print header(-cookie=>[$PEEPSAUTH_cookie, $PEEPSMFA_cookie]);
|
364 |
print header(-cookie=>[$PEEPSAUTH_cookie, $PEEPSMFA_cookie]);
|
| 365 |
printRCHeader("MFA Confirmed", $destination);
|
365 |
printRCHeader("MFA Confirmed", $destination);
|
| 366 |
print<<goforth;
|
366 |
print<<goforth;
|
| Line 825... |
Line 825... |
| 825 |
my $PAGE_TITLE = shift;
|
825 |
my $PAGE_TITLE = shift;
|
| 826 |
my $redirect = shift // "";
|
826 |
my $redirect = shift // "";
|
| 827 |
# use CGI qw/start_html/;
|
827 |
# use CGI qw/start_html/;
|
| 828 |
use HTML::Tiny;
|
828 |
use HTML::Tiny;
|
| 829 |
my $h = HTML::Tiny->new( mode => 'html' );
|
829 |
my $h = HTML::Tiny->new( mode => 'html' );
|
| 830 |
$ENV{HTTPS} = 'ON';
|
830 |
$ENV{HTTPS} = 'ON' if $ENV{SERVER_NAME} =~ /^peeps/;
|
| Line 831... |
Line 831... |
| 831 |
|
831 |
|
| 832 |
# my $logout = $h->a ({ href=>"index", onClick=>"document.cookie = 'PEEPSAUTH=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';return true;" }, "[Log Out]");
|
832 |
# my $logout = $h->a ({ href=>"index", onClick=>"document.cookie = 'PEEPSAUTH=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';return true;" }, "[Log Out]");
|
| 833 |
my $referrer = param ("referrer") ? param ("referrer") : $ENV{HTTP_REFERER};
|
833 |
my $referrer = param ("referrer") ? param ("referrer") : $ENV{HTTP_REFERER};
|
| 834 |
my $logout = (!$referrer or $referrer eq url) ? "" : $h->button ({ onClick=>"window.location.href='$referrer';" }, "Back")." ";
|
834 |
my $logout = (!$referrer or $referrer eq url) ? "" : $h->button ({ onClick=>"window.location.href='$referrer';" }, "Back")." ";
|
| Line 1325... |
Line 1325... |
| 1325 |
|
1325 |
|
| 1326 |
my $random_six_digit_number = 100000 + int(rand(900000));
|
1326 |
my $random_six_digit_number = 100000 + int(rand(900000));
|
| 1327 |
my $string_number = sprintf ("%06d", $random_six_digit_number);
|
1327 |
my $string_number = sprintf ("%06d", $random_six_digit_number);
|
| Line 1328... |
Line 1328... |
| 1328 |
$dbh->do ("update authentication set mfa = ?, mfa_timestamp = now() where person_id = ?", undef, $string_number, $user->{person_id});
|
1328 |
$dbh->do ("update authentication set mfa = ?, mfa_timestamp = now() where person_id = ?", undef, $string_number, $user->{person_id});
|
| 1329 |
|
1329 |
|
| 1330 |
$ENV{HTTPS} = 'ON';
|
1330 |
$ENV{HTTPS} = 'ON' if $ENV{SERVER_NAME} =~ /^peeps/;
|
| 1331 |
$body .= $h->p ($string_number);
|
1331 |
$body .= $h->p ($string_number);
|
| Line 1332... |
Line 1332... |
| 1332 |
$body .= $h->p ("Or click ".$h->a ({ href => url ()."?authenticate=".$string_number }, "this link"));
|
1332 |
$body .= $h->p ("Or click ".$h->a ({ href => url ()."?authenticate=".$string_number }, "this link"));
|
| Line 1347... |
Line 1347... |
| 1347 |
my $email = $data->{email};
|
1347 |
my $email = $data->{email};
|
| 1348 |
my $subject = 'WFTDI PEEPS - New User';
|
1348 |
my $subject = 'WFTDI PEEPS - New User';
|
| 1349 |
my $body;
|
1349 |
my $body;
|
| 1350 |
if ($context eq "New User") {
|
1350 |
if ($context eq "New User") {
|
| 1351 |
$subject .= " Request";
|
1351 |
$subject .= " Request";
|
| 1352 |
$ENV{HTTPS} = 'ON';
|
1352 |
$ENV{HTTPS} = 'ON' if $ENV{SERVER_NAME} =~ /^peeps/;
|
| 1353 |
my $activationlink = url ()."?activate=".$data->{activation};
|
1353 |
my $activationlink = url ()."?activate=".$data->{activation};
|
| 1354 |
$body = $h->p ("Greetings,");
|
1354 |
$body = $h->p ("Greetings,");
|
| 1355 |
$body .= $h->p ("It appears as though you've registered a new account in WFTDI's PEEPS system with the following information:");
|
1355 |
$body .= $h->p ("It appears as though you've registered a new account in WFTDI's PEEPS system with the following information:");
|
| 1356 |
$body .= $h->table ([
|
1356 |
$body .= $h->table ([
|
| 1357 |
$h->tr ([$h->td (" ", "Derby Name:", $data->{derby_name})]),
|
1357 |
$h->tr ([$h->td (" ", "Derby Name:", $data->{derby_name})]),
|