Commit b7e581b1 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

feature(frontend): pass more languages to post login

issue #1096
parent 2505a284
......@@ -582,6 +582,8 @@ sub status {
my $sth = $$CONNECTOR->dbh->prepare("UPDATE requests set status=? "
." WHERE id=?");
$status = substr($status,0,64);
$sth->execute($status, $self->{id});
$sth->finish;
......
......@@ -1274,10 +1274,15 @@ sub login {
$c->session('login' => $login);
my $expiration = $SESSION_TIMEOUT;
$expiration = $SESSION_TIMEOUT_ADMIN if $auth_ok->is_admin;
my @languages = I18N::LangTags::implicate_supers(
I18N::LangTags::Detect::detect()
);
my $header = $c->req->headers->header('accept-language');
my @languages2 = map {s/^(.*?)[;-].*/$1/; $_ } split /,/,$header;
Ravada::Request->post_login(
user => $auth_ok->name
, locale => [ I18N::LangTags::Detect::detect() ]
, locale => [@languages, @languages2]
);
$c->session(expiration => $expiration);
......
......@@ -980,8 +980,6 @@ sub start_node($node) {
,"[".$node->type."] "
.$node->name." Expecting connection") or exit;
eval { $node->run_command("hwclock","--hctosys") };
is($@,'',"Expecting no error setting clock on ".$node->name." ".($@ or ''));
$node->is_active(1);
$node->is_enabled(1);
for ( 1 .. 60 ) {
......@@ -989,6 +987,8 @@ sub start_node($node) {
last if $node2->is_active(1);
diag("Waiting for node ".$node->name." active ...") if !($_ % 10);
}
eval { $node->run_command("hwclock","--hctosys") };
is($@,'',"Expecting no error setting clock on ".$node->name." ".($@ or ''));
}
sub remove_node($node) {
......
......@@ -107,11 +107,24 @@ sub httpd_localhost {
return 0;
}
sub add_locales {
my @lang;
opendir my $ls,"etc/repository/iso" or die $!;
while (my $dir = readdir $ls) {
push @lang,($dir) if $dir =~ /^\w+/;
}
closedir $ls;
Ravada::Request->post_login( user => user_admin->id, locale => \@lang);
rvd_back->_process_requests_dont_fork();
}
##################################################################
for my $vm_name ('KVM') {
my $rvd_back = rvd_back();
add_locales();
local_urls();
my $vm = $rvd_back->search_vm($vm_name);
SKIP: {
......
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