Commit 1b18f188 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

fix(frontend): check admin rights

Check admin rights before register
Remove old unused code
Fixed login name couldn't contain numbers
Thanks to @jlopezramos for remporting

issue #715
parent 789c98f1
......@@ -520,6 +520,7 @@ get '/machine/display/#id' => sub {
any '/users/register' => sub {
my $c = shift;
return access_denied($c) if !$USER->is_admin();
return register($c);
};
......@@ -1350,15 +1351,6 @@ sub _search_requested_machine {
return $domain;
}
sub make_admin {
my $c = shift;
return login($c) if !_logged_in($c);
my $id = $c->stash('id');
Ravada::Auth::SQL::make_admin($id);
return $c->render(inline => "1");
}
sub register {
my $c = shift;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment