1 |
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/locales2-conf smeserver-manager-0.1.0/root/etc/e-smith/events/actions/locales2-conf |
2 |
--- smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/locales2-conf 2020-08-08 18:57:00.000000000 +0400 |
3 |
+++ smeserver-manager-0.1.0/root/etc/e-smith/events/actions/locales2-conf 2020-08-17 20:07:18.746000000 +0400 |
4 |
@@ -57,8 +57,9 @@ |
5 |
|
6 |
my $long_pm = I18NMODULES . "/$module/$lang". '.pm'; |
7 |
if ( -f $long_pm ) { |
8 |
- # .pm file newer than .lex |
9 |
+ # .pm file not newer than .lex |
10 |
next if ((stat($long_lex))[9] < (stat($long_pm))[9]); |
11 |
+ print "locales2: error cp\n" unless system("cp -f $long_pm ${long_pm}.svg") == 0; |
12 |
} |
13 |
|
14 |
open(FIL, '>:encoding(UTF-8)', $long_pm) |
15 |
@@ -68,9 +69,9 @@ |
16 |
print FIL "use strict;\nuse warnings;\nuse utf8;\nuse Mojo::Base 'SrvMngr::I18N';\n\n"; |
17 |
print FIL "use SrvMngr::I18N::Modules::General::${lang};\n\nmy %lexicon = (\n"; |
18 |
|
19 |
- #------------------------- |
20 |
+ #-------------------- |
21 |
# copy lexicon to pm |
22 |
- #------------------------- |
23 |
+ #-------------------- |
24 |
open(FIL2, '<:encoding(UTF-8)', $long_lex) |
25 |
or die "Couldn't open ", $long_lex, " for reading.\n"; |
26 |
while ( <FIL2> ) { |
27 |
@@ -83,6 +84,20 @@ |
28 |
print FIL " %lexicon\n);\n\n\n1;\n"; |
29 |
|
30 |
close FIL; |
31 |
- print "Lexicon $lang for $module ($lex) written to ${lang}.pm\n"; |
32 |
+ |
33 |
+ #------------------------- |
34 |
+ # eval and restore if NOT OK |
35 |
+ #------------------------- |
36 |
+ if ( eval "use lib '".I18NMODULES."/../../../'; require '$long_pm';" ) { |
37 |
+ print "Lexicon $lang for $module ($lex) written to ${lang}.pm\n"; |
38 |
+ if ( -f ${long_pm}.'.svg' ) { |
39 |
+ print "locales2: error rm" unless system("rm -f ${long_pm}.svg") == 0; |
40 |
+ } |
41 |
+ } else { |
42 |
+ print "ERROR: Lexicon $lang for $module ($lex) NOT written to ${lang}.pm\n"; |
43 |
+ if ( -f ${long_pm}.'.svg' ) { |
44 |
+ print "locales2: error mv" unless system("mv -f ${long_pm}.svg $long_pm") == 0; |
45 |
+ } |
46 |
+ } |
47 |
} |
48 |
} |
49 |
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/routes2-conf smeserver-manager-0.1.0/root/etc/e-smith/events/actions/routes2-conf |
50 |
--- smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/routes2-conf 2020-08-08 18:57:00.000000000 +0400 |
51 |
+++ smeserver-manager-0.1.0/root/etc/e-smith/events/actions/routes2-conf 2020-08-11 20:14:04.215000000 +0400 |
52 |
@@ -65,7 +65,7 @@ |
53 |
|
54 |
if (defined $method and defined $url and |
55 |
defined $ctlact and defined $name) { |
56 |
- my $key = $file2.'_'.$name; |
57 |
+ my $key = $file2.'+'.$name; |
58 |
my $rec = $rtdb->get($key) || |
59 |
$rtdb->new_record($key, { type => 'route' } ); |
60 |
|
61 |
diff -aurN smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex |
62 |
--- smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2020-08-08 18:57:00.000000000 +0400 |
63 |
+++ smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2020-08-16 22:45:23.398000000 +0400 |
64 |
@@ -136,4 +136,7 @@ |
65 |
'FM_MAC_ADDRESS1' => 'You must provide a MAC address.', |
66 |
'FM_MAC_ADDRESS2' => 'The MAC address you provided was not valid.', |
67 |
'FM_ERR_UNEXPECTED_DESC' => 'Error: unexpected or missing characters in description', |
68 |
-'swt_THEME' => 'Theme', |
69 |
+swt_THEME => 'Theme', |
70 |
+acs_NO => 'Not Authorized', |
71 |
+acs_LOGIN => 'Login required', |
72 |
+acs_ADMIN => 'Admin rights required', |
73 |
diff -aurN smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex |
74 |
--- smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex 2020-08-08 18:57:00.000000000 +0400 |
75 |
+++ smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex 2020-08-16 22:45:46.255000000 +0400 |
76 |
@@ -136,3 +136,6 @@ |
77 |
'FM_MAC_ADDRESS1' => 'Vous devez taper une adresse Ethernet.', |
78 |
'FM_MAC_ADDRESS2' => 'L\'adresse Ethernet que vous avez tapé n\'est pas valide.', |
79 |
'FM_ERR_UNEXPECTED_DESC' => 'ERREUR : caractères invalides ou manquants dans la description.', |
80 |
+acs_NO => 'Non autorisé', |
81 |
+acs_LOGIN => 'Connexion obligatoire', |
82 |
+acs_ADMIN => 'Droits d\'administration requis', |
83 |
diff -aurN smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr.pm |
84 |
--- smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr.pm 2020-08-08 18:57:00.000000000 +0400 |
85 |
+++ smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr.pm 2020-08-16 22:44:45.920000000 +0400 |
86 |
@@ -118,7 +118,7 @@ |
87 |
|
88 |
$self->helper( 'auth_fail' => sub { |
89 |
my $self = shift; |
90 |
- my $message = shift || "Not Authorized"; |
91 |
+ my $message = shift || $self->l('acs_NO'); |
92 |
$self->flash( error => $message ); |
93 |
$self->redirect_to( $self->home_page ); |
94 |
return 0; |
95 |
@@ -188,7 +188,7 @@ |
96 |
|
97 |
my $if_logged_in = $r->under( sub { |
98 |
my $c =shift; |
99 |
- return $c->is_logged_in || $c->auth_fail($c->l("Login required")); |
100 |
+ return $c->is_logged_in || $c->auth_fail($c->l("acs_LOGIN")); |
101 |
}); |
102 |
$if_logged_in->get('/review')->to('review#main')->name('review'); |
103 |
$if_logged_in->get('/logout')->to('logout#logout')->name('logout'); |
104 |
@@ -197,7 +197,7 @@ |
105 |
|
106 |
my $if_admin = $r->under( sub { |
107 |
my $c =shift; |
108 |
- return $c->is_admin || $c->auth_fail($c->l("Admin rights required")); |
109 |
+ return $c->is_admin || $c->auth_fail($c->l("acs_ADMIN")); |
110 |
}); |
111 |
|
112 |
$if_admin->get('/backup')->to('backup#main')->name('backup'); |