Subversion Repositories PEEPS

Rev

Rev 4 | Rev 12 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 11
Line 382... Line 382...
382
    $authenticated->{ERRMSG} = "";
382
    $authenticated->{ERRMSG} = "";
383
  }
383
  }
Line 384... Line 384...
384
  
384
  
Line 385... Line 385...
385
  print header(-cookie=>$PEEPSAUTH_cookie);
385
  print header(-cookie=>$PEEPSAUTH_cookie);
386
  
386
  
387
  printRCHeader("Please Sign In");
387
  printRCHeader("Sign In");
388
  print<<authpage;
388
  print<<authpage;
389
  <form action="$ENV{REQUEST_URI}" method=POST name=Req id=Req>
389
  <form action="$ENV{REQUEST_URI}" method=POST name=Req id=Req>
390
    <TR><TD colspan=2 align=center><b><font size=+2>Please Sign In</font>
-
 
391
    <TABLE>
-
 
392
    </TD></TR>
390
    <h2>Please Sign In</h2>
393
    <TR><TD colspan=2>&nbsp</TD></TR>
391
    <TABLE>
Line 394... Line 392...
394
    $authenticated->{ERRMSG}
392
    $authenticated->{ERRMSG}
395
authpage
393
authpage
Line 427... Line 425...
427
MFApage
425
MFApage
Line 428... Line 426...
428
    
426
    
Line 429... Line 427...
429
  } else {
427
  } else {
430
    
-
 
431
    print<<authpage2;
428
    
432
      <TR><TD colspan=2>&nbsp</TD></TR>
429
    print<<authpage2;
433
      <TR>
430
      <TR>
434
        <TD align=right><B>Username:</TD><TD><INPUT type=text id=login name=userid></TD>
431
        <TD align=right><B>Username:</TD><TD><INPUT type=text id=login name=userid></TD>
435
      </TR>
432
      </TR>
436
      <TR>
433
      <TR>
437
        <TD align=right><B>Password:</TD><TD><INPUT type=password name=pass></TD>
434
        <TD align=right><B>Password:</TD><TD><INPUT type=password name=pass></TD>
-
 
435
      </TR>
438
      </TR>
436
      <TR><TD></TD><TD><input type=hidden name=activate id=activate value=$FORM{'activate'}><input type=hidden name=authenticate id=authenticate value=$FORM{'authenticate'}><INPUT type=submit name=login value=Submit></TD></TR>
439
      <TR><TD></TD><TD><input type=hidden name=activate id=activate value=$FORM{'activate'}><input type=hidden name=authenticate id=authenticate value=$FORM{'authenticate'}><INPUT type=submit name=login value=Submit></TD></TR>
437
      <TR><TD colspan=2>&nbsp</TD></TR>
440
      <TR><TD colspan=2 align=center><A HREF="view_user?submit=New%20User">[register as a new user]</A></TD></TR>
438
      <TR><TD colspan=2 align=center><A HREF="view_user?submit=New%20User">[register as a new user]</A></TD></TR>
441
      <TR><TD colspan=2 align=center><A HREF="recoverAccount">[recover your account]</A></TD></TR>
439
      <TR><TD colspan=2 align=center><A HREF="recoverAccount">[recover your account]</A></TD></TR>
Line 861... Line 859...
861
#  print $h->img ({referrerpolicy=>"no-referrer-when-downgrade", src=>"https://analytics.whump.org/matomo.php?idsite=2&amp;rec=1", style=>"border:0", alt=>""});
859
#  print $h->img ({referrerpolicy=>"no-referrer-when-downgrade", src=>"https://analytics.whump.org/matomo.php?idsite=2&amp;rec=1", style=>"border:0", alt=>""});
862
#<html><head><title>Officials' RollerCon Schedule Manager - $PAGE_TITLE</title>
860
#<html><head><title>Officials' RollerCon Schedule Manager - $PAGE_TITLE</title>
863
#<link rel="stylesheet" type="text/css" href="/style.css">
861
#<link rel="stylesheet" type="text/css" href="/style.css">
864
#</head>
862
#</head>
865
#<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
863
#<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
866
  print $h->div ({ class=>"sp0" }, [ $h->div ({ class=>"spLeft" },  $h->a ({ href=>"/" }, $h->img ({ src=>"/images/wftda-insurance-logo.svg", width=>"250", height=>"75" }))),
864
  print $h->div ({ class=>"sp0" }, [ $h->div ({ class=>"spLeft" },  $h->a ({ href=>"/" }, $h->img ({ src=>"/images/wftdapeeps-powerby-wftdainsurance-2.svg", width=>"400", height=>"75" }))),
867
                                     $h->div ({ class=>"spRight" }, [ $h->h1 (["PEEPS $PAGE_TITLE", $h->br]),
865
                                     $h->div ({ class=>"spRight" }, [ $h->h1 (["$PAGE_TITLE", $h->br]),
868
                                     $loggedinas, 
866
                                     $loggedinas, 
869
                                     ])
867
                                     ])
870
                                   ]);
868
                                   ]);
871
#print<<rcheader;
869
#print<<rcheader;
872
#  <TABLE>
870
#  <TABLE>
Line 1313... Line 1311...
1313
sub sendUserMFAEMail {
1311
sub sendUserMFAEMail {
1314
  my $user = shift // return "ERROR [sendUserMFAEMail]: No user data sent to function.";
1312
  my $user = shift // return "ERROR [sendUserMFAEMail]: No user data sent to function.";
1315
  use PEEPSMailer;
1313
  use PEEPSMailer;
1316
  use HTML::Tiny;
1314
  use HTML::Tiny;
1317
  my $h = HTML::Tiny->new( mode => 'html' );
1315
  my $h = HTML::Tiny->new( mode => 'html' );
-
 
1316
  $ENV{HTTPS} = 'ON' if $ENV{SERVER_NAME} =~ /^peeps/;
Line 1318... Line 1317...
1318
  
1317
  
Line 1319... Line -...
1319
  return "ERROR [sendUserMFAEMail]: No email address found for user" unless $user->{email};
-
 
1320
  
-
 
1321
  my $subject = 'WFTDI PEEPS - MFA Verification Code';
-
 
1322
  my $body;
-
 
1323
  $body = $h->p ("Greetings,");
-
 
1324
  $body .= $h->p ("It appears you are trying to log into PEEPS from somewhere new. Here's a code to enter:");
1318
  return "ERROR [sendUserMFAEMail]: No email address found for user" unless $user->{email};
1325
  
1319
  
1326
  my $random_six_digit_number = 100000 + int(rand(900000));
1320
  my $random_six_digit_number = 100000 + int(rand(900000));
Line 1327... Line 1321...
1327
  my $string_number = sprintf ("%06d", $random_six_digit_number);
1321
  my $string_number = sprintf ("%06d", $random_six_digit_number);
-
 
1322
  $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});
1323
  
1329
  
1324
  my $subject = 'WFTDI PEEPS - Login MFA Verification Code';
1330
  $ENV{HTTPS} = 'ON' if $ENV{SERVER_NAME} =~ /^peeps/;
1325
  my $body = $h->p ({ style => "font-family: Verdana;" }, "Greetings,", "It appears you are trying to log into PEEPS from somewhere new. Here's a code to enter:");
Line 1331... Line 1326...
1331
  $body .= $h->p ($string_number);
1326
  $body .= $h->p ({ style => "font-family: Verdana; font-size: larger; font-weight: bold;" }, $string_number);
1332
  $body .= $h->p ("Or click ".$h->a ({ href => url ()."?authenticate=".$string_number }, "this link"));
1327
  $body .= $h->p ({ style => "font-family: Verdana;" }, "Or click ".$h->a ({ href => url ()."?authenticate=".$string_number }, "this link").".");
Line 1333... Line 1328...
1333
  $body .= $h->br, $h->p ("--PEEPS Automated Emailer");
1328
  $body .= $h->p ({ style => "font-family: Verdana; font-size: smaller; font-style: italic;" }, "", "Sent by PEEPS Automated Emailer");