Skip to content

Commit

Permalink
2.11.19 Fix register.php
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed Sep 29, 2024
2 parents 6ae756e + 6110d89 commit 7aab66e
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/register.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

function generateApiToken($length = 32 /* 32 bytes = 256 bits */){ {
// Generates a secure 32-byte token for use in API calls
// The token is generated using a cryptographically secure pseudorandom number generator
Expand Down Expand Up @@ -106,20 +105,16 @@ function generateApiToken($length = 32 /* 32 bytes = 256 bits */){ {

} catch (Exception $e) {
echo $CustomErrorHandler->FormatError($e, "Failed to add account");
$LogHandler->writeToLog("Failed to add account for: " . $lUsername);
$LogHandler->writeToLog("Failed to add account for: " . $lUsername);
}// end try

}// end if $lFormSubmitted
?>

<script type="text/javascript">
<!--
<?php
if($lEnableJavaScriptValidation){
echo "var lValidateInput = \"TRUE\"" . PHP_EOL;
}else{
echo "var lValidateInput = \"FALSE\"" . PHP_EOL;
}// end if
<?php
echo "var lValidateInput = \"" . ($lEnableJavaScriptValidation ? "TRUE" : "FALSE") . "\"" . PHP_EOL;
?>

function onSubmitOfForm(/*HTMLFormElement*/ theForm){
Expand Down Expand Up @@ -168,19 +163,15 @@ function onSubmitOfForm(/*HTMLFormElement*/ theForm){
<td class="label">Username</td>
<td>
<input type="text" name="username" size="15" autofocus="autofocus"
<?php
if ($lEnableHTMLControls) {
echo 'minlength="1" maxlength="15" required="required"';
}// end if
?>
<?php if ($lEnableHTMLControls) { echo $lHTMLControls; }?>
/>
</td>
</tr>
<tr>
<td class="label">Password</td>
<td>
<input type="password" name="password" size="15"
<?php if ($lEnableHTMLControls) {echo $lHTMLControls;} ?>
<?php if ($lEnableHTMLControls) { echo $lHTMLControls; }?>
/>
&nbsp;
<a href="index.php?page=password-generator.php&username=<?php echo $logged_in_user ?>" target="_blank">Password Generator</a>
Expand All @@ -190,7 +181,7 @@ function onSubmitOfForm(/*HTMLFormElement*/ theForm){
<td class="label">Confirm Password</td>
<td>
<input type="password" name="confirm_password" size="15"
<?php if ($lEnableHTMLControls) {echo $lHTMLControls;} ?>
<?php if ($lEnableHTMLControls) { echo $lHTMLControls; }?>
/>
</td>
</tr>
Expand All @@ -217,4 +208,4 @@ function onSubmitOfForm(/*HTMLFormElement*/ theForm){
if ($lFormSubmitted) {
echo $lCSRFTokenHandler->generateCSRFHTMLReport();
}// end if
?>
?>

0 comments on commit 7aab66e

Please sign in to comment.