correct rights for managing Characters (Issue #156)

This commit is contained in:
coderkun 2014-04-26 13:31:17 +02:00
commit 3be12fe26e
4 changed files with 9 additions and 8 deletions

View file

@ -30,7 +30,7 @@
</fieldset>
<fieldset>
<legend><?=_('Add role')?></legend>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) > 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<input type="submit" name="actions[addrole]" value="<?=_('Admin')?>" />
<input type="submit" name="actions[addrole]" value="<?=_('Moderator')?>" />
<?php endif ?>
@ -38,7 +38,7 @@
</fieldset>
<fieldset>
<legend><?=_('Remove role')?></legend>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) > 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<input type="submit" name="actions[removerole]" value="<?=_('Admin')?>" />
<input type="submit" name="actions[removerole]" value="<?=_('Moderator')?>" />
<?php endif ?>