This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Views/user/user-edit.phtml
2014-05-18 21:32:47 +02:00

116 lines
3.2 KiB
PHTML

<form
action="<?= \Chibi\Router::linkTo(
['UserController', 'editAction'],
['identifier' => $this->context->transport->user->getName()]) ?>"
method="post"
class="edit"
autocomplete="off">
<?php if (Auth::getCurrentUser()->getId() == $this->context->transport->user->getId()): ?>
<div class="form-row current-password">
<label for="current-password">Current password:</label>
<div class="input-wrapper">
<input
type="password"
name="current-password"
id="current-password"
placeholder="Current password"/>
</div>
</div>
<hr>
<?php endif ?>
<?php if (Access::check(new Privilege(
Privilege::ChangeUserName,
Access::getIdentity($this->context->transport->user)))): ?>
<div class="form-row nickname">
<label for="name">Name:</label>
<div class="input-wrapper">
<input
type="text"
name="name"
id="name"
placeholder="New name&hellip;"
value="<?= htmlspecialchars(InputHelper::get('name')) ?>">
</div>
</div>
<?php endif ?>
<?php if (Access::check(new Privilege(
Privilege::ChangeUserEmail,
Access::getIdentity($this->context->transport->user)))): ?>
<div class="form-row email">
<label for="name">E-mail:</label>
<div class="input-wrapper">
<input
type="text"
name="email"
id="email"
placeholder="New e-mail&hellip;"
value="<?= htmlspecialchars(InputHelper::get('email')) ?>"/>
</div>
</div>
<?php endif ?>
<?php if (Access::check(new Privilege(
Privilege::ChangeUserPassword,
Access::getIdentity($this->context->transport->user)))): ?>
<div class="form-row password1">
<label for="password1">New password:</label>
<div class="input-wrapper">
<input
type="password"
name="password1"
id="password1"
placeholder="New password&hellip;"
value="<?= htmlspecialchars(InputHelper::get('password1')) ?>"/>
</div>
</div>
<div class="form-row password2">
<label for="password2"></label>
<div class="input-wrapper">
<input
type="password"
name="password2"
id="password2"
placeholder="New password&hellip; (repeat)"
value="<?= htmlspecialchars(InputHelper::get('password2')) ?>"/>
</div>
</div>
<?php endif ?>
<?php if (Access::check(new Privilege(
Privilege::ChangeUserAccessRank,
Access::getIdentity($this->context->transport->user)))): ?>
<div class="form-row access-rank">
<label for="access-rank">Access rank:</label>
<div class="input-wrapper">
<select name="access-rank" id="access-rank">
<?php foreach (AccessRank::getAll() as $rank): ?>
<?php if ($rank->toInteger() == AccessRank::Nobody) continue ?>
<?php if ($rank->toInteger() == InputHelper::get('access-rank')
or (!InputHelper::get('access-rank') and
$rank == $this->context->transport->user->getAccessRank())): ?>
<option value="<?= $rank->toInteger() ?>" selected="selected">
<?php else: ?>
<option value="<?= $rank->toInteger() ?>">
<?php endif ?>
<?= $rank->toDisplayString() ?>
</option>
<?php endforeach ?>
</select>
</div>
</div>
<?php endif ?>
<?php \Chibi\View::render('message', $this->context) ?>
<div class="form-row">
<label></label>
<button class="submit" type="submit">Submit</button>
</div>
</form>