This commit is contained in:
2021-06-21 11:13:02 -04:00
parent 5e4b57ebad
commit 1cb2704c65
7 changed files with 237 additions and 210 deletions

View File

@@ -92,12 +92,18 @@ $form_data = filter_input_array(INPUT_POST, [
'fd_lastName' => (string)FILTER_SANITIZE_STRING,
'fd_userEmail' => (string)FILTER_SANITIZE_STRING
]);
?>
<?php // PAGE CONSTANTS
$selfName = (string)'profile.php'; // PAGE URL
?>
<?php
$minpasslength = $StaticFunctions->getMinPass();
if (isset($form_data['fd_saveProfile'])):
if (empty($form_data['fd_initialPassword']) && empty($form_data['fd_confirmPassword'])):
$Users->setUserInfo($session_user["0"]["users_id"], $form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_userEmail'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]);
header('Location: profile.php');
header("Location: $selfName");
elseif (strlen($form_data['fd_initialPassword']) < $minpasslength):
echo "Password must be at least $minpasslength characters.";
elseif (!empty($form_data['fd_initialPassword']) && empty($form_data['fd_confirmPassword'])):
@@ -110,7 +116,7 @@ $form_data = filter_input_array(INPUT_POST, [
$hasher = new PasswordHash(8, FALSE);
$password = $hasher->HashPassword($form_data['fd_initialPassword']);
$Users->setUserInfo($session_user["0"]["users_id"], $form_data['fd_firstName'], $form_data['fd_lastName'], $form_data['fd_userEmail'], $session_user["0"]["users_usertypeid"], $password);
header('Location: profile.php');
header("Location: $selfName");
endif;
endif;
?>
@@ -122,7 +128,7 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="col d-grid gap-2 text-center">
</div>
<div class="col text-end">
<a href="profile.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?=$transLang['REFRESH']?></a>
<a href="<?=$selfName?>" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?=$transLang['REFRESH']?></a>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
@@ -144,13 +150,13 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?=$transLang['USER-USERNAME']?></span>
<input class="form-control bg-white" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly />
<input class="form-control bg-white" type="text" name="fd_userName" id="fd_userName" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?=$transLang['CREATED']?></span>
<input class="form-control bg-white" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly />
<input class="form-control bg-white" type="text" name="fd_userCreated" id="fd_userCreated" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly />
</div>
</div>
</div>
@@ -158,7 +164,7 @@ $form_data = filter_input_array(INPUT_POST, [
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?=$transLang['USER-TYPE']?></span>
<input class="form-control bg-white" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly />
<input class="form-control bg-white" type="text" name="fd_userType" id="fd_userType" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly />
</div>
</div>
<div class="col d-grid gap-2">