MT#4609 extend checks when editing the own admin user to prevent locking oneself out

apogrebennyk/3_1_force_outbound
Lars Dieckow 12 years ago
parent 49719fd901
commit 79b7304f5b

@ -168,11 +168,10 @@ sub edit :Chained('base') :PathPart('edit') :Args(0) {
);
if ($posted && $form->validated) {
try {
# don't allow to take away own master rights, otherwise he'll not be
# don't allow to take away own master rights/write permission, otherwise he'll not be
# able to manage any more admins
if($c->stash->{administrator}->id == $c->user->id) {
delete $form->values->{is_master};
delete $form->values->{is_active};
delete $form->values->{$_} for qw(is_master is_active read_only);
}
if($c->user->is_superuser) {

Loading…
Cancel
Save