summaryrefslogtreecommitdiff
path: root/src/application/views/view_user.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/views/view_user.php')
-rw-r--r--src/application/views/view_user.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/application/views/view_user.php b/src/application/views/view_user.php
index aba0f2f..d3ebe04 100644
--- a/src/application/views/view_user.php
+++ b/src/application/views/view_user.php
@@ -20,6 +20,8 @@ else
$dateJoined = DateTime::createFromImmutable($user->created);
$dateJoined->setTime(0, 0, 0, 0);
+
+$emailPending = $isOwnProfile && $user->pendingEmail !== null;
?>
<div class="clearfix page-header margin-top-0">
@@ -93,7 +95,7 @@ if (($_formError = RequestUtils::getAndClearFormError("update_profile")) !== nul
<div class="form-group">
<label for="i_name"><?= __("Username:") ?></label>
<?php if ($lastNameChangeTooRecent): ?>
- <input required class="form-control" type="text" id="i_name" value="<?= htmlentities($user->name) ?>" disabled>
+ <input class="form-control" type="text" id="i_name" value="<?= htmlentities($user->name) ?>" disabled>
<small class="text-danger"><strong><?= __("You can only change your username every 30 days!") ?></strong></small>
<?php else: ?>
<input required class="form-control" type="text" name="name" id="i_name" value="<?= htmlentities($user->name) ?>">
@@ -101,7 +103,11 @@ if (($_formError = RequestUtils::getAndClearFormError("update_profile")) !== nul
</div>
<div class="form-group">
<label for="i_email"><?= __("Email address:") ?></label>
- <input required class="form-control" type="email" id="i_email" value="<?= htmlentities($user->email) ?>" disabled>
+ <?php if ($emailPending): ?>
+ <input class="form-control" type="email" id="i_email" value="<?= htmlentities($user->email) ?>" disabled>
+ <?php else: ?>
+ <input required class="form-control" type="email" id="i_email" name="email" value="<?= htmlentities($user->email) ?>">
+ <?php endif; ?>
</div>
<div class="form-group">
<label><?= __("Profile picture:") ?></label>