parent
44eeaa80e6
commit
1b179fb08d
|
@ -3,7 +3,8 @@ package CharmBoard;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious', -signatures;
|
||||
use CharmBoard::Model::Schema;
|
||||
|
@ -37,11 +38,11 @@ sub startup {
|
|||
# ? this could maybe be a given/when
|
||||
{
|
||||
my ($_dsn, $_unicode);
|
||||
if ($self->config->{database}->{type} ~~ 'sqlite') {
|
||||
if (lc($self->config->{database}->{type}) eq 'sqlite') {
|
||||
$_dsn = "dbi:SQLite:" . $config->{database}->{name};
|
||||
$_unicode = "sqlite_unicode"
|
||||
|
||||
} elsif ($self->config->{database}->{type} ~~ 'mariadb') {
|
||||
} elsif (lc($self->config->{database}->{type}) eq 'mariadb') {
|
||||
$_dsn = "dbi:mysql:" . $config->{database}->{name};
|
||||
$_unicode = "mysql_enable_utf"
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Controller::Index;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
use Tree::Simple;
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Controller::Login;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
use CharmBoard::Model::Crypt::Password;
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Controller::Logout;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Controller::NewThread;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Controller::Register;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
use CharmBoard::Model::Crypt::Password;
|
||||
|
@ -54,6 +55,7 @@ sub register_do {
|
|||
$emailCheck = $self->schema->resultset('Users')
|
||||
->search({ email => $email })->single;
|
||||
|
||||
# TODO: compress this into something less redundant
|
||||
($userCheck && $emailCheck) eq undef
|
||||
or die "Username already in use.\nemail already in use.";
|
||||
($userCheck) eq undef
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Controller::ViewSubf;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Crypt::Password;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Authen::Passphrase::Argon2;
|
||||
use CharmBoard::Model::Crypt::Seasoning;
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Crypt::Seasoning;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Math::Random::Secure qw(irand);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Schema);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Set::Categories;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Set::Subforums;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Set::Threads;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base 'DBIx::Class::ResultSet';
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Categories;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Core);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Posts;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Core);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Session;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Core);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Subforums;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Core);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Threads;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Core);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Users;
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use base qw(DBIx::Class::Core);
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use experimental qw(try smartmatch);
|
||||
use experimental qw(try);
|
||||
use feature ':5.20';
|
||||
|
||||
use Mojo::File qw(curfile);
|
||||
use lib curfile->dirname->sibling('lib')->to_string;
|
||||
|
|
Loading…
Reference in New Issue