Admins can view user e-mails too

They could do this anyway by doing simple SELECTs. This change is just to make
admins' lives easier.
This commit is contained in:
Marcin Kurczewski 2013-10-16 20:26:48 +02:00
parent 5d5440a8f1
commit c90561e4ce
4 changed files with 5 additions and 3 deletions

View file

@ -65,6 +65,7 @@ deletePost.all=moderator
listUsers=registered
viewUser=registered
viewUserEmail=admin
changeUserPassword.own=registered
changeUserPassword.all=admin
changeUserEmail.own=registered

View file

@ -1,5 +1,5 @@
#sidebar {
width: 200px;
width: 220px;
font-size: 90%;
}

View file

@ -14,6 +14,7 @@ class Privilege extends Enum
const ListUsers = 11;
const ViewUser = 12;
const ViewUserEmail = 22;
const BanUser = 13;
const AcceptUserRegistration = 14;
const ChangeUserPassword = 15;

View file

@ -19,11 +19,11 @@
<span class="value" title="<?php echo $val = TextHelper::camelCaseToHumanCase(AccessRank::toString($this->context->transport->user->access_rank)) ?>"><?php echo $val ?></span>
</div>
<?php if ($this->context->user->id == $this->context->transport->user->id): ?>
<?php if (PrivilegesHelper::confirm($this->context->user, Privilege::ViewUserEmail)): ?>
<div class="key-value email">
<span class="key">E-mail:</span>
<span class="value" title="<?php echo $val = ($this->context->transport->user->email_unconfirmed ? '(unconfirmed) ' . $this->context->transport->user->email_unconfirmed : $this->context->transport->user->email_confirmed ?: 'none specified') ?>"><?php echo $val ?></span>
<br>(only you can see this)
<br>(only you and staff can see this)
</div>
<?php endif ?>
</div>