This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Controller/Admin.pm

21 lines
335 B
Perl
Raw Normal View History

package Pear::LocalLoop::Controller::Admin;
use Mojo::Base 'Mojolicious::Controller';
sub under {
my $c = shift;
if ( $c->is_user_authenticated ) {
return 1 if defined $c->current_user->administrator;
$c->redirect_to('/home');
} else {
$c->redirect_to('/');
}
return undef;
}
sub home {
my $c = shift;
}
1;