diff options
| author | Jonas Kohl | 2024-09-19 13:37:59 +0200 | 
|---|---|---|
| committer | Jonas Kohl | 2024-09-19 13:37:59 +0200 | 
| commit | 06510101ad051c5b7bbacd6411eeb2b5c53cc3a3 (patch) | |
| tree | 0678aea9b166c2e73f14c91f9246ac0b82298098 /src/application/views/view_user.php | |
| parent | ea64d16f7cdb86be610d5c90c46d0185d0e839e1 (diff) | |
Email editing
Diffstat (limited to 'src/application/views/view_user.php')
| -rw-r--r-- | src/application/views/view_user.php | 10 | 
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> |