Multiple fixes.

This commit is contained in:
sergiotarxz 2022-01-14 22:26:30 +01:00
parent 45386ebd75
commit 8710c592d6
4 changed files with 24 additions and 4 deletions

View File

@ -6,6 +6,23 @@ WriteMakefile(
INST_SCRIPT => './bin', INST_SCRIPT => './bin',
INST_BIN => './bin', INST_BIN => './bin',
test => { TESTS => 't/*.t t/*/*.t' }, 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 { package MY {

View File

@ -82,7 +82,7 @@ sub PrepareRoutes {
( Mojo::File::curfile->dirname->child('BeastBB')->child('public') ( Mojo::File::curfile->dirname->child('BeastBB')->child('public')
->to_string ); ->to_string );
print Data::Dumper::Dumper $self->renderer->paths; print Data::Dumper::Dumper $self->renderer->paths;
if ( !exists $self->config->{finished_install} ) { if ( !$self->config->{finished_install} ) {
$self->PrepareInstallationRoutes; $self->PrepareInstallationRoutes;
return; return;
} }

View File

@ -78,7 +78,7 @@ sub admin_user_create {
my $repeat_password = $self->param('repeat_password'); my $repeat_password = $self->param('repeat_password');
my $config = $self->config; my $config = $self->config;
$self->CheckDefinedParametersAdminCreation( return unless $self->CheckDefinedParametersAdminCreation(
username => $username, username => $username,
matrix_address => $matrix_address, matrix_address => $matrix_address,
password => $password, password => $password,
@ -126,16 +126,19 @@ sub admin_user_create {
'username', 'matrix_address', 'password', 'username', 'matrix_address', 'password',
'repeat_password' 'repeat_password'
}; };
print Data::Dumper::Dumper \%params;
if ( if (
!$self->AreAllParametersAreDefined( !$self->AreAllParametersAreDefined(
$username, $matrix_address, $password, $repeat_password $username, $matrix_address, $password, $repeat_password
) ) || !$username || !$matrix_address || !$password || !$repeat_password
) )
{ {
my $error_url = Mojo::URL->new('/') my $error_url = Mojo::URL->new('/')
->query( error => 'Not all required arguments were passed.' ); ->query( error => 'Not all required arguments were passed.' );
$self->redirect_to($error_url); $self->redirect_to($error_url);
return 0;
} }
return 1;
} }
} }

View File

@ -51,7 +51,7 @@
<a href="#" id="change_readable_password">Click here to toggle readable/unreadable the password</a> <a href="#" id="change_readable_password">Click here to toggle readable/unreadable the password</a>
<label for="repeat_password"><h3>Repeat password.</h3></label> <label for="repeat_password"><h3>Repeat password.</h3></label>
<input type="repeat_password" name="repeat_password" id="postgres_password"/> <input type="password" name="repeat_password" id="postgres_password"/>
<input type="submit" value="Submit"/> <input type="submit" value="Submit"/>
</form> </form>