From 8710c592d6d072bfeaf8f544297f76cb7451a9aa Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Fri, 14 Jan 2022 22:26:30 +0100 Subject: [PATCH] Multiple fixes. --- Makefile.PL | 17 +++++++++++++++++ lib/BeastBB.pm | 2 +- lib/BeastBB/Controller/Install.pm | 7 +++++-- templates/install/welcome.html.ep | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 191a6ed..66717dc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,6 +6,23 @@ WriteMakefile( INST_SCRIPT => './bin', INST_BIN => './bin', test => { TESTS => 't/*.t t/*/*.t' }, + PREREQ_PM => { + 'Mojolicious' => 0, + 'Mojo::Pg' => 0, + 'ExtUtils::MakeMaker' => 0, + 'Crypt::URandom' => 0, + 'DBD::Pg' => 0, + 'DBD::Mock' => 0, + 'Const::Fast' => 0, + 'Params::ValidationCompiler' => 0, + 'Types::Standard' => 0, + 'Crypt::Bcrypt::Easy' => 0, + 'DateTime' => 0, + 'DateTime::Format::Pg' => 0, + 'Test::Most' => 0, + 'Test::MockModule' => 0, + 'Test::Warnings' => 0, + }, ); package MY { diff --git a/lib/BeastBB.pm b/lib/BeastBB.pm index a962538..a685bca 100644 --- a/lib/BeastBB.pm +++ b/lib/BeastBB.pm @@ -82,7 +82,7 @@ sub PrepareRoutes { ( Mojo::File::curfile->dirname->child('BeastBB')->child('public') ->to_string ); print Data::Dumper::Dumper $self->renderer->paths; - if ( !exists $self->config->{finished_install} ) { + if ( !$self->config->{finished_install} ) { $self->PrepareInstallationRoutes; return; } diff --git a/lib/BeastBB/Controller/Install.pm b/lib/BeastBB/Controller/Install.pm index 6523edd..bc9294b 100644 --- a/lib/BeastBB/Controller/Install.pm +++ b/lib/BeastBB/Controller/Install.pm @@ -78,7 +78,7 @@ sub admin_user_create { my $repeat_password = $self->param('repeat_password'); my $config = $self->config; - $self->CheckDefinedParametersAdminCreation( + return unless $self->CheckDefinedParametersAdminCreation( username => $username, matrix_address => $matrix_address, password => $password, @@ -126,16 +126,19 @@ sub admin_user_create { 'username', 'matrix_address', 'password', 'repeat_password' }; + print Data::Dumper::Dumper \%params; if ( !$self->AreAllParametersAreDefined( $username, $matrix_address, $password, $repeat_password - ) + ) || !$username || !$matrix_address || !$password || !$repeat_password ) { my $error_url = Mojo::URL->new('/') ->query( error => 'Not all required arguments were passed.' ); $self->redirect_to($error_url); + return 0; } + return 1; } } diff --git a/templates/install/welcome.html.ep b/templates/install/welcome.html.ep index d561177..e0af168 100644 --- a/templates/install/welcome.html.ep +++ b/templates/install/welcome.html.ep @@ -51,7 +51,7 @@ Click here to toggle readable/unreadable the password - +