diff options
-rw-r--r-- | lib/CatDap/Controller/admin.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CatDap/Controller/admin.pm b/lib/CatDap/Controller/admin.pm index 452efd9..dfea627 100644 --- a/lib/CatDap/Controller/admin.pm +++ b/lib/CatDap/Controller/admin.pm @@ -609,13 +609,13 @@ sub group : Local { sub group_modify : Local { my ( $self, $c, $group, $op, $attr, $value ) = @_; + $c->detach('/user/login') if not $c->user; + my $mainrole = 'account'; - if ( ! $c->check_user_roles('Account Admins') and ! $c->check_user_roles('Group Admins')) { - $c->forward('/user'); - } $mainrole = 'group' if (not $c->check_user_roles('Account Admins')); $c->stash( subpages => gensubpages($mainrole) ); + my @errors; my @entries; my $mesg; @@ -632,6 +632,10 @@ sub group_modify : Local { $c->detach('/admin/group'); } + if ( ! $c->check_user_roles('Account Admins') and ! $c->check_user_roles('Group Admins')) { + $c->forward('/user'); + } + if (defined $op and $op eq 'delete') { @entries = $mesg_group->entries; $entries[0]->delete( $attr => $value)->update; |