From eae7431ea9ee9d87634b3938b5cf8b64ebdbfb5a Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Mon, 25 Apr 2022 17:13:23 +0200 Subject: corrections for last commit - fixed tests - added links to languages in about - raised log level of actions in I18N2 - improved actions script - corrected dependencies in Makefile.PL - updated changes --- lib/JWebmail/Controller/Webmail.pm | 2 +- lib/JWebmail/Model/ReadMails/MockJSON.pm | 6 +++--- lib/JWebmail/Plugin/I18N2.pm | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/JWebmail') diff --git a/lib/JWebmail/Controller/Webmail.pm b/lib/JWebmail/Controller/Webmail.pm index 3566c83..6e3ff8b 100644 --- a/lib/JWebmail/Controller/Webmail.pm +++ b/lib/JWebmail/Controller/Webmail.pm @@ -60,13 +60,13 @@ sub login { my $user = $v->required('userid')->size(4, 50)->param; my $passwd = $v->required('password')->size(4, 50)->like(qr/^.+$/)->param; # no new-lines - my $auth = $self->users->Auth(user => $user, password => $passwd); if ($v->has_error) { $self->res->code(400); return $self->render(action => 'noaction'); } + my $auth = $self->users->Auth(user => $user, password => $passwd); my $valid = _time { $self->users->verify_user($auth) } $self, 'verify user'; if ($valid) { diff --git a/lib/JWebmail/Model/ReadMails/MockJSON.pm b/lib/JWebmail/Model/ReadMails/MockJSON.pm index bb105d1..8918040 100644 --- a/lib/JWebmail/Model/ReadMails/MockJSON.pm +++ b/lib/JWebmail/Model/ReadMails/MockJSON.pm @@ -6,17 +6,17 @@ use utf8; use List::Util 'sum'; +use Mojo::JSON qw(decode_json); + use Role::Tiny::With; -use Mojo::JSON qw(decode_json); +use namespace::clean; use constant { VALID_USER => 'mockjson@example.com', VALID_PW => 'vwxyz', }; -use namespace::clean; - with 'JWebmail::Model::ReadMails::Role'; diff --git a/lib/JWebmail/Plugin/I18N2.pm b/lib/JWebmail/Plugin/I18N2.pm index 35367e9..c951eec 100644 --- a/lib/JWebmail/Plugin/I18N2.pm +++ b/lib/JWebmail/Plugin/I18N2.pm @@ -93,7 +93,7 @@ package JWebmail::Plugin::I18N2::Match { if (my $lang = $self->_i18n2_stash->{lang}) { @args = __add_option_no_override(lang => $lang, @args); } - return $self->SUPER::path_for(@args); + return $self->next::method(@args); } } @@ -118,7 +118,7 @@ sub register { { local $" = ','; - $i18n_log->debug("loaded languages (@{[$t->languages]})"); + $i18n_log->info("loaded languages (@{[$t->languages]})"); if (keys $conf->{languages}->%* > $t->languages) { $i18n_log->warn("missing languages"); @@ -137,7 +137,7 @@ sub register { my $res = $t->translate($lang, $word); unless ($res) { local $" = ' '; - $app->log->warn('[' . __PACKAGE__ . "] missing translation for '$lang':'$word' @{[ caller(1) ]}[0..2]"); + $app->log->warn('[' . __PACKAGE__ . "] missing translation for $lang:'$word' @{[ caller(1) ]}[0..2]"); } return $res; }); -- cgit v1.2.3