Preventing setting access rank to "nobody"
This commit is contained in:
parent
e0d01298fc
commit
52956b56c8
2 changed files with 4 additions and 0 deletions
|
@ -111,6 +111,9 @@ class Model_User extends RedBean_SimpleModel
|
|||
if (!in_array($accessRank, AccessRank::getAll()))
|
||||
throw new SimpleException('Invalid access rank type "' . $accessRank . '"');
|
||||
|
||||
if ($accessRank == AccessRank::Nobody)
|
||||
throw new SimpleException('Cannot set special accesss rank "' . $accessRank . '"');
|
||||
|
||||
return $accessRank;
|
||||
}
|
||||
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
<label class="left" for="access-rank">Access rank:</label>
|
||||
<select name="access-rank" id="access-rank">
|
||||
<?php foreach (AccessRank::getAll() as $rank): ?>
|
||||
<?php if ($rank == AccessRank::Nobody) continue ?>
|
||||
<?php if (($this->context->suppliedAccessRank != '' and $rank == $this->context->suppliedAccessRank) or ($this->context->suppliedAccessRank == '' and $rank == $this->context->transport->user->access_rank)): ?>
|
||||
<option value="<?php echo $rank ?>" selected="selected">
|
||||
<?php else: ?>
|
||||
|
|
Loading…
Reference in a new issue