Browse Source

+ LDV::Helpers->access_allowed

master
Alex 'AdUser' Z 7 years ago
parent
commit
9a9a866b15
  1. 10
      lib/LDV/Helpers.pm

10
lib/LDV/Helpers.pm

@ -28,6 +28,16 @@ sub register {
my ($c, $unixtime) = @_; my ($c, $unixtime) = @_;
return strftime("%Y-%m-%d %H:%M", localtime($unixtime)); return strftime("%Y-%m-%d %H:%M", localtime($unixtime));
}); });
$app->helper(access_allowed => sub {
my ($c, $level) = @_;
$level //= '';
if ($level eq 'user' and not $c->session('useruid')) {
$c->redirect_to('/user/eaccess');
return;
}
return 1;
});
} }
1; 1;

Loading…
Cancel
Save