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.php36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/application/views/view_user.php b/src/application/views/view_user.php
index 6631407..aba0f2f 100644
--- a/src/application/views/view_user.php
+++ b/src/application/views/view_user.php
@@ -23,7 +23,7 @@ $dateJoined->setTime(0, 0, 0, 0);
?>
<div class="clearfix page-header margin-top-0">
- <img class="pull-left margin-right" src="?_action=profilepicture&amp;user=<?= htmlentities(urlencode($user->id)) ?>">
+ <img class="pull-left margin-right" src="?_action=profilepicture&amp;user=<?= htmlentities(urlencode($user->id)) ?>" alt="<?= __("Profile picture") ?>" width="64" height="64">
<span class="h1"><?= htmlentities($user->displayName) ?></span>
<?php if ($isOwnProfile): ?>
<span class="label label-primary"><?= __("You") ?></span>
@@ -69,7 +69,7 @@ $dateJoined->setTime(0, 0, 0, 0);
</div>
<?php else: ?>
<div class="well icon-well text-info margin-top margin-bottom">
- <span class="glyphicon glyphicon-info-sign color-info" aria-hidden="true"></span>
+ <span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>
<em><?= __("This user has not posted anything yet") ?></em>
</div>
<?php endif; ?>
@@ -80,11 +80,12 @@ $dateJoined->setTime(0, 0, 0, 0);
<div class="col-md-3">
<h3><?= __("Edit profile") ?></h3>
<?php
-if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
+if (($_formError = RequestUtils::getAndClearFormError("update_profile")) !== null) {
_view("alert_error", ["message" => $_formError]);
}
?>
<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="form_id" value="update_profile">
<div class="form-group">
<label for="i_display_name"><?= __("Display name:") ?></label>
<input required class="form-control" type="text" name="display_name" id="i_display_name" value="<?= htmlentities($user->displayName) ?>">
@@ -130,12 +131,39 @@ $_checkbox_disabled_class = $_checkbox_disabled ? " disabled text-muted" : "";
<?= __("Upload new profile picture") ?>
</label>
</div>
- <input type="file" name="pfp" id="i_pfp" accept="image/png,image/jpeg" class="margin-left-3x">
+ <input type="file" name="pfp" id="i_pfp" accept="image/png,image/jpeg" class="margin-left-3x small">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success"><?= __("Save changes") ?></button>
</div>
</form>
+<?php if ($isOwnProfile): ?>
+<h3><?= __("Change password") ?></h3>
+<?php
+if (($_formError = RequestUtils::getAndClearFormError("update_password")) !== null) {
+ _view("alert_error", ["message" => $_formError]);
+}
+?>
+<form action="<?= htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post">
+ <input type="hidden" name="form_id" value="update_password">
+ <div class="form-group">
+ <label for="i_current_password"><?= __("Current password:") ?></label>
+ <input autocomplete="current-password" required class="form-control" type="password" name="current_password" id="i_current_password" required>
+ </div>
+ <div class="form-group">
+ <label for="i_new_password"><?= __("New password:") ?></label>
+ <input autocomplete="new-password" required class="form-control" type="password" name="new_password" id="i_new_password" required>
+ </div>
+ <div class="form-group">
+ <label for="i_retype_password"><?= __("Retype password:") ?></label>
+ <input autocomplete="new-password" required class="form-control" type="password" name="retype_password" id="i_retype_password" required>
+ </div>
+ <div class="form-group">
+ <button type="submit" class="btn btn-success"><?= __("Change password") ?></button>
+ </div>
+</form>
+<?php endif; ?>
+
</div>
</div>