Skip to content

Commit

Permalink
When admin edit uers profile, let see him the tab to change avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Aug 19, 2017
1 parent f51ae40 commit f45aa4f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -28,19 +28,19 @@

<div class="tabs">
<ul id="KunenaUserEdit" class="nav nav-tabs">
<?php if ($this->profile->userid == $this->me->userid): ?>
<?php if ($this->profile->userid == $this->me->userid || $this->me->isAdmin() || $this->me->isModerator()): ?>
<li class="active">
<a href="#home" data-toggle="tab">
<?php echo JText::_('COM_KUNENA_PROFILE_EDIT_USER'); ?>
</a>
</li>
<?php endif; ?>
<li <?php if ($this->profile->userid != $this->me->userid) { echo 'class="active"'; }?>>
<li <?php if ($this->profile->userid != $this->me->userid && !$this->me->isAdmin() && !$this->me->isModerator()) { echo 'class="active"'; }?>>
<a href="#editprofile" data-toggle="tab">
<?php echo JText::_('COM_KUNENA_PROFILE_EDIT_PROFILE'); ?>
</a>
</li>
<?php if ($this->profile->userid == $this->me->userid): ?>
<?php if ($this->profile->userid == $this->me->userid || $this->me->isAdmin() || $this->me->isModerator()): ?>
<li>
<a href="#editavatar" data-toggle="tab">
<?php echo JText::_('COM_KUNENA_PROFILE_EDIT_AVATAR'); ?>
Expand All @@ -55,15 +55,15 @@
</ul>

<div id="KunenaUserEdit" class="tab-content">
<?php if ($this->profile->userid == $this->me->userid): ?>
<?php if ($this->profile->userid == $this->me->userid || $this->me->isAdmin() || $this->me->isModerator()): ?>
<div class="tab-pane fade in active" id="home">
<?php echo $this->subRequest('User/Edit/User'); ?>
</div>
<?php endif; ?>
<div class="tab-pane fade <?php if ($this->profile->userid != $this->me->userid) { echo 'in active'; }?>" id="editprofile">
<?php echo $this->subRequest('User/Edit/Profile'); ?>
</div>
<?php if ($this->profile->userid == $this->me->userid): ?>
<?php if ($this->profile->userid == $this->me->userid || $this->me->isAdmin() || $this->me->isModerator()): ?>
<div class="tab-pane fade" id="editavatar">
<?php echo $this->subRequest('User/Edit/Avatar'); ?>
</div>
Expand Down
Expand Up @@ -19,7 +19,7 @@
</h1>

<h2 class="pull-right">
<?php if ($this->profile->isAuthorised('edit') || $this->me->isAdmin()) : ?>
<?php if ($this->profile->isAuthorised('edit') || $this->me->isAdmin() || $this->me->isModerator()) : ?>
<?php echo $this->profile->getLink(
KunenaIcons::edit() . ' ' . JText::_('COM_KUNENA_EDIT'),
JText::_('COM_KUNENA_EDIT'), 'nofollow', 'edit', 'btn'
Expand Down
Expand Up @@ -19,7 +19,7 @@
</h1>

<h2 class="pull-right">
<?php if ($this->profile->isAuthorised('edit') || $this->me->isAdmin()) : ?>
<?php if ($this->profile->isAuthorised('edit') || $this->me->isAdmin() || $this->me->isModerator()) : ?>
<?php echo $this->profile->getLink(
KunenaIcons::edit() . ' ' . JText::_('COM_KUNENA_EDIT'),
JText::_('COM_KUNENA_EDIT'), 'nofollow', 'edit', 'btn btn-default'
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/kunena/user/user.php
Expand Up @@ -204,7 +204,7 @@ public function tryAuthorise($action='read', KunenaUser $user = null, $throw = t
}
break;
case 'edit' :
if (!isset($this->registerDate) || !$this->isMyself() && !$user->isAdmin())
if (!isset($this->registerDate) || !$this->isMyself() && !$user->isAdmin() && !$user->isModerator())
{
$exception = new KunenaExceptionAuthorise(JText::sprintf('COM_KUNENA_VIEW_USER_EDIT_AUTH_FAILED', $this->getName()), $user->exists() ? 403 : 401);
}
Expand Down

0 comments on commit f45aa4f

Please sign in to comment.