1 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm |
2 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm 2020-11-19 11:53:26.000000000 +0400 |
3 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm 2023-04-27 00:02:22.829000000 +0400 |
4 |
@@ -57,6 +57,7 @@ |
5 |
$dest = 'yumlogfile'; |
6 |
} elsif ($cdb->get_prop('yum', 'LogFile')) { |
7 |
$yum_datas{'trt'} = 'PSTU'; |
8 |
+ $yum_datas{'reconf'} = $cdb->get_value('UnsavedChanges', 'yes'); |
9 |
$dest = 'yumpostupg'; |
10 |
} else { |
11 |
# normal other trt |
12 |
@@ -113,6 +114,7 @@ |
13 |
if ( $trt eq 'PSTU') { |
14 |
if ($cdb->get_prop('yum', 'LogFile')) { |
15 |
$dest = 'yumpostupg'; |
16 |
+ $yum_datas{'reconf'} = $cdb->get_value('UnsavedChanges', 'yes'); |
17 |
} |
18 |
} |
19 |
|
20 |
@@ -198,12 +200,20 @@ |
21 |
|
22 |
if ( $trt eq 'PSTU') { |
23 |
|
24 |
+ my $reconf = $c->param('reconf') || 'yes'; |
25 |
$dest = 'yumpostupg'; |
26 |
- $res = $c->post_upgrade_reboot(); |
27 |
- $result .= $res unless $res eq 'OK'; |
28 |
- if ( ! $result ) { |
29 |
+ |
30 |
+ # effective reconfigure and reboot required |
31 |
+ if ( $reconf eq 'yes' ) { |
32 |
+ $res = $c->post_upgrade_reboot(); |
33 |
+ $result .= $res unless $res eq 'OK'; |
34 |
+ if ( ! $result ) { |
35 |
+ $yum_datas{trt} = 'SUC'; |
36 |
+ $result = $c->l('yum_SYSTEM_BEING_RECONFIGURED'); |
37 |
+ } |
38 |
+ } else { |
39 |
$yum_datas{trt} = 'SUC'; |
40 |
- $result = $c->l('yum_SYSTEM_BEING_RECONFIGURE'); |
41 |
+ $result = $c->l('yum_UPDATE_SUCCESS'); |
42 |
} |
43 |
} |
44 |
|
45 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex |
46 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2021-06-21 13:25:10.000000000 +0400 |
47 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2023-01-25 20:16:24.000000000 +0400 |
48 |
@@ -141,3 +141,14 @@ |
49 |
Logout => 'Logout', |
50 |
Home => 'Home', |
51 |
CSRF_VALIDATION_FAILURE => 'Error: CSRF token is invalid or outdated.', |
52 |
+Empty => 'Empty', |
53 |
+Active => 'Active', |
54 |
+MINUTE => 'Minute', |
55 |
+MINUTES => 'Minutes', |
56 |
+HOUR => 'Hour', |
57 |
+HOURS => 'Hours', |
58 |
+SMALL => 'Small', |
59 |
+MEDIUM => 'Medium', |
60 |
+LARGE => 'Large', |
61 |
+FIELD_INVALID_CHARS => 'A field you entered contains invalid characters.', |
62 |
+ |
63 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Yum/yum_en.lex smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Yum/yum_en.lex |
64 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Yum/yum_en.lex 2020-11-19 11:53:26.000000000 +0400 |
65 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Yum/yum_en.lex 2023-04-23 20:12:21.000000000 +0400 |
66 |
@@ -76,3 +76,4 @@ |
67 |
'yum_DESC_YUM_DOWNLOADONLY' => 'The rpm updates can be downloaded during the night, |
68 |
this will ease and give faster the yum update process |
69 |
(only enabled repositories will be used).', |
70 |
+'yum_UPDATE_SUCCESS' => 'The requested changes have been successfully implemented.', |
71 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm |
72 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm 2021-06-21 13:25:10.000000000 +0400 |
73 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Model/Main.pm 2023-04-25 21:09:06.000000000 +0400 |
74 |
@@ -29,8 +29,6 @@ |
75 |
$datas{'copyRight'} = 'All rights reserved'; |
76 |
|
77 |
$datas{'PwdSet'} = ($cdb->get('PasswordSet')->value eq "yes") || '0' ; |
78 |
- $datas{'Unsafe'} = ($cdb->get('bootstrap-console') and $cdb->get('bootstrap-console')->prop('Run') eq 'yes') || |
79 |
- ($cdb->get('UnsavedChanges') and $cdb->get('UnsavedChanges')->value eq 'yes'); |
80 |
|
81 |
$datas{'SystemName'} = $cdb->get("SystemName")->value; |
82 |
$datas{'DomainName'} = $cdb->get("DomainName")->value; |
83 |
@@ -42,6 +40,15 @@ |
84 |
} |
85 |
|
86 |
|
87 |
+sub reconf_needed { |
88 |
+ |
89 |
+ my $cdb = esmith::ConfigDB->open_ro() or die("can't open Config DB"); |
90 |
+ my $unsafe = ($cdb->get('bootstrap-console') and $cdb->get('bootstrap-console')->prop('Run') eq 'yes') || |
91 |
+ ($cdb->get('UnsavedChanges') and $cdb->get('UnsavedChanges')->value eq 'yes') || '0'; |
92 |
+ return $unsafe; |
93 |
+} |
94 |
+ |
95 |
+ |
96 |
sub check_credentials { |
97 |
|
98 |
my ($c, $username, $password) = @_; |
99 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr.pm |
100 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr.pm 2023-03-21 11:26:27.000000000 +0400 |
101 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr.pm 2023-04-25 23:50:43.986000000 +0400 |
102 |
@@ -26,12 +26,12 @@ |
103 |
use SrvMngr::Model::Main; |
104 |
|
105 |
|
106 |
-our $VERSION = '1.417'; |
107 |
+our $VERSION = '1.420'; |
108 |
$VERSION = eval $VERSION; |
109 |
|
110 |
use Exporter 'import'; |
111 |
our @EXPORT_OK = qw( |
112 |
- init_session get_mod_url theme_list |
113 |
+ init_session get_mod_url theme_list |
114 |
getNavigation ip_number is_normal_password email_simple |
115 |
mac_address_or_blank mac_address ip_number_or_blank |
116 |
lang_space get_routes_list subnet_mask get_reg_mask |
117 |
@@ -159,6 +159,10 @@ |
118 |
return undef; |
119 |
}); |
120 |
|
121 |
+ $self->helper( 'is_unsafe' => sub { |
122 |
+ return SrvMngr::Model::Main->reconf_needed(); |
123 |
+ }); |
124 |
+ |
125 |
$self->helper( 'is_logged_in' => sub { |
126 |
my $self = shift; |
127 |
if ( defined $self->session->{logged_in} ) { |
128 |
@@ -369,6 +373,7 @@ |
129 |
|
130 |
$if_admin->get('/yum')->to('yum#main')->name('yum'); |
131 |
$if_admin->post('/yum')->to('yum#do_display')->name('yumd1'); |
132 |
+ $if_admin->get('/yumd')->to('yum#do_display')->name('yumd'); |
133 |
$if_admin->post('/yumd')->to('yum#do_update')->name('yumu'); |
134 |
|
135 |
$if_admin->get('/welcome')->to('welcome#main')->name('welcome'); |
136 |
@@ -448,7 +453,6 @@ |
137 |
$c->session->{copyRight} = $c->l($datas{'copyRight'}); |
138 |
$c->session->{releaseVersion} = $datas{'releaseVersion'}; |
139 |
$c->session->{PwdSet} = $datas{'PwdSet'}; |
140 |
- $c->session->{Unsafe} = $datas{'Unsafe'}; |
141 |
$c->session->{SystemName} = $datas{'SystemName'}; |
142 |
$c->session->{DomainName} = $datas{'DomainName'}; |
143 |
$c->session->{Access} = $datas{'Access'}; |
144 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep |
145 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep 2021-06-21 13:25:10.000000000 +0400 |
146 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_info.html.ep 2023-04-25 23:16:50.729000000 +0400 |
147 |
@@ -3,7 +3,7 @@ |
148 |
<div class="sme-error"><h5> |
149 |
Warning: you have not yet changed the default system password.</h5></div> |
150 |
<% } %> |
151 |
- <% if ( $c->session->{Unsafe} ) { %> |
152 |
+ <% if ( $c->is_unsafe ) { %> |
153 |
<div class="sme-error"><h5> |
154 |
Warning: a reconfigure and reboot is required before proceeding! Failure to do so now |
155 |
may leave your system in an unknown state!</h5></div> |
156 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/yumpostupg.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/yumpostupg.html.ep |
157 |
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/yumpostupg.html.ep 2023-03-21 11:26:27.000000000 +0400 |
158 |
+++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/yumpostupg.html.ep 2023-04-23 21:55:27.000000000 +0400 |
159 |
@@ -18,18 +18,24 @@ |
160 |
</div> |
161 |
%} |
162 |
|
163 |
- <br><div class=success> |
164 |
+ <br><div class=success> |
165 |
+ <% my $btn = l('NEXT'); %> |
166 |
+ %= $c->render_to_string( inline => l 'yum_UPDATE_SUCCESS' ) |
167 |
+ % if ( $yum_datas->{reconf} eq 'yes' ) { |
168 |
%= $c->render_to_string( inline => l 'yum_HEADER_POSTUPGRADE_REQUIRED' ) |
169 |
- </div><br> |
170 |
+ <% $btn = l('RECONFIGURE'); %> |
171 |
+ % } |
172 |
+ </div><br> |
173 |
|
174 |
%= form_for 'yumd' => (method => 'POST') => begin |
175 |
|
176 |
<%= $c->render_to_string(inline => $c->show_yum_log()) %> |
177 |
|
178 |
%= hidden_field 'trt' => 'PSTU' |
179 |
+ %= hidden_field 'reconf' => $yum_datas->{reconf} |
180 |
<br> |
181 |
<div class='center'> |
182 |
- %= submit_button $c->l('RECONFIGURE'), class => 'action' |
183 |
+ %= submit_button "$btn", class => 'action' |
184 |
</div> |
185 |
|
186 |
% end |