/[smeserver]/rpms/smeserver-manager/sme10/smeserver-manager-0.1.0-remotax_users_logs.patch
ViewVC logotype

Contents of /rpms/smeserver-manager/sme10/smeserver-manager-0.1.0-remotax_users_logs.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sat Feb 29 19:08:19 2020 UTC (4 years, 8 months ago) by michel
Branch: MAIN
CVS Tags: smeserver-manager-0_1_0-28_el7_sme, smeserver-manager-0_1_0-25_el7_sme, smeserver-manager-0_1_2-1_el7_sme, smeserver-manager-0_1_0-26_el7_sme, smeserver-manager-0_1_0-30_el7_sme, smeserver-manager-0_1_0-27_el7_sme, smeserver-manager-0_1_0-31_el7_sme, smeserver-manager-0_1_0-12_el7_sme, smeserver-manager-0_1_0-13_el7_sme, smeserver-manager-0_1_0-11_el7_sme, smeserver-manager-0_1_0-14_el7_sme, smeserver-manager-0_1_0-17_el7_sme, smeserver-manager-0_1_0-19_el7_sme, smeserver-manager-0_1_0-29_el7_sme, smeserver-manager-0_1_0-23_el7_sme, smeserver-manager-0_1_0-20_el7_sme, smeserver-manager-0_1_0-24_el7_sme, smeserver-manager-0_1_0-21_el7_sme, smeserver-manager-0_1_0-16_el7_sme, smeserver-manager-0_1_0-15_el7_sme, smeserver-manager-0_1_0-18_el7_sme, smeserver-manager-0_1_0-22_el7_sme
make: « clog » est à jour.

1 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm
2 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm 2020-01-24 18:57:07.000000000 +0400
3 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm 2020-02-23 21:24:49.000000000 +0400
4 @@ -141,34 +141,37 @@
5 $out .= sprintf "<PRE>";
6
7 open (my $cfgrep, '<', $configreportfile) or die "Could not find temporary config report file!";
8 - #open(REPORT, "/var/$report_type |");
9
10 while (<$cfgrep>) {
11 $out .= sprintf("%s", $_);
12 }
13 -
14 - $out .= sprintf "</PRE>";
15
16 - # that would be too easy!?
17 - #$out .= sprintf("<a href=\"bugreport?action=download_config_report\"> %s </a>", $c->l('bugr_Download this report'));
18 + $out .= sprintf "</PRE>";
19
20 return $out;
21
22 }
23
24 sub download_config_report {
25 +
26 my $c = shift;
27 -# my $q = $c->{'cgi'};
28 +
29 + my $filesize =-s $configreportfile;
30 +
31 open (DLFILE, "<$configreportfile") or die "Could not access temporary file for config report!";
32 my @fileholder = <DLFILE>;
33 close (DLFILE) || Error ('close', 'file');
34 +
35 print "Content-Type:text/plain\n";#application/x-downloadn";
36 - print "Content-Disposition:attachment;filename=" . basename($configreportfile);
37 - print "\n\n";
38 - print @fileholder ;
39 + print "Content-Disposition:attachment;filename=" . basename($configreportfile) . "\n";
40 + print "Content-Length:" . $filesize;
41 + print "\n\n";
42 + print @fileholder ;
43 +
44 return "";
45
46 }
47
48 +
49 1;
50
51 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm
52 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm 2020-01-25 20:23:22.000000000 +0400
53 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm 2020-02-29 20:00:29.000000000 +0400
54 @@ -6,10 +6,8 @@
55
56 use Locale::gettext;
57 use SrvMngr::I18N;
58 -use SrvMngr qw(theme_list init_session_cgi);
59 +use SrvMngr qw( theme_list init_session_cgi is_normal_password );
60
61 -#use esmith::FormMagick qw( validate_password );
62 -use CGI::FormMagick::Validator qw( call_fm_validation );
63 use esmith::AccountsDB;
64 use esmith::ConfigDB;
65 use esmith::DomainsDB;
66 @@ -425,9 +423,7 @@
67 return "OK";
68 }
69
70 -# $reason = CGI::FormMagick::validator->call_fm_validation('password', $pass, undef);
71 -#??? $reason = call_fm_validation('password', $pass, undef);
72 -
73 + $reason = is_normal_password($c, $pass, undef);
74 return $reason unless ($reason eq "OK");
75 return "OK" unless ($strength eq "strong");
76
77 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm
78 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm 2020-01-24 18:56:26.000000000 +0400
79 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm 2020-02-19 21:09:26.000000000 +0400
80 @@ -13,10 +13,10 @@
81
82 sub whatever {
83 my $c = shift;
84 - $c->app->log->info($c->log_req);
85 -
86 my $whatever = $c->param('whatever');
87
88 + $c->app->log->info($c->log_req . ' ' . $whatever);
89 +
90 $c->render(text => "whatever: /$whatever did not match.", status => 404);
91 };
92
93 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm
94 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm 1970-01-01 04:00:00.000000000 +0400
95 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm 2020-02-26 18:43:10.000000000 +0400
96 @@ -0,0 +1,497 @@
97 +package SrvMngr::Controller::Remoteaccess;
98 +
99 +use strict;
100 +use warnings;
101 +use Mojo::Base 'Mojolicious::Controller';
102 +
103 +use Locale::gettext;
104 +use SrvMngr::I18N;
105 +
106 +use SrvMngr qw(theme_list init_session_cgi ip_number);
107 +
108 +use esmith::ConfigDB;
109 +use esmith::util;
110 +#use esmith::cgi;
111 +use File::Basename;
112 +use Exporter;
113 +use Carp;
114 +use Socket qw( inet_aton );
115 +
116 +#our @ISA = qw(esmith::FormMagick Exporter);
117 +
118 +our @EXPORT = qw( networkAccess_list passwordLogin_list get_ssh_permit_root_login get_ssh_access get_telnet_mode
119 + get_ftp_access get_pptp_sessions get_ftp_password_login_access
120 + get_value get_prop get_ssh_password_auth
121 + validate_network_and_mask ip_number_or_blank subnet_mask_or_blank
122 + get_ipsecrw_sessions pptp_and_dhcp_range
123 +);
124 +
125 +our $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
126 +
127 +
128 +sub main {
129 +
130 + my $c = shift;
131 + $c->app->log->info($c->log_req);
132 +
133 + my $title = $c->l('rma_FORM_TITLE');
134 + my $notif = '';
135 + my %rma_datas = ();
136 +
137 + #$rma_datas{ipsecrwSess} = $c->get_ipsecrw_sessions();
138 + $rma_datas{pptpSessions} = $c->get_pptp_sessions();
139 + $rma_datas{sshAccess} = $c->get_ssh_access();
140 + $rma_datas{sshPermitRootLogin} = $c->get_ssh_permit_root_login();
141 + $rma_datas{sshPasswordAuthentication} = $c->get_ssh_password_auth();
142 + $rma_datas{sshTCPPort} = $c->get_ssh_port();
143 + $rma_datas{ftpAccess} = $c->get_ftp_access();
144 + $rma_datas{ftpPasswordAccess} = $c->get_ftp_password_login_access();
145 + #$rma_datas{telnetAccess} = $c->get_telnet_access;
146 +
147 + $c->stash( title => $title, notif => $notif, rma_datas => \%rma_datas );
148 + $c->render(template => 'remoteaccess');
149 +
150 +};
151 +
152 +
153 +sub do_action {
154 +
155 + my $c = shift;
156 + $c->app->log->info($c->log_req);
157 +
158 + my $title = $c->l('rma_FORM_TITLE');
159 + my ($result, $res, $trt) = '';
160 + my %rma_datas = ();
161 +
162 + $rma_datas{ipsecrwSess} = ($c->param ('IpsecrwSess') || '');
163 + $rma_datas{ipsecrwReset} = ($c->param ('IpsecrwReset') || '');
164 +
165 + $rma_datas{pptpSessions} = ($c->param ('PptpSessions') || '0');
166 +
167 + $rma_datas{validFromNetwork} = ($c->param ('ValidFromNetwork') || '');
168 + $rma_datas{validFromMask} = ($c->param ('ValidFromMask') || '');
169 +## my @remove = $q->param('validFromRemove'); ???????? the first one only !!
170 + my @vals = $c->param ('Remove_nets');
171 + $rma_datas{remove_nets} = join ',', @vals;
172 +
173 + $rma_datas{sshaccess} = ($c->param ('SshAccess') || 'off');
174 + $rma_datas{sshPermitRootLogin} = ($c->param ('SshPermitRootLogin') || 'no');
175 + $rma_datas{sshPasswordAuthentication} = ($c->param ('SshPasswordAuthentication') || 'no');
176 + $rma_datas{sshTCPPort} = ($c->param ('SshTCPPort') || '22');
177 +
178 + $rma_datas{ftpAccess} = ($c->param ('FtpAccess') || 'off');
179 + $rma_datas{ftpPasswordAccess} = ($c->param ('FtpPasswordAccess') || 'private');
180 +
181 + $rma_datas{telnetAccess} = ($c->param ('TelnetAccess') || 'off');
182 +
183 + # validate
184 + my $v = $c->validation;
185 + return $c->render('remoteaccess') unless $v->has_data;
186 +
187 + $v->optional('PptpSessions')->num(0, 999)->is_valid;
188 + $v->optional('ValidFromNetwork')->size(7, 15)->is_valid;
189 + $v->optional('ValidFromMask')->size(7, 15)->is_valid;
190 + $v->required('SshTCPPort')->num(1, 65535)->is_valid;
191 +
192 + $result .= 'field validation error' if $v->has_error;
193 +
194 + if ( ! $result ) {
195 +
196 + # controls
197 + $res = pptp_and_dhcp_range( $c, $rma_datas{pptpSessions} );
198 + $result .= $res unless $res eq 'OK';
199 +
200 + $res = ip_number_or_blank( $c, $rma_datas{validFromNetwork} );
201 + $result .= $res unless $res eq 'OK';
202 +
203 + $res = subnet_mask_or_blank( $c, $rma_datas{validFromMask} );
204 + $result .= $res unless $res eq 'OK';
205 +
206 + $res = validate_network_and_mask( $c, $rma_datas{validFromNetwork}, $rma_datas{validFromMask} );
207 + $result .= $res unless $res eq 'OK';
208 +
209 + #$result .= ' blocked for testing !' . $rma_datas{remove_nets};
210 + }
211 +
212 + if ( ! $result ) {
213 + $res = change_settings( $c, %rma_datas );
214 + $result .= $res unless $res eq 'OK';
215 + }
216 +
217 + if ( ! $result ) {
218 + $result = $c->l('rma_ACTION_SUCCEEDED');
219 + $trt = 'SUC';
220 + }
221 +
222 + $c->stash( title => $title, notif => $result, rma_datas => \%rma_datas );
223 +
224 + if ( $trt ne 'SUC' ) {
225 + return $c->render(template => 'remoteaccess');
226 + }
227 +
228 + $c->redirect_to('/remoteaccess');
229 +
230 +};
231 +
232 +
233 +sub networkAccess_list {
234 + my $c = shift;
235 + return [[ $c->l('rma_NO_ACCESS') => 'off'],
236 + [ $c->l('NETWORKS_ALLOW_LOCAL') => 'private'],
237 + [ $c->l('NETWORKS_ALLOW_PUBLIC') => 'public']];
238 +}
239 +
240 +
241 +sub passwordLogin_list {
242 + my $c = shift;
243 + return [[$c->l('rma_PASSWORD_LOGIN_PRIVATE') => 'private'],
244 + [$c->l('rma_PASSWORD_LOGIN_PUBLIC') => 'public']];
245 +}
246 +
247 +
248 +sub get_prop {
249 +
250 + my ($c, $item, $prop) = @_;
251 + warn "You must specify a record key" unless $item;
252 + warn "You must specify a property name" unless $prop;
253 + my $record = $db->get($item) or warn "Couldn't get record for $item";
254 + return $record ? $record->prop($prop) : undef;
255 +}
256 +
257 +
258 +sub get_value {
259 +
260 + my $c = shift;
261 + my $item = shift;
262 + return ($db->get($item)->value());
263 +}
264 +
265 +
266 +sub get_ftp_access {
267 +
268 + my $status = get_prop('','ftp','status') || 'disabled';
269 + return 'off' unless $status eq 'enabled';
270 +
271 + my $access = get_prop('','ftp','access') || 'private';
272 + return ($access eq 'public') ? 'normal' : 'private';
273 +}
274 +
275 +
276 +sub get_pptp_sessions {
277 +
278 + my $status = get_prop('','pptpd','status');
279 + if (defined($status) && ($status eq 'enabled')) {
280 + return(get_prop('','pptpd','sessions') || 'no');
281 + }
282 + else {
283 + return('0');
284 + }
285 +}
286 +
287 +
288 +sub get_ssh_permit_root_login {
289 + return(get_prop('','sshd','PermitRootLogin') || 'no');
290 +}
291 +
292 +
293 +sub get_ssh_password_auth {
294 + return(get_prop('','sshd','PasswordAuthentication') || 'yes');
295 +}
296 +
297 +
298 +sub get_ssh_access {
299 +
300 + my $status = get_prop('','sshd','status');
301 + if (defined($status) && ($status eq 'enabled')) {
302 + my $access = get_prop('','sshd','access');
303 + $access = ($access eq 'public') ? 'public' : 'private';
304 + return($access);
305 + }
306 + else {
307 + return('off');
308 + }
309 +}
310 +
311 +
312 +sub get_ssh_port {
313 + return(get_prop('$c','sshd','TCPPort') || '22');
314 +}
315 +
316 +
317 +sub get_ftp_password_login_access {
318 +
319 + my $status = get_prop('','ftp','status') || 'disabled';
320 + return 'private' unless $status eq 'enabled';
321 +
322 + my $access = get_prop('','ftp','LoginAccess') || 'private';
323 +
324 + return ($access eq 'public') ? 'public' : 'private';
325 +}
326 +
327 +
328 +sub get_telnet_mode {
329 +
330 + my $telnet = $db->get('telnet');
331 + return('off') unless $telnet;
332 + my $status = $telnet->prop('status') || 'disabled';
333 + return('off') unless $status eq 'enabled';
334 + my $access = $telnet->prop('access') || 'private';
335 + return ($access eq "public") ? "public" : "private";
336 +}
337 +
338 +
339 +sub get_ipsecrw_sessions {
340 +
341 + my $status = $db->get('ipsec')->prop('RoadWarriorStatus');
342 + if (defined($status) && ($status eq 'enabled')) {
343 + return($db->get('ipsec')->prop('RoadWarriorSessions') || '0');
344 + }
345 + else {
346 + return('0');
347 + }
348 +}
349 +
350 +
351 +sub get_ipsecrw_status {
352 +
353 + return undef unless ( $db->get('ipsec'));
354 + return $db->get('ipsec')->prop('RoadWarriorStatus');
355 +
356 +}
357 +
358 +
359 +sub pptp_and_dhcp_range {
360 +
361 + my $c = shift;
362 + my $val = shift || 0;
363 + my $dhcp_status = $db->get_prop('dhcpd','status') || 'disabled';
364 + my $dhcp_end = $db->get_prop('dhcpd','end') || '';
365 + my $dhcp_start = $db->get_prop('dhcpd','start') || '';
366 +
367 + if ( $dhcp_status eq 'enabled' ) {
368 + my $ip_start = unpack 'N', inet_aton($dhcp_start);
369 + my $ip_end = unpack 'N', inet_aton($dhcp_end);
370 + my $ip_count = $ip_end - $ip_start;
371 + return 'OK' if( $val < $ip_count );
372 + return $c->l('rma_NUMBER_OF_PPTP_CLIENTS_MUST_BE_LESSER_THAN_NUMBER_OF_IP_IN_DHCP_RANGE');
373 + } else {
374 + return 'OK';
375 + }
376 +}
377 +
378 +
379 +sub _get_valid_from {
380 +
381 + my $c = shift;
382 +
383 + my $rec = $db->get('httpd-admin');
384 + return undef unless($rec);
385 + my @vals = (split ',', ($rec->prop('ValidFrom') || ''));
386 + return @vals;
387 +}
388 +
389 +
390 +sub ip_number_or_blank {
391 +
392 + my $c = shift;
393 + my $ip = shift;
394 +
395 + if (!defined($ip) || $ip eq "") {
396 + return 'OK';
397 + }
398 + return ip_number($c, $ip);
399 +}
400 +
401 +
402 +sub subnet_mask_or_blank {
403 +
404 + my $c = shift;
405 + my $mask = shift;
406 +
407 + if (ip_number_or_blank($c, $mask) eq 'OK') {
408 + return "OK";
409 + }
410 + return $c->l('rma_INVALID_SUBNET_MASK') . " (" . $mask . ")";
411 +}
412 +
413 +
414 +sub validate_network_and_mask {
415 +
416 + my $c = shift;
417 + my $net = shift || "";
418 + my $mask = shift || "";
419 +
420 + if ($net xor $mask) {
421 + return $c->l('rma_ERR_INVALID_PARAMS' . " (" . $net."/".$mask . ")");
422 + }
423 + return 'OK';
424 +}
425 +
426 +
427 +sub change_settings {
428 +
429 + my ($c, %rma_datas) = @_;
430 +
431 + #------------------------------------------------------------
432 + # good; go ahead and change the access.
433 + #------------------------------------------------------------
434 +
435 + my $rec = $db->get('telnet');
436 + if($rec) {
437 + if ($rma_datas{telnetAccess} eq "off") {
438 + $rec->set_prop('status','disabled');
439 + } else {
440 + $rec->set_prop('status','enabled');
441 + $rec->set_prop('access', $rma_datas{telnetAccess});
442 + }
443 + }
444 +
445 + $rec = $db->get('sshd') || $db->new_record('sshd', {type => 'service'});
446 + $rec->set_prop('TCPPort', $rma_datas{sshTCPPort});
447 + $rec->set_prop('status', ( $rma_datas{sshaccess} eq "off" ? 'disabled' : 'enabled'));
448 + $rec->set_prop('access', $rma_datas{sshaccess});
449 + $rec->set_prop('PermitRootLogin', $rma_datas{sshPermitRootLogin});
450 + $rec->set_prop('PasswordAuthentication', $rma_datas{sshPasswordAuthentication});
451 +
452 +
453 + $rec = $db->get('ftp');
454 + if($rec) {
455 + if ($rma_datas{ftpAccess} eq "off") {
456 + $rec->set_prop('status', 'disabled');
457 + $rec->set_prop('access', 'private');
458 + $rec->set_prop('LoginAccess', 'private');
459 + } elsif ($rma_datas{ftpAccess} eq "normal") {
460 + $rec->set_prop('status', 'enabled');
461 + $rec->set_prop('access', 'public');
462 + $rec->set_prop('LoginAccess', $rma_datas{ftpPasswordAccess});
463 + } else {
464 + $rec->set_prop('status', 'enabled');
465 + $rec->set_prop('access', 'private');
466 + $rec->set_prop('LoginAccess', $rma_datas{ftpPasswordAccess});
467 + }
468 + }
469 +
470 + if ($rma_datas{pptpSessions} == 0) {
471 + $db->get('pptpd')->set_prop('status', 'disabled');
472 + } else {
473 + $db->get('pptpd')->set_prop('status', 'enabled');
474 + $db->get('pptpd')->set_prop('sessions', $rma_datas{pptpSessions});
475 + }
476 +
477 + if ( $rma_datas{validFromNetwork} && $rma_datas{validFromMask} ) {
478 + unless (add_new_valid_from( $c, $rma_datas{validFromNetwork}, $rma_datas{validFromMask} )) {
479 + return $c->l('rma_ERROR_UPDATING_CONFIGURATION') . 'new net';
480 + }
481 + }
482 +
483 +
484 + if ( $rma_datas{remove_nets} ) {
485 + unless (remove_valid_from( $c, $rma_datas{remove_nets} )) {
486 + return $c->l('rma_ERROR_UPDATING_CONFIGURATION') . 'del net';
487 + }
488 + }
489 +
490 + # reset ipsec roadwarrior CA,server,client certificates
491 + if ($rma_datas{ipsecrwReset}) {
492 + system('/sbin/e-smith/roadwarrior', 'reset_certs') == 0 or
493 + return $c->l('rma_ERROR_UPDATING_CONFIGURATION') . 'rst ipsec';
494 + }
495 +
496 + if ( $rma_datas{ipsecrwSess} ) {
497 + set_ipsecrw_sessions( $c, $rma_datas{ipsecrwSess} );
498 + }
499 +
500 + unless ( system( "/sbin/e-smith/signal-event", "remoteaccess-update" ) == 0 ) {
501 + return $c->l('rma_ERROR_UPDATING_CONFIGURATION');
502 + }
503 +
504 + return 'OK';
505 +}
506 +
507 +
508 +sub set_ipsecrw_sessions {
509 +
510 + my $c = shift;
511 + my $sessions = shift;
512 +
513 + if (defined $sessions) {
514 + $db->get('ipsec')->set_prop('RoadWarriorSessions', $sessions);
515 + if (int($sessions) > 0) {
516 + $db->get('ipsec')->set_prop('RoadWarriorStatus', 'enabled');
517 + }
518 + }
519 + return '';
520 +}
521 +
522 +
523 +sub add_new_valid_from {
524 +
525 + my $c = shift;
526 + my $net = shift;
527 + my $mask = shift;
528 +
529 + my $rec = $db->get('httpd-admin');
530 + return $c->error('ERR_NO_RECORD') unless $rec;
531 +
532 + my $prop = $rec->prop('ValidFrom') || '';
533 +
534 + my @vals = split /,/, $prop;
535 + return '' if (grep /^$net\/$mask$/, @vals); # already have this entry
536 +
537 + if ($prop ne '') {
538 + $prop .= ",$net/$mask";
539 + } else {
540 + $prop = "$net/$mask";
541 + }
542 +
543 + $rec->set_prop('ValidFrom', $prop);
544 +
545 + return 1;
546 +}
547 +
548 +
549 +sub remove_valid_from {
550 +
551 + my $c = shift;
552 + my $remove_nets = shift;
553 +
554 + my @remove = split /,/, $remove_nets;
555 +
556 +# my @remove = $c->param('Remove_nets');
557 + my @vals = $c->_get_valid_from();
558 +
559 + foreach my $entry (@remove) {
560 +
561 + return undef unless $entry;
562 +
563 + my ($net, $mask) = split (/\//, $entry);
564 +
565 + unless (@vals) {
566 + print STDERR "ERROR: unable to load ValidFrom property from conf db\n";
567 + return undef;
568 + }
569 +
570 + # what if we don't have a mask because someone added an entry from
571 + # the command line? by the time we get here, the panel will have
572 + # added a 32 bit mask, so we don't know for sure if the value in db
573 + # is $net alone or $net/255.255.255.255. we have to check for both
574 + # in this special case...
575 + @vals = (grep { $entry ne $_ && $net ne $_ } @vals);
576 + }
577 +
578 + my $prop;
579 + if (@vals) {
580 + $prop = join ',',@vals;
581 + } else {
582 + $prop = '';
583 + }
584 +
585 + $db->get('httpd-admin')->set_prop('ValidFrom', $prop);
586 +
587 + return 1;
588 +}
589 +
590 +
591 +1;
592 +
593 +
594 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm
595 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm 2020-02-19 22:26:13.000000000 +0400
596 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm 2020-02-19 22:21:31.000000000 +0400
597 @@ -10,10 +10,12 @@
598 use SrvMngr qw(theme_list init_session_cgi);
599
600 # retrieve a configuration db record
601 -sub config {
602 +sub getconfig {
603 my $c = shift;
604 -
605 my $key = $c->param('key');
606 +
607 + $c->app->log->info($c->log_req . ' ' . $key);
608 +
609 if ($key) {
610 use esmith::ConfigDB qw(open_ro);
611 my $cdb = esmith::ConfigDB->open_ro;
612 @@ -23,23 +25,26 @@
613
614
615 # retrieve an accounts db record, given its name
616 -sub account {
617 +sub getaccount {
618 my $c = shift;
619 -
620 my $key = $c->param('key');
621 +
622 + $c->app->log->info($c->log_req . ' ' . $key);
623 +
624 if ($key) {
625 use esmith::AccountsDB qw(open_ro);
626 - my $adb = esmith::Accounts->open_ro;
627 + my $adb = esmith::AccountsDB->open_ro;
628 return getdb( $c, $adb, $key);
629 }
630 }
631
632
633 sub getdb {
634 +
635 my ($c, $db, $key) = @_;
636
637 if ( my $rec = $db->get($key) ) {
638 - return $c->render(json => { $key => { $rec->props }} );
639 + return $c->render(json => { $key => { $rec->props }} );
640 }
641 return undef;
642 }
643 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm
644 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm 1970-01-01 04:00:00.000000000 +0400
645 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm 2020-02-29 19:11:19.000000000 +0400
646 @@ -0,0 +1,950 @@
647 +package SrvMngr::Controller::Useraccounts;
648 +
649 +use strict;
650 +use warnings;
651 +use Mojo::Base 'Mojolicious::Controller';
652 +
653 +use Locale::gettext;
654 +use SrvMngr::I18N;
655 +use SrvMngr qw(theme_list init_session_cgi
656 + is_normal_password email_simple);
657 +
658 +#use esmith::FormMagick qw( validate_password );
659 +#use CGI::FormMagick::Validator qw( call_fm_validation );
660 +
661 +use esmith::AccountsDB;
662 +use esmith::ConfigDB;
663 +use esmith::util;
664 +
665 +#use esmith::FormMagick;
666 +#use esmith::cgi;
667 +#use File::Basename;
668 +#use Exporter;
669 +#use Carp qw(verbose);
670 +
671 +#use esmith::FormMagick::Panel::useraccounts;
672 +
673 +our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
674 +our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
675 +
676 +sub main {
677 +
678 + my $c = shift;
679 + $c->app->log->info($c->log_req);
680 +
681 + my $notif = '';
682 + my %usr_datas = ();
683 + my $title = $c->l('usr_FORM_TITLE');
684 +
685 + $usr_datas{'trt'} = 'LIST';
686 +
687 + my @users = $adb->get('admin');
688 + push @users, $adb->users();
689 +
690 + $c->stash( title => $title, notif => $notif, usr_datas => \%usr_datas, users => \@users );
691 + $c->render(template => 'useraccounts');
692 +
693 +};
694 +
695 +
696 +sub do_display {
697 +
698 + my $c = shift;
699 +
700 + my $rt = $c->current_route;
701 + my $trt = ($c->param('trt') || 'ADD');
702 + my $user = ($c->param('user') || '');
703 +
704 + my %usr_datas = ();
705 + my $title = $c->l('usr_FORM_TITLE');
706 + my ($notif, $modul) = '';
707 +
708 + $usr_datas{'trt'} = $trt;
709 +
710 + if ( $trt eq 'ADD' ) {
711 +
712 + $usr_datas{user} = '';
713 + $usr_datas{firstname} = '';
714 + $usr_datas{lastname} = '';
715 + $usr_datas{dept} = $c->get_ldap_value('Dept');
716 + $usr_datas{company} = $c->get_ldap_value('Company');
717 + $usr_datas{street} = $c->get_ldap_value('Street');
718 + $usr_datas{city} = $c->get_ldap_value('City');
719 + $usr_datas{phone} = $c->get_ldap_value('Phone');
720 + }
721 +
722 + if ( $trt eq 'UPD' or $trt eq 'UPS' ) {
723 +
724 + my $rec = $adb->get($user);
725 + my $type = ( $trt eq 'UPS' ) ? 'system' : 'user';
726 + if ($rec and $rec->prop('type') eq $type) {
727 + $usr_datas{user} = $user;
728 + $usr_datas{firstname} = $rec->prop('FirstName');
729 + $usr_datas{lastname} = $rec->prop('LastName');
730 + $usr_datas{vpnclientaccess} = $rec->prop('VPNClientAccess');
731 + $usr_datas{emailforward} = $rec->prop('EmailForward');
732 + $usr_datas{forwardaddress} = $rec->prop('ForwardAddress');
733 + if ( $trt eq 'UPD' ) {
734 + $usr_datas{dept} = $rec->prop('Dept');
735 + $usr_datas{company} = $rec->prop('Company');
736 + $usr_datas{street} = $rec->prop('Street');
737 + $usr_datas{city} = $rec->prop('City');
738 + $usr_datas{phone} = $rec->prop('Phone');
739 + }
740 + }
741 + }
742 +
743 + if ( $trt eq 'DEL' ) {
744 +
745 + my $rec = $adb->get($user);
746 + if ($rec and $rec->prop('type') eq 'user') {
747 + $usr_datas{user} = $user;
748 + $usr_datas{name} = $c->get_user_name($user);
749 + }
750 +
751 + }
752 +
753 + if ( $trt eq 'PWD' or $trt eq 'PWS' ) {
754 +
755 + my $rec = $adb->get($user);
756 + my $type = ( $trt eq 'PWS' ) ? 'system' : 'user';
757 + if ($rec and $rec->prop('type') eq $type) {
758 + $usr_datas{user} = $user;
759 + $usr_datas{name} = $c->get_user_name($user);
760 + }
761 +
762 + }
763 +
764 + if ( $trt eq 'LCK' ) {
765 +
766 + my $rec = $adb->get($user);
767 + if ($rec and $rec->prop('type') eq 'user') {
768 + $usr_datas{user} = $user;
769 + $usr_datas{name} = $c->get_user_name($user);
770 + }
771 +
772 + }
773 +
774 + if ( $trt eq 'LIST' ) {
775 + my @useraccounts;
776 + if ($adb)
777 + {
778 + @useraccounts = $adb->useraccounts();
779 + }
780 + $c->stash( useraccounts => \@useraccounts );
781 +
782 + }
783 +
784 + $c->stash( title => $title, notif => $notif, usr_datas => \%usr_datas );
785 + $c->render( template => 'useraccounts' );
786 +
787 +};
788 +
789 +
790 +sub do_update {
791 +
792 + my $c = shift;
793 + $c->app->log->info($c->log_req);
794 +
795 + my $rt = $c->current_route;
796 + my $trt = ($c->param('trt') || 'LIST');
797 + my $user = ($c->param('user') || '');
798 + my $name = ($c->param('name') || '');
799 +
800 + my %usr_datas = ();
801 + $usr_datas{trt} = $trt;
802 +
803 + my $title = $c->l('usr_FORM_TITLE');
804 +
805 +
806 + my ($res, $result) = '';
807 +
808 +
809 + if ( $trt eq 'ADD' ) {
810 +
811 + # controls
812 +
813 + my $first = $c->param('FirstName');
814 + my $last = $c->param('LastName');
815 + my $mail = $c->param('ForwardAddress');
816 +
817 + unless ( $first ) {
818 + $result .= $c->l('FM_NONBLANK') . ' - ';
819 + }
820 + unless ( $last ) {
821 + $result .= $c->l('FM_NONBLANK') . ' - ';
822 + }
823 + #unless ( $mail ) {
824 + # $result .= $c->l('FM_NONBLANK') . ' - ';
825 + #}
826 +
827 + $res = $c->validate_acctName( $user );
828 + $result .= $res unless $res eq 'OK';
829 +
830 + $res = $c->validate_acctName_length( $user );
831 + $result .= $res unless $res eq 'OK';
832 +
833 + $res = $c->validate_acctName_conflict( $user );
834 + $result .= $res unless $res eq 'OK';
835 +
836 + $res = $c->pseudonym_clash( $first );
837 + $result .= $res unless $res eq 'OK';
838 +
839 + if ( $mail ) {
840 + $res = $c->emailforward( $mail );
841 + $result .= $res unless $res eq 'OK';
842 + }
843 +
844 + #$result .= 'Blocked for testing';
845 +
846 + if ( ! $result ) {
847 + $res = create_user( $c, $user );
848 + $result .= $res unless $res eq 'OK';
849 + if ( ! $result ) {
850 + $result = $c->l('usrUSER_CREATED') . ' ' . $user;
851 + $usr_datas{trt} = 'SUC';
852 + }
853 + }
854 + }
855 +
856 +
857 + if ( $trt eq 'UPD' or $trt eq 'UPS') {
858 +
859 + # controls
860 +
861 + my $first = $c->param('FirstName');
862 + my $last = $c->param('LastName');
863 + my $mail = $c->param('ForwardAddress');
864 +
865 + unless ( $first ) {
866 + $result .= $c->l('FM_NONBLANK') . ' - ';
867 + }
868 + unless ( $last ) {
869 + $result .= $c->l('FM_NONBLANK') . ' - ';
870 + }
871 +
872 + #unless ( $mail ) {
873 + # $result .= $c->l('FM_NONBLANK') . ' - ';
874 + #}
875 +
876 + $res = $c->pseudonym_clash( $first );
877 + $result .= $res unless $res eq 'OK';
878 +
879 + if ( $mail ) {
880 + $res = $c->emailforward( $mail );
881 + $result .= $res unless $res eq 'OK';
882 + }
883 +
884 +
885 +
886 + #$result .= 'Blocked for testing';
887 +
888 + if ( ! $result ) {
889 + if ( $trt eq 'UPS' ) {
890 + $res = $c->modify_admin();
891 + } else {
892 + $res = $c->modify_user( $user );
893 + }
894 + $result .= $res unless $res eq 'OK';
895 + if ( ! $result ) {
896 + $result = $c->l('usr_USER_MODIFIED') . ' ' . $user;
897 + $usr_datas{trt} = 'SUC';
898 + }
899 + }
900 + }
901 +
902 +
903 + if ( $trt eq 'PWD' ) {
904 +
905 + my $pass1 = $c->param('newPass');
906 + my $pass2 = $c->param('newPassVerify');
907 +
908 + # controls
909 + unless ($pass1) {
910 + $result .= $c->l('FM_NONBLANK') . ' - ';
911 + }
912 + unless ($pass1 eq $pass2) {
913 + $result .= $c->l('PASSWORD_VERIFY_ERROR') . ' - ';
914 + }
915 +
916 + if ( ! $result ) {
917 + $res = check_password( $c, $pass1 );
918 + $result .= $res unless $res eq 'OK';
919 + }
920 +
921 + if ( $user eq 'admin' ) {
922 + $result .= "System password should not be reset here !";
923 + }
924 + #$result .= 'Blocked for testing';
925 +
926 + if ( ! $result ) {
927 + my $res = $c->reset_password( $user, $pass1 );
928 + $result .= $res unless $res eq 'OK';
929 + if ( ! $result ) {
930 + $result = $c->l('usr_PASSWORD_CHANGE_SUCCEEDED', $user);
931 + $usr_datas{trt} = 'SUC';
932 + }
933 + }
934 + }
935 +
936 + if ( $trt eq 'PWS' ) { # system password reset (admin)
937 +
938 + my $curpass = $c->param('CurPass');
939 + my $pass1 = $c->param('Pass');
940 + my $pass2 = $c->param('PassVerify');
941 +
942 + # controls
943 + if ($curpass) {
944 + $res = $c->system_authenticate_password( $curpass );
945 + $result .= $res unless $res eq 'OK';
946 + } else {
947 + $result .= $c->l('FM_NONBLANK') . ' - ';
948 + }
949 +
950 + unless ($pass1 and $pass2) {
951 + $result .= $c->l('FM_NONBLANK') . ' - ';
952 + }
953 +
954 + unless ($pass1 eq $pass2) {
955 + $result .= $c->l('usr_SYSTEM_PASSWORD_VERIFY_ERROR') . ' - ';
956 + }
957 +
958 + if ( ! $result ) {
959 + $res = $c->system_validate_password( $pass1 );
960 + $result .= $res unless $res eq 'OK';
961 +
962 + $res = $c->system_check_password( $pass1 );
963 + $result .= $res unless $res eq 'OK';
964 + }
965 +
966 + #$result .= 'Blocked for testing';
967 +
968 + if ( ! $result ) {
969 + my $res = $c->system_change_password();
970 + $result .= $res unless $res eq 'OK';
971 + if ( ! $result ) {
972 + $result = $c->l('usr_SYSTEM_PASSWORD_CHANGED', $user);
973 + $usr_datas{trt} = 'SUC';
974 + }
975 + }
976 + }
977 +
978 +
979 + if ( $trt eq 'LCK' ) {
980 +
981 + # controls
982 +
983 + #$res = xxxxxxxxxxx();
984 + #$result .= $res unless $res eq 'OK';
985 +
986 + #$result .= 'Blocked for testing';
987 +
988 + if ( ! $result ) {
989 + my $res = $c->lock_account( $user );
990 + $result .= $res unless $res eq 'OK';
991 + if ( ! $result ) {
992 + $result = $c->l('usr_LOCKED_ACCOUNT', $user);
993 + $usr_datas{trt} = 'SUC';
994 + }
995 + }
996 + }
997 +
998 + if ( $trt eq 'DEL' ) {
999 +
1000 + # controls
1001 +
1002 + #$res = xxxxxxxxxxx();
1003 + #$result .= $res unless $res eq 'OK';
1004 +
1005 + #$result .= 'Blocked for testing';
1006 +
1007 + if ( ! $result ) {
1008 + my $res = $c->remove_account( $user );
1009 + $result .= $res unless $res eq 'OK';
1010 + if ( ! $result ) {
1011 + $result = $c->l('usr_SUCCESSFULLY_DELETED_USER') . ' ' . $user;
1012 + $usr_datas{trt} = 'SUC';
1013 + }
1014 + }
1015 + }
1016 +
1017 + $usr_datas{'user'} = $user;
1018 + $usr_datas{'name'} = $name;
1019 +
1020 + $c->stash( title => $title, notif => $result, usr_datas => \%usr_datas );
1021 + if ($usr_datas{trt} ne 'SUC') {
1022 + return $c->render(template => 'useraccounts');
1023 + }
1024 + $c->redirect_to('/useraccounts');
1025 +
1026 +};
1027 +
1028 +
1029 +sub lock_account {
1030 + my $c = shift;
1031 +
1032 + my $user = $c->param('user');
1033 + my $acct = $adb->get($user);
1034 + if ($acct->prop('type') eq "user") {
1035 + undef $adb;
1036 +
1037 + # Untaint the username before use in system()
1038 + $user =~ /^(\w[\-\w_\.]*)$/;
1039 + $user = $1;
1040 + if (system("/sbin/e-smith/signal-event", "user-lock", $user)) {
1041 + $adb = esmith::AccountsDB->open();
1042 + return $c->l("usr_ERR_OCCURRED_LOCKING");
1043 + }
1044 + $adb = esmith::AccountsDB->open();
1045 + return 'OK';
1046 + } else {
1047 + return $c->l('NO_SUCH_USER', $user);
1048 + }
1049 +}
1050 +
1051 +
1052 +sub remove_account {
1053 + my ($c) = @_;
1054 + my $user = $c->param('user');
1055 +
1056 + my $acct = $adb->get($user);
1057 + if ($acct->prop('type') eq 'user') {
1058 + $acct->set_prop('type', 'user-deleted');
1059 +
1060 + undef $adb;
1061 +
1062 + # Untaint the username before use in system()
1063 + $user =~ /^(\w[\-\w_\.]*)$/;
1064 + $user = $1;
1065 + if (system ("/sbin/e-smith/signal-event", "user-delete", $user))
1066 + {
1067 + $adb = esmith::AccountsDB->open();
1068 + return $c->l("ERR_OCCURRED_DELETING");
1069 + }
1070 +
1071 + $adb = esmith::AccountsDB->open();
1072 + $adb->get($user)->delete;
1073 + return 'OK';
1074 + } else {
1075 + return $c->l('NO_SUCH_USER', $user);
1076 + }
1077 +}
1078 +
1079 +
1080 +sub reset_password {
1081 + my ($c, $user, $passw1) = @_;
1082 +
1083 + unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/)) {
1084 + return $c->l('usr_TAINTED_USER');
1085 + }
1086 + $user = $1;
1087 +
1088 + my $acct = $adb->get($user);
1089 +
1090 + if ( $acct->prop('type') eq "user") {
1091 + esmith::util::setUserPassword ($user, $passw1);
1092 +
1093 + $acct->set_prop("PasswordSet", "yes");
1094 + undef $adb;
1095 +
1096 + if (system("/sbin/e-smith/signal-event", "password-modify", $user))
1097 + {
1098 + $adb = esmith::AccountsDB->open();
1099 + return $c->l("usr_ERR_OCCURRED_MODIFYING_PASSWORD");
1100 + }
1101 + $adb = esmith::AccountsDB->open();
1102 +
1103 + return 'OK';
1104 + } else {
1105 + return $c->l('NO_SUCH_USER', $user);
1106 + }
1107 +}
1108 +
1109 +
1110 +
1111 +sub check_password {
1112 + my $c = shift;
1113 + my $pass1 = shift;
1114 +
1115 + my $check_type;
1116 + my $rec = $cdb->get('passwordstrength');
1117 + $check_type = ($rec ? ($rec->prop('Users') || 'none') : 'none');
1118 +
1119 + return validate_password($c, $check_type, $pass1);
1120 +}
1121 +
1122 +
1123 +sub validate_password {
1124 + my ($c, $strength, $pass) = @_;
1125 +
1126 + use Crypt::Cracklib;
1127 +
1128 + my $reason;
1129 +
1130 + if ($strength eq "none") {
1131 + return $c->l("Passwords must be at least 7 characters long") unless (length($pass) > 6);
1132 + return "OK";
1133 + }
1134 +
1135 + $reason = is_normal_password($c, $pass, undef);
1136 +
1137 + return $reason unless ($reason eq "OK");
1138 + return "OK" unless ($strength eq "strong");
1139 +
1140 + if ( -f '/usr/lib64/cracklib_dict.pwd' ) {
1141 + $reason = fascist_check($pass, '/usr/lib64/cracklib_dict');
1142 + } else {
1143 + $reason = fascist_check($pass, '/usr/lib/cracklib_dict');
1144 + }
1145 + $reason ||= "Software error: password check failed";
1146 +
1147 + return "OK" if ($reason eq "ok");
1148 +
1149 + return $c->l("Bad Password Choice") . ": "
1150 + . $c->l("The password you have chosen is not a good choice, because")
1151 + . " " . $c->($reason) . ".";
1152 +}
1153 +
1154 +
1155 +sub emailForward_list {
1156 + my $c = shift;
1157 +
1158 + return [[ $c->l('usr_DELIVER_EMAIL_LOCALLY') => 'local'],
1159 + [ $c->l('usr_FORWARD_EMAIL') => 'forward'],
1160 + [ $c->l('usr_DELIVER_AND_FORWARD') => 'both']];
1161 +}
1162 +
1163 +
1164 +sub max_user_name_length {
1165 +
1166 + my ($c, $data) = @_;
1167 +
1168 + $cdb->reload();
1169 + my $max = $cdb->get('maxuserNameLength')->value;
1170 +
1171 + if (length($data) <= $max) {
1172 + return "OK";
1173 + } else {
1174 + return $c->l('usr_MAX_user_NAME_LENGTH_ERROR', $data, $max, $max);
1175 + }
1176 +}
1177 +
1178 +
1179 +sub validate_acctName {
1180 +
1181 + my ($c, $acctName) = @_;
1182 +
1183 + unless ($adb->validate_account_name($acctName)) {
1184 + return $c->l('usrACCT_NAME_HAS_INVALID_CHARS', $acctName);
1185 + }
1186 + return "OK";
1187 +}
1188 +
1189 +sub validate_acctName_length {
1190 +
1191 + my $c = shift;
1192 + my $acctName = shift;
1193 +
1194 + my $maxAcctNameLength = ($cdb->get('maxAcctNameLength')
1195 + ? $cdb->get('maxAcctNameLength')->prop('type') : "") || 12;
1196 +
1197 + if ( length $acctName > $maxAcctNameLength ) {
1198 + return $c->l('usrACCOUNT_TOO_LONG', $maxAcctNameLength);
1199 + } else {
1200 + return ('OK');
1201 + }
1202 +}
1203 +
1204 +sub validate_acctName_conflict {
1205 +
1206 + my $c = shift;
1207 + my $acctName = shift;
1208 +
1209 + my $account = $adb->get($acctName);
1210 + my $type;
1211 +
1212 + if (defined $account) {
1213 + $type = $account->prop('type');
1214 + } elsif (defined getpwnam($acctName) || defined getgrnam($acctName)) {
1215 + $type = "system";
1216 + } else {
1217 + return('OK');
1218 + }
1219 + return $c->l('usrACCOUNT_CONFLICT', $acctName, $type);
1220 +
1221 +}
1222 +
1223 +
1224 +
1225 +sub get_user_name {
1226 +
1227 + my ($c, $acctName) = @_;
1228 +
1229 + my $usr = $adb->get($acctName);
1230 +
1231 + return '' unless $usr;
1232 +
1233 + return $usr->prop('FirstName') ." ". $usr->prop('LastName');
1234 +
1235 +}
1236 +
1237 +
1238 +sub get_ldap_value {
1239 + my ($c, $field) = @_;
1240 +
1241 + # don't do the lookup if this is a modification of an existing user
1242 + if ($c->param('user')) {
1243 + return $c->param($field);
1244 + }
1245 +
1246 + my %CGIParam2DBfield = (
1247 + Dept => 'defaultDepartment',
1248 + Company => 'defaultCompany',
1249 + Street => 'defaultStreet',
1250 + City => 'defaultCity',
1251 + Phone => 'defaultPhoneNumber'
1252 + );
1253 +
1254 + return $cdb->get('ldap')->prop($CGIParam2DBfield{$field});
1255 +}
1256 +
1257 +sub get_pptp_value {
1258 + return $cdb->get('pptpd')->prop('AccessDefault') || 'no';
1259 +}
1260 +
1261 +
1262 +sub pseudonym_clash {
1263 + my ($c, $first) = @_;
1264 + $first ||= "";
1265 + my $last = $c->param('LastName') || "";
1266 + my $acctName = $c->param('user') || "";
1267 +
1268 + my $up = "$first $last";
1269 +
1270 + $up =~ s/^\s+//;
1271 + $up =~ s/\s+$//;
1272 + $up =~ s/\s+/ /g;
1273 + $up =~ s/\s/_/g;
1274 +
1275 + my $dp = $up;
1276 + $dp =~ s/_/./g;
1277 +
1278 + $dp = $adb->get($dp);
1279 + $up = $adb->get($up);
1280 +
1281 + my $da = $dp->prop('Account') if $dp;
1282 + my $ua = $up->prop('Account') if $up;
1283 + if ($dp and $da and $da ne $acctName) {
1284 + return $c->l('usr_PSEUDONYM_CLASH',
1285 + $acctName, $da, $dp->key);
1286 + } elsif ($up and $ua and $ua ne $acctName) {
1287 + return $c->l('usr_PSEUDONYM_CLASH',
1288 + $acctName, $ua, $up->key );
1289 + } else {
1290 + return "OK";
1291 + }
1292 +}
1293 +
1294 +
1295 +sub emailforward {
1296 + my ($c, $data) = @_;
1297 + my $response = $c->email_simple($data);
1298 + if ($response eq "OK") {
1299 + return "OK";
1300 + } elsif ($data eq "") {
1301 + # Blank is ok, only if we're not forwarding, which means that the
1302 + # EmailForward param must be set to 'local'.
1303 + my $email_forward = $c->param('EmailForward') || '';
1304 + $email_forward =~ s/^\s+|\s+$//g;
1305 + return 'OK' if $email_forward eq 'local';
1306 + return $c->l('usr_CANNOT_CONTAIN_WHITESPACE');
1307 + } else {
1308 + return $c->l('usr_CANNOT_CONTAIN_WHITESPACE')
1309 + if ( $data =~ /\s+/ );
1310 + # Permit a local address.
1311 + return "OK" if $data =~ /^[a-zA-Z][a-zA-Z0-9\._\-]*$/;
1312 + return $c->l('usr_UNACCEPTABLE_CHARS');
1313 + }
1314 +}
1315 +
1316 +
1317 +sub get_groups {
1318 + my ($c) = shift;
1319 +
1320 + my @groups = $adb->groups();
1321 + return \@groups;
1322 +}
1323 +
1324 +
1325 +sub ipsec_for_acct {
1326 +
1327 + my $c = shift;
1328 +
1329 + # Don't show ipsecrw setting unless the status property exists
1330 + return '' unless ($cdb->get('ipsec')
1331 + && $cdb->get('ipsec')->prop('RoadWarriorStatus'));
1332 +
1333 + # Don't show ipsecrw setting unless /sbin/e-smith/roadwarrior exists
1334 + return '' unless -x '/sbin/e-smith/roadwarrior';
1335 +
1336 + my $user = $c->param('user');
1337 + return '' unless $user;
1338 +
1339 + my $rec = $adb->get($user);
1340 + if ( $rec ) {
1341 + my $pwset = $rec->prop('PasswordSet') || 'no';
1342 + my $VPNaccess = $rec->prop('VPNClientAccess') || 'no';
1343 + if ($pwset eq 'yes' and $VPNaccess eq 'yes') {
1344 + return 'OK';
1345 + }
1346 + }
1347 + return '';
1348 +}
1349 +
1350 +
1351 +sub is_user_in_group {
1352 +
1353 + my $c = shift;
1354 + my $user = shift || '';
1355 + my $group = shift || '';
1356 +
1357 + return '' unless ( $user and $group );
1358 +
1359 + return ( $adb->is_user_in_group($user, $group) ) ? 'OK' : '';
1360 +
1361 +}
1362 +
1363 +
1364 +sub get_ipsec_client_cert {
1365 + my $c = shift;
1366 + my $user = $c->param('user');
1367 + ($user) = ($user =~ /^(.*)$/);
1368 +
1369 + die "Invalid user: $user\n" unless getpwnam($user);
1370 +
1371 + open (KID, "/sbin/e-smith/roadwarrior get_client_cert $user |")
1372 + or die "Can't fork: $!";
1373 + my $certfile = <KID>;
1374 + close KID;
1375 +
1376 + require File::Basename;
1377 + my $certname = File::Basename::basename($certfile);
1378 +
1379 + print "Expires: 0\n";
1380 + print "Content-type: application/x-pkcs12\n";
1381 + print "Content-disposition: inline; filename=$certname\n";
1382 + print "\n";
1383 +
1384 + open (CERT, "<$certfile");
1385 + while (<CERT>)
1386 + {
1387 + print;
1388 + }
1389 + close CERT;
1390 +
1391 + return '';
1392 +}
1393 +
1394 +
1395 +sub modify_user {
1396 + my ($c) = @_;
1397 + my $acctName = $c->param('user');
1398 +
1399 + unless (($acctName) = ($acctName =~ /^(\w[\-\w_\.]*)$/)) {
1400 + return $c->l('usr_TAINTED_USER', $acctName);
1401 + }
1402 + # Untaint the username before use in system()
1403 + $acctName = $1;
1404 +
1405 + my $acct = $adb->get($acctName);
1406 + my $acctType = $acct->prop('type');
1407 +
1408 + if ($acctType eq "user")
1409 + {
1410 + $adb->remove_user_auto_pseudonyms($acctName);
1411 + my %newProperties = (
1412 + 'FirstName' => $c->param('FirstName'),
1413 + 'LastName' => $c->param('LastName'),
1414 + 'Phone' => $c->param('Phone'),
1415 + 'Company' => $c->param('Company'),
1416 + 'Dept' => $c->param('Dept'),
1417 + 'City' => $c->param('City'),
1418 + 'Street' => $c->param('Street'),
1419 + 'EmailForward' => $c->param('EmailForward'),
1420 + 'ForwardAddress' => $c->param('ForwardAddress'),
1421 + 'VPNClientAccess'=> $c->param('VPNClientAccess'),
1422 + );
1423 +
1424 + $acct->merge_props(%newProperties);
1425 +
1426 + $adb->create_user_auto_pseudonyms($acctName);
1427 +
1428 + my @old_groups = $adb->user_group_list($acctName);
1429 + my @new_groups = $c->param("groupMemberships");
1430 +
1431 + $c->app->log->info($c->dumper("groups: Old " . @old_groups .' New '. @new_groups));
1432 +
1433 + $adb->remove_user_from_groups($acctName, @old_groups);
1434 + $adb->add_user_to_groups($acctName, @new_groups);
1435 +
1436 + undef $adb;
1437 +
1438 + unless (system ("/sbin/e-smith/signal-event", "user-modify",
1439 + $acctName) == 0) {
1440 + $adb = esmith::AccountsDB->open();
1441 + return $c->l('usr_CANNOT_MODIFY_USER');
1442 + }
1443 + $adb = esmith::AccountsDB->open();
1444 + }
1445 + return 'OK';
1446 +}
1447 +
1448 +
1449 +sub create_user {
1450 +
1451 + my $c = shift;
1452 +
1453 + my $acctName = $c->param('user');
1454 + my %userprops;
1455 +
1456 + foreach my $field ( qw( FirstName LastName Phone Company Dept
1457 + City Street EmailForward ForwardAddress VPNClientAccess) )
1458 + {
1459 + $userprops{$field} = $c->param($field);
1460 + }
1461 + $userprops{'PasswordSet'} = "no";
1462 + $userprops{'type'} = 'user';
1463 +
1464 + my $acct = $adb->new_record($acctName)
1465 + or warn "Can't create new account for $acctName (does it already exist?)\n";
1466 + $acct->reset_props(%userprops);
1467 + $adb->create_user_auto_pseudonyms($acctName);
1468 + my @groups = $c->param("groupMemberships");
1469 +
1470 + $adb->add_user_to_groups($acctName, @groups);
1471 +
1472 + undef $adb;
1473 +
1474 + # Untaint the username before use in system()
1475 + $acctName =~ /^(\w[\-\w_\.]*)$/;
1476 + $acctName = $1;
1477 +
1478 + if (system ("/sbin/e-smith/signal-event", "user-create", $acctName))
1479 + {
1480 + $adb = esmith::AccountsDB->open();
1481 + return $c->l("usr_ERR_OCCURRED_CREATING");
1482 + }
1483 +
1484 + $adb = esmith::AccountsDB->open();
1485 +
1486 + $c->set_groups();
1487 + return 'OK';
1488 +
1489 +}
1490 +
1491 +
1492 +sub set_groups {
1493 +
1494 + my $c = shift;
1495 +
1496 + my $acctName = $c->param('user');
1497 +
1498 + my @groups = $c->param('groupMemberships');
1499 + $adb->set_user_groups($acctName, @groups);
1500 +
1501 +}
1502 +
1503 +
1504 +sub modify_admin {
1505 +
1506 + my ($c) = @_;
1507 +
1508 + my $acct = $adb->get('admin');
1509 +
1510 + my %newProperties = (
1511 + 'FirstName' => $c->param('FirstName'),
1512 + 'LastName' => $c->param('LastName'),
1513 + 'EmailForward' => $c->param('EmailForward'),
1514 + 'ForwardAddress' => $c->param('ForwardAddress'),
1515 + 'VPNClientAccess'=> $c->param('VPNClientAccess'),
1516 + );
1517 +
1518 + $acct->merge_props(%newProperties);
1519 +
1520 + undef $adb;
1521 +
1522 + my $status =
1523 + system ("/sbin/e-smith/signal-event", "user-modify-admin", 'admin');
1524 +
1525 + $adb = esmith::AccountsDB->open();
1526 +
1527 + if ($status == 0) {
1528 + return 'OK';
1529 + } else {
1530 + return$c->l('usr_CANNOT_MODIFY_USER', 'First');
1531 + }
1532 +}
1533 +
1534 +
1535 +sub system_validate_password {
1536 +
1537 + my $c = shift;
1538 + my $pass1 = shift;
1539 + # If the password contains one or more printable character
1540 + if ($pass1 =~ /^([ -~]+)$/) {
1541 + return('OK');
1542 + } else {
1543 + return $c->l('usr_SYSTEM_PASSWORD_UNPRINTABLES_IN_PASS');
1544 + }
1545 +}
1546 +
1547 +
1548 +sub system_check_password {
1549 +
1550 + my $c = shift;
1551 + my $pass1 = shift;
1552 +
1553 + use esmith::ConfigDB;
1554 + my $conf = esmith::ConfigDB->open();
1555 + my ($check_type, $rec);
1556 + if ($conf) {
1557 + $rec = $conf->get('passwordstrength');
1558 + }
1559 + $check_type = ($rec ? ($rec->prop('Admin') || 'strong') : 'strong');
1560 +
1561 + return $c->validate_password($check_type, $pass1);
1562 +}
1563 +
1564 +
1565 +sub system_authenticate_password {
1566 +
1567 + my $c = shift;
1568 + my $pass = shift;
1569 +
1570 + if (esmith::util::authenticateUnixPassword( ($cdb->get_value("AdminIsNotRoot") eq 'enabled') ? 'admin' : 'root', $pass)) {
1571 + return "OK";
1572 + } else {
1573 + return $c->l("usr_SYSTEM_PASSWORD_AUTH_ERROR");
1574 + }
1575 +}
1576 +
1577 +
1578 +sub system_change_password {
1579 +
1580 + my ($c) = @_;
1581 + my $pass = $c->param('Pass');
1582 +
1583 + ($cdb->get_value("AdminIsNotRoot") eq 'enabled') ? esmith::util::setUnixPassword('admin',$pass) : esmith::util::setUnixSystemPassword($pass);
1584 + esmith::util::setServerSystemPassword($pass);
1585 +
1586 + my $result = system("/sbin/e-smith/signal-event password-modify admin");
1587 +
1588 + if ($result == 0) {
1589 + return 'OK';
1590 + } else {
1591 + return $c->l("Error occurred while modifying password for admin.", 'First');
1592 + }
1593 +}
1594 +
1595 +
1596 +1
1597 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm
1598 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm 1970-01-01 04:00:00.000000000 +0400
1599 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm 2020-02-26 17:04:40.000000000 +0400
1600 @@ -0,0 +1,332 @@
1601 +package SrvMngr::Controller::Viewlogfiles;
1602 +
1603 +use strict;
1604 +use warnings;
1605 +use Mojo::Base 'Mojolicious::Controller';
1606 +
1607 +#use esmith::FormMagick qw(gen_locale_date_string);
1608 +
1609 +use Locale::gettext;
1610 +use SrvMngr::I18N;
1611 +use SrvMngr qw(theme_list init_session_cgi);
1612 +
1613 +use esmith::ConfigDB;
1614 +use Time::TAI64;
1615 +use File::Basename;
1616 +use HTML::Entities;
1617 +use esmith::FormMagick qw(gen_locale_date_string);
1618 +
1619 +use constant TRUE => 1;
1620 +use constant FALSE => 0;
1621 +
1622 +our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
1623 +
1624 +our @logfiles = (); # with array
1625 +
1626 +
1627 +sub main {
1628 + my $c = shift;
1629 + $c->app->log->info($c->log_req);
1630 +
1631 + my %log_datas = ();
1632 + my $title = $c->l('log_FORM_TITLE');
1633 + my $notif = '';
1634 +
1635 + $log_datas{default_op} =
1636 + ($cdb->get('viewlogfiles')->prop('DefaultOperation')) || 'view';
1637 +
1638 + $c->stash( title => $title, notif => $notif, log_datas => \%log_datas);
1639 + $c->render(template => 'viewlogfiles');
1640 +};
1641 +
1642 +
1643 +sub do_action {
1644 + my $c = shift;
1645 + $c->app->log->info($c->log_req);
1646 +
1647 + my $title = $c->l('log_FORM_TITLE');
1648 + my $notif = '';
1649 + my $result = "";
1650 + my %log_datas = ();
1651 +
1652 + $log_datas{filename} = $c->param('Filename');
1653 + $log_datas{matchpattern} = $c->param('Matchpattern');
1654 + $log_datas{highlightpattern} = $c->param('Highlightpattern');
1655 + $log_datas{operation} = $c->param('Operation');
1656 + if ($log_datas{operation} eq 'download') {
1657 + $log_datas{'trt'} = "DOWN"
1658 + } else {
1659 + $log_datas{'trt'} = "SHOW"
1660 + }
1661 +
1662 +
1663 + if ($log_datas{filename} =~ /^([\S\s]+)$/) {
1664 + $log_datas{filename} = $1;
1665 + } elsif ($log_datas{filename} =~ /^$/) {
1666 + $log_datas{filename} = "messages";
1667 + } else {
1668 + $result .= $c->l("log_FILENAME_ERROR", $log_datas{filename} )
1669 + . " ";
1670 + }
1671 +
1672 + if ($log_datas{matchpattern} =~ /^(\S+)$/) {
1673 + $log_datas{matchpattern} = $1;
1674 + } else {
1675 + $log_datas{matchpattern} = ".";
1676 + }
1677 +
1678 + if ($log_datas{highlightpattern} =~ /^(\S+)$/) {
1679 + $log_datas{highlightpattern} = $1;
1680 + } else {
1681 + $log_datas{highlightpattern} = '';
1682 + }
1683 +
1684 + my $fullpath = "/var/log/$log_datas{filename}";
1685 + if (-z $fullpath) {
1686 + $result .= $c->l("log_LOG_FILE_EMPTY", "$log_datas{filename}" );
1687 + }
1688 +
1689 + if ($log_datas{trt} eq "SHOW") {
1690 + if ( ! $result ) {
1691 + $result = $c->render_to_string(inline => showlogFile( $c, %log_datas ));
1692 + }
1693 +
1694 + if ( $result ) {
1695 + $c->stash(title => $title, modul => $result, log_datas => \%log_datas);
1696 + return $c->render(template => 'viewlogfiles2');
1697 + }
1698 + }
1699 +
1700 +
1701 + if ( $log_datas{trt} eq 'DOWN' ) {
1702 +
1703 + my $modul = 'Log file download';
1704 +
1705 + $notif = download_logFile( $c, %log_datas );
1706 + }
1707 +
1708 + $c->stash( title => $title, notif => $notif, log_datas => \%log_datas);
1709 + $c->render(template => 'viewlogfiles');
1710 +
1711 +};
1712 +
1713 +
1714 +sub timestamp2local
1715 +{
1716 + $_ = shift;
1717 + if (/^(\@[0-9a-f]{24})(.*)/s)
1718 + {
1719 + return Time::TAI64::tai64nlocal($1) . $2;
1720 + }
1721 + elsif (/^([0-9]{10}\.[0-9]{3})(.*)/s)
1722 + {
1723 + return localtime($1) . $2;
1724 + }
1725 + return $_;
1726 +}
1727 +
1728 +
1729 +sub findlogFiles {
1730 +
1731 + my $c = shift;
1732 +
1733 + use File::Find;
1734 + sub findlogfiles
1735 + {
1736 + my $path = $File::Find::name;
1737 +
1738 + if (-f)
1739 + {
1740 + # Remove leading /var/log/messages
1741 + $path =~ s:^/var/log/::;
1742 + # don't bother to collect files known to be non-text
1743 + # or not log files
1744 + foreach (qw(
1745 + lastlog
1746 + btmp$
1747 + wtmp
1748 + lock
1749 + (?<!qpsmtpd/)state
1750 + httpd/ssl_mutex.\d*
1751 + httpd/ssl_scache.pag
1752 + httpd/ssl_scache.dir
1753 + \/config$
1754 + ))
1755 + {
1756 + return if $path =~ /$_/;
1757 + }
1758 +
1759 + my ($file_base, $file_path, $file_type) = fileparse($path);
1760 +
1761 + if ( $file_base =~ /@.*/ )
1762 + {
1763 + #$logfiles{$path} = $file_path . timestamp2local($file_base);
1764 + push @logfiles, [ $file_path . timestamp2local($file_base), $path ];
1765 + }
1766 + else
1767 + {
1768 + #$logfiles{$path} = $path;
1769 + push @logfiles, [ $path, $path ];
1770 + }
1771 + }
1772 + }
1773 +
1774 + # Now go and find all the files under /var/log
1775 + find({wanted => \&findlogfiles, no_chdir => 1}, '/var/log');
1776 +
1777 + my @logf = sort { $a->[0] cmp $b->[0] } @logfiles;
1778 +
1779 + return \@logf;
1780 +}
1781 +
1782 +
1783 +sub showlogFile {
1784 +
1785 + my ($c, %log_datas) = @_;
1786 +
1787 + my $fullpath = "/var/log/$log_datas{filename}";
1788 + my $out = '';
1789 +
1790 + $out .= sprintf("$fullpath: \n");
1791 +
1792 + $out .= sprintf($c->l("log_VIEWING_TIME", $c->gen_locale_date_string() ));
1793 +
1794 + unless ( $log_datas{matchpattern} eq '.' )
1795 + {
1796 + #$out .= sprintf("<p>\n");
1797 + $out .= sprintf($c->l("log_MATCH_HEADER", $log_datas{matchpattern} ));
1798 + }
1799 +
1800 + if ( $log_datas{highlightpattern} )
1801 + {
1802 + #$out .= sprintf("<p>\n");
1803 + $out .= sprintf($c->l("log_HIGHLIGHT_HEADER", "$log_datas{highlightpattern}" ));
1804 + }
1805 +
1806 + if ($log_datas{filename} =~ /\.gz$/) {
1807 + my $pid = open(LOGFILE, "-|");
1808 + die "Couldn't fork: $!" unless defined $pid;
1809 + unless ($pid) {
1810 + # Child
1811 + exec("/bin/zcat", $fullpath)
1812 + || die "Can't exec zcat: $!";
1813 + # NOTREACHED
1814 + }
1815 + } else {
1816 + open(LOGFILE, "$fullpath");
1817 + }
1818 +
1819 + my $somethingMatched = 0;
1820 + my $fileEmpty = 1;
1821 + $out .= sprintf("<PRE>");
1822 + while(<LOGFILE>)
1823 + {
1824 + $fileEmpty = 0;
1825 + next unless /$log_datas{matchpattern}/;
1826 + $somethingMatched = 1;
1827 +
1828 + $_ = timestamp2local($_);
1829 + $_ = HTML::Entities::encode_entities($_);
1830 + ($log_datas{highlightpattern} && /$log_datas{highlightpattern}/)
1831 + ? $out .= sprintf( "<b>$_</b>" )
1832 + : $out .= sprintf("$_");
1833 + }
1834 + $out .= sprintf("</PRE>");
1835 +
1836 + if ($fileEmpty) {
1837 + $out .= sprintf("<p>\n");
1838 + $out .= sprintf($c->l("log_LOG_FILE_EMPTY"));
1839 + } else {
1840 + unless ($somethingMatched)
1841 + {
1842 + $out .= sprintf("<p>\n");
1843 + $out .= sprintf($c->l("log_NO_MATCHING_LINES"));
1844 + }
1845 + }
1846 +
1847 + close LOGFILE;
1848 +
1849 + return $out;
1850 +}
1851 +
1852 +
1853 +sub download_logFile {
1854 +
1855 + my ($c, %log_datas) = @_;
1856 +
1857 + my $fullpath = "/var/log/$log_datas{filename}";
1858 +
1859 + # Save this information for later.
1860 +
1861 + $cdb->get('viewlogfiles')->merge_props('DefaultOperation', $log_datas{operation});
1862 +
1863 + # If the client is on windows, we must handle this a little differently.
1864 + my $win32 = FALSE;
1865 + my $mac = FALSE;
1866 + my $agent = $ENV{HTTP_USER_AGENT} || "";
1867 + if ($agent =~ /win32|windows/i) {
1868 + $win32 = TRUE;
1869 + } elsif ($agent =~ /mac/i) {
1870 + $mac = TRUE;
1871 + }
1872 +
1873 + # Check for errors first. Once we start sending the file it's too late to
1874 + # report them.
1875 + my $error = "";
1876 + unless (-f $fullpath) {
1877 + $error = $c->l("log_ERR_NOEXIST_FILE") . $fullpath;
1878 + }
1879 +
1880 + local *FILE;
1881 + open(FILE, "<$fullpath")
1882 + or $error = $c->l("log_ERR_NOOPEN_FILE");
1883 + # Put other error checking here.
1884 + return $error if $error;
1885 +
1886 + # Fix the filename, as it might have a directory prefixed to it.
1887 + my $filename = $log_datas{filename};
1888 + if ( $filename =~ m#/# ) {
1889 + $filename = (split /\//, $filename)[-1];
1890 + }
1891 +
1892 + # And send the file.
1893 + my $nl = "\n";
1894 + if ($win32) { $nl = "\r\n" }
1895 + elsif ($mac) { $nl = "\r" }
1896 +
1897 + # Otherwise, send the file. Start with the headers.
1898 + # Note: The Content-disposition must be attachment, or IE will view the
1899 + # file inline like it's told. It ignores the Content-type, but it likes
1900 + # the Content-disposition (an officially unsupported header) for some
1901 + # reason. Yay Microsoft.
1902 +
1903 + # compute file size first for the header !!
1904 +
1905 + my @fileholder = ();
1906 + my $filesize = 0;
1907 +
1908 + while (my $line = <FILE>) {
1909 + chomp $line;
1910 + my $linew = timestamp2local($line) . $nl;
1911 + $filesize += length($linew);
1912 + push @fileholder, $linew;
1913 + }
1914 + close(FILE);
1915 +
1916 + # print header
1917 + print <<"EOF";
1918 +Expires: 0
1919 +Content-Type:application/octet-stream
1920 +Content-Disposition:attachment;filename=$filename
1921 +Content-Length:$filesize
1922 +
1923 +
1924 +EOF
1925 + print @fileholder ;
1926 +
1927 + return undef;
1928 +}
1929 +
1930 +
1931 +1;
1932 +
1933 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm
1934 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm 2020-02-16 00:27:54.000000000 +0400
1935 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm 2020-02-26 23:05:47.000000000 +0400
1936 @@ -964,7 +964,7 @@
1937 'hos_HOSTNAME_VALIDATOR_ERROR' => 'Error: unexpected characters in host name: "[_1]". The host name should contain only
1938 letters, numbers, and hyphens and must start with a letter or a number. ',
1939
1940 -'log_View log files' => 'View log files',
1941 +'log_FORM_TITLE' => 'View log files',
1942 'log_FIRSTPAGE_DESC' => 'This panel allows you to view or download the log files generated
1943 by the services running on your server.',
1944 'log_LOG_FILE_SELECT_DESC' => 'Choose a log file to view',
1945 @@ -1003,6 +1003,755 @@
1946 will appear.',
1947 'log_DOWNLOAD_FILE' => 'Preparing to download the logfile [_1].',
1948
1949 +
1950 +'bac_BACKUP_TITLE' => 'Backup or restore server data',
1951 +'bac_BACKUP_DESC' => '<P>The server provides two ways to back up and restore
1952 +your server: using your local desktop or a tape drive.</P>
1953 +<P>The first method creates a copy of your server configuration and user
1954 +data files, and downloads it to your local desktop via your web browser.
1955 +Currently your configuration and data files total approximately
1956 +<b>$tarsize</b>. The backup file will be somewhat less than this,
1957 +depending on how compressible the data are. The \"Verify desktop backup
1958 +file\" option can be used to check the integrity of a desktop backup
1959 +file.</P>
1960 +<P>The tape backup method uses a software package called <I>$module</I>
1961 +to back up your entire hard disk to tape every night. This requires a
1962 +supported tape drive and a tape that is not write-protected. The backup
1963 +is performed automatically at the selected time every night (with a
1964 +reminder automatically e-mailed to the administrator during the day).
1965 +Currently your hard disk contains <b>$dumpsize</b> of data.</P>
1966 +<P>Both restore methods allow you to restore your configuration and user
1967 +data files. <b>Ideally, the restore should be performed on a freshly
1968 +installed server</b>.</P>',
1969 +'bac_BACKUP_DESC_DAR' => '<P>Three ways are provided to back up and restore your
1970 +server: using a tape drive, using a network share or a local
1971 +removable disk, or using your local desktop.</P>
1972 +<P>Tape Backup. This method uses a software package called <I>$module</I>
1973 +to back up your entire hard disk to tape every night. This requires a
1974 +supported tape drive and a tape that is not write-protected. The backup
1975 +is performed automatically at the selected time every night (with a
1976 +reminder automatically e-mailed to the administrator during the day).
1977 +Currently your hard disk contains <b>$dumpsize</b> of data.</P>
1978 +<P>Workstation backup. This method uses a software package called <I>dar</I>
1979 +to back up your server configuration and data files to a network share
1980 +or a local removable disk such as a USB disk.
1981 +You can manage how many rotating sets of backups are kept,
1982 +and how many incremental backups to have in each set.
1983 +The backup is performed automatically at the selected time every day. Currently
1984 +configuration and data files total approximately <b>$tarsize</b> uncompressed.
1985 +Twice the compressed data size must be available on the backup share.</P>
1986 +<P>Backup to Desktop. This method creates a copy of your server
1987 +configuration and user data files, and downloads it to your
1988 +local desktop via your web browser.
1989 +Currently your configuration and data files total approximately
1990 +<b>$tarsize</b>. The backup file will be somewhat less than this,
1991 +depending on how much the data can be compressed.
1992 +This file can be used to restore the server from the console if you
1993 +copy it to a local removable disk such as a USB disk.</P>
1994 +<P>All backup methods allow you to restore your configuration and user
1995 +data files. Workstation backup provides individual file restore. <b>Ideally,
1996 +full restore should be performed on a freshly installed server</b>.</P>',
1997 +'bac_BACKUP_CONFIG_STATUS' => 'Backup configuration and status',
1998 +'bac_TAPE_BACKUPS_ENABLED' => 'Tape backups are currently <b>enabled</b>.',
1999 +'bac_BACKUPS_RUN_AT' => 'Regular tape backups will run at: ',
2000 +'bac_REMINDER_MESSAGE_AT' => 'Reminder messages will be sent at: ',
2001 +'bac_TAPE_BACKUPS_DISABLED' => 'Tape backups are <b>disabled</b>',
2002 +'bac_DESKTOP_BACKUP' => 'Backup to desktop',
2003 +'bac_DESKTOP_RESTORE' => 'Restore from desktop',
2004 +'bac_DESKTOP_VERIFY' => 'Verify desktop backup file',
2005 +'bac_TAPE_CONFIGURE' => 'Configure tape backup',
2006 +'bac_TAPE_RESTORE' => 'Restore from tape',
2007 +'bac_RESTORE_IN_PROGRESS_BEGAN_AT' => 'A system restore is in progress. It began at: ',
2008 +'bac_REFRESH_THIS_DISPLAY' => 'Refresh this display',
2009 +'bac_CONFIGURE_TAPE_BACKUP' => 'Configure tape backup',
2010 +'bac_RESTORE_COMPLETED' => 'A system restore has completed',
2011 +'bac_STARTED_AT' => 'It began at: ',
2012 +'bac_FINISHED_AT' => 'and finished at: ',
2013 +'bac_YOU_MUST_REBOOT' => 'You must reboot the server to activate any configuration changes that were
2014 +made as a result of this restore.',
2015 +'bac_REBOOT' => 'Reboot',
2016 +'bac_SELECT_AN_ACTION' => 'Select an action',
2017 +'bac_X_BACKUP_OR_RESTORE' => 'X Backup or restore server data',
2018 +'bac_ERR_PRE_BACKUP' => 'Error occurred during pre-backup actions.',
2019 +'bac_ERR_PRE_RESTORE' => 'Error occurred during pre-restore actions.',
2020 +'bac_ERR_POST_BACKUP' => 'Error occurred during post-backup actions.',
2021 +'bac_RESTORE_SERVER_CONFIG' => 'Restore server configuration',
2022 +'bac_DESKTOP_RESTORE_DESC' => 'This process will upload a server backup file from your local desktop to your server and restore the configuration and user data files. <B>The restore should be performed on a freshly installed server</B>.',
2023 +'bac_FREE_SPACE' => 'You have approximately $tmpfree free space on the server.
2024 +Check that desktop backup file is less than $halffree before
2025 +commencing the restore.',
2026 +'bac_MUST_REBOOT_AFTER_RESTORE' => 'After the restore completes you must reboot the server.',
2027 +'bac_FILE_TO_RESTORE' => 'Backup file to restore from',
2028 +'bac_VERIFY_BACKUP_DESC' => '
2029 +<p>This option will display the names of all files
2030 +in a previously created desktop backup file. You
2031 +can use this option to verify the contents of the
2032 +backup file.</p> ',
2033 +'bac_SELECT_BACKUP_FILE' => 'Select backup file',
2034 +'bac_VERIFY' => 'Verify',
2035 +'bac_RESTORE_CANNOT_PROCEED' => 'Unable to proceed with restore of server configuration',
2036 +'bac_ANOTHER_RESTORE_IN_PROGRESS' => 'Another restore is in progress. Please try again later.',
2037 +'bac_RESTORE_IN_PROGRESS' => 'Restore in progress',
2038 +'bac_RESTORE_IN_PROGRESS_DESC' => 'After the restore completes you must reboot the server. Your restore is
2039 +complete when the words "Restore complete" appear at the bottom of your screen.
2040 +',
2041 +'bac_FILES_HAVE_BEEN_RESTORED' => 'The following files and directories have been restored:',
2042 +'bac_RESTORE_FAILED_MSG' => 'Restore failed! There was an error in reading the backup file.',
2043 +'bac_RESTORE_COMPLETE' => 'Restore complete',
2044 +'bac_ERR_RESTORING_GID' => 'Error occurred while restoring gid of \'www\'',
2045 +'bac_ERR_RESTORING_INITIAL_GRP' => 'Error occurred while restoring initial group of \'www\'.',
2046 +'bac_RESTORE_FAILED' => 'Restore failed! The backup file was incomplete.',
2047 +'bac_COULD_NOT_EXEC_PIPELINE' => 'Could not execute backup pipeline: ',
2048 +'bac_COULD_NOT_DECODE' => 'Could not decode backup file: ',
2049 +'bac_FILES_IN_BACKUP' => 'The following files are considered in the backup :',
2050 +'bac_VERIFY_COMPLETE' => 'Verification is complete',
2051 +'bac_BACKUP_FILE_INCOMPLETE' => 'The backup file was incomplete',
2052 +'bac_ERR_READING_FILE' => 'There was an error in reading the backup file.',
2053 +'bac_ENABLE_DISABLE_TAPE' => 'Enable/Disable Nightly Tape Backup',
2054 +'bac_TAPE_CONFIG_DESC' => '<p>Select whether you wish to enable nightly backups. Then indicate the
2055 +desired times for the backup and the load tape reminder.</p> <p>The tape
2056 +backup requires a supported tape drive. A warning message will be sent to
2057 +the administrator at the designated reminder time if the tape drive is
2058 +empty.</p>',
2059 +'bac_ENABLE_TAPE_BACKUP' => 'Enable tape backup',
2060 +'bac_TAPE_BACKUP_TIME' => 'Tape backup time of day (hour/min)',
2061 +'bac_LOAD_TAPE_REMINDER_TIME' => 'Load tape reminder time of day (hour/min)',
2062 +'bac_AM/PM' => 'AM/PM',
2063 +'bac_AM' => 'AM',
2064 +'bac_PM' => 'PM',
2065 +'bac_UPDATE_CONF' => 'Update',
2066 +'bac_UPDATING_TAPE_CONF' => 'Updating tape backup configuration',
2067 +'bac_ERR_INVALID_HOUR' => 'Error: invalid backup hour: ',
2068 +'bac_BETWEEN_0_AND_12' => 'Please choose an hour between 0 and 12.',
2069 +'bac_ERR_INVALID_MINUTE' => 'Error: invalid backup minute: ',
2070 +'bac_BETWEEN_0_AND_59' => 'Please choose a minute between 0 and 59.',
2071 +'bac_ERR_INVALID_REMINDER_HOUR' => 'Error: invalid reminder hour: ',
2072 +'bac_ERR_INVALID_REMINDER_MINUTE' => 'Error: invalid reminder minute: ',
2073 +'bac_ERR_CONF_BACKUP' => 'Error occurred during conf-backup event.',
2074 +'bac_SUCCESSFULLY_ENABLED_TAPE' => 'Successfully enabled tape backups',
2075 +'bac_WITH_BACKUP_TIME' => 'with backup time: ',
2076 +'bac_WITH_REMINDER_TIME' => 'and load tape reminder time: ',
2077 +'bac_SUCCESSFULLY_DISABLED' => 'Successfully disabled tape backups',
2078 +'bac_RESTORE_CONF_FROM_TAPE' => 'Restore server configuration from tape backup',
2079 +'bac_RESTORE_CONF_FROM_TAPE_DESC' => '<P>This process will restore the configuration and user data files from a
2080 +server tape backup. <B>The restore should be performed on a freshly installed server</B>.</P>
2081 +<P>Ensure that you have loaded the desired backup tape into the tape drive
2082 +before proceeding.</P>
2083 +<P>After the restore completes you must reboot the server.</P>',
2084 +'bac_RESTORE_FROM_TAPE' => 'Restore From Tape',
2085 +'bac_UNABLE_TO_RESTORE_CONF' => 'Unable to restore server configuration',
2086 +'bac_RESTORING_FROM_TAPE' => 'Restoring From Tape',
2087 +'bac_NOW_RESTORING_FROM_TAPE' => 'Your server configuration and user data
2088 +files are now being restored from tape.',
2089 +'bac_ERR_RESTORING_FROM_TAPE' => 'Error occurred restoring files from tape.',
2090 +'bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE' => 'Error occurred while updating system configuration after tape
2091 +restore.',
2092 +'bac_COULD_NOT_FORK' => 'Could not fork: ',
2093 +'bac_SERVER_REBOOT' => 'Server reboot',
2094 +'bac_SERVER_WILL_REBOOT' => 'Your server will now reboot.',
2095 +'bac_NO_UID_FOR_NAME' => 'Could not get uid for user named: ',
2096 +'bac_PAGE_REFRESH_IN' => 'This page will refresh to the status display in {$sec} seconds, or
2097 +click <a href="/server-manager/cgi-bin/backup">here</a>.',
2098 +'bac_Backup or restore' => 'Backup or restore',
2099 +'bac_BACKUP_DESKTOP_TOO_BIG' => '<div class="error">
2100 +Your server has too much data for a reliable backup to desktop.
2101 +</div>',
2102 +'bac_WORKSTN_BACKUPS_DISABLED' => 'Workstation backups are <b>disabled</b>',
2103 +'bac_WORKSTN_BACKUPS_ENABLED' => 'Workstation backups are currently <b>enabled</b>.',
2104 +'bac_WKBACKUPS_RUN_AT' => 'Regular workstation backups will run at: ',
2105 +'bac_WORKSTN_CONFIGURE' => 'Configure workstation backup',
2106 +'bac_WORKSTN_VERIFY' => 'Verify workstation backup',
2107 +'bac_WORKSTN_RESTORE' => 'Restore from workstation',
2108 +'bac_CONFIGURE_WORKSTN_BACKUP' => 'Configure Workstation Backup',
2109 +'bac_ENABLE_DISABLE_WORKSTN' => 'Enable/Disable Daily Workstation Backup',
2110 +'bac_ENABLE_WORKSTN_BACKUP' => 'Enable Workstation Backup',
2111 +'bac_WORKSTN_BACKUP_TIME' => 'Workstation backup time of day (hour/min)',
2112 +'bac_UPDATING_WORKSTN_CONF' => 'Updating workstation backup configuration',
2113 +'bac_SUCCESSFULLY_ENABLED_WORKSTN' => 'Successfully enabled workstation backups',
2114 +'bac_SUCCESSFULLY_DISABLED_WORKSTN' => 'Successfully disabled workstation backups',
2115 +'bac_VERIFY_WORKSTN_BACKUP_FILE' => 'Verify workstation backup',
2116 +'bac_VERIFY_WORKSTN_BACKUP_DESC' => '<p>This option will display the names of all files
2117 +in a previously created workstation daily backup. You
2118 +can use this option to verify the contents of the
2119 +backup.<b>You must choose the backup you want to verify</b></p>
2120 +<p>Only files flagged with [Saved] are contained in the backup.</p>
2121 +<br/>Backup files are verified from shared folder :',
2122 +'bac_RESTORE_CONF_FROM_WORKSTN' => 'Restore server configuration from workstation backup',
2123 +'bac_RESTORE_CONF_FROM_WORKSTN_DESC' => '<p>This process will restore the configuration and user data files from a
2124 +Server workstation backup. <b>The restore
2125 +should be performed on a freshly installed Server</b>.</p>
2126 +<p>Ensure that choose the right backup to restore below
2127 +before proceeding.</p>
2128 +<p>After the restore completes you must reboot the server.</p>
2129 +Backup will be restored from : ',
2130 +'bac_RESTORE_FROM_WORKSTN' => 'Restore From Workstation',
2131 +'bac_RESTORING_FROM_WORKSTN' => 'Restoring From Workstation',
2132 +'bac_NOW_RESTORING_FROM_WORKSTN' => 'Your server configuration and user data
2133 +files are now being restored from workstation shared folder.',
2134 +'bac_ERR_RESTORING_FROM_WORKSTN' => 'Error occurred restoring files from workstation.',
2135 +'bac_ERR_UPDATING_CONF_AFTER_WORKSTN_RESTORE' => 'Error occurred while updating system configuration after workstation
2136 +restore.',
2137 +'bac_WORKSTN_NAME' => 'Workstation IP or hostname',
2138 +'bac_WORKSTN_BACKUP_SETTINGS' => 'Workstation Backup Settings',
2139 +'bac_SHARED_FOLDER_NAME' => 'Backup share',
2140 +'bac_WORKSTN_LOGIN' => 'Login name',
2141 +'bac_WORKSTATION_BACKUP_DEST' => 'Backup workstation settings',
2142 +'bac_CONFIGURE_WORKSTN_BACKUP_DESC' => 'You can set the number of
2143 +successive backup sets to keep on the workstation, with automatic rotation.
2144 +Each set may contain saved data for several consecutive days.
2145 +In this case first backup of the set is full backup, others daily backups are
2146 +incremental. You can also set a time limit for each backup session or for incremental
2147 +backups only. When this limit occurs, backup is cleanly stopped and the next
2148 +incremental backup will safely continue with unsaved and modified datas.',
2149 +'bac_ERR_INVALID_WORKSTN' => 'Invalid Workstation IP or Hostname ',
2150 +'bac_ERR_INVALID_FOLDER' => 'Invalid share name',
2151 +'bac_ERR_INVALID_LOGIN' => 'Invalid Login',
2152 +'bac_ERR_INVALID_PASSWORD' => 'Invalid Password',
2153 +'bac_ERR_ALREADY_MOUNTED' => 'Backup directory is already mounted',
2154 +'bac_ERR_MOUNTING_SMBSHARE' => 'Unable to mount workstation shared folder',
2155 +'bac_ERR_NOT_MOUNTED' => 'Backup directory is not mounted',
2156 +'bac_WORKSTN_NOT_SET' => 'You must first correctly configure your workstation backup',
2157 +'bac_NO_BACKUPS_TO_RESTORE' => 'There is no backup set on configured workstation shared folder. Verify your configuration settings.',
2158 +'bac_NUMBER_OF_SETS' => 'Number of rotating backup sets',
2159 +'bac_NUMBER_OF_FILES_IN_SET' => 'Daily backups in each set',
2160 +'bac_ERR_INVALID_SETS_NUMBER' => 'Sets number must be 1 or greater',
2161 +'bac_ERR_INVALID_FILES_IN_SET_NUMBER' => 'This number must be 1 or greater. First backup in set is <b>full</b> others are <b>incrementals</b>',
2162 +'bac_WORKSTN_TIMEOUT' => 'Optional backup session timeout (hours)',
2163 +'bac_INC_ONLY_TIMEOUT' => 'Don\'t timeout full backup sessions',
2164 +'bac_ERR_INVALID_TIMEOUT' => 'Maximum backup time must be set between 1 and 24 hours',
2165 +'bac_ERR_NO_HOST_DIR' => 'No directory for your host in shared folder. Maybe your host name is different from backup ones',
2166 +'bac_ERROR_READING_FILE' => 'Error while reading files from',
2167 +'bac_WORKSTN_SEL_RESTORE' => 'Selective file restore from workstation',
2168 +'bac_WORKSTN_SELECTIVE_RESTORE' => 'Workstation selective file restore',
2169 +'bac_ALL_BACKUPS' => 'All backups',
2170 +'bac_WORKSTN_SEL_REST_DESC' => 'This process will restore only specified files and directories. You must first choose
2171 +the backup from which the files will be restored. If you don\'t know in which backup
2172 +are the required files, you can select \'All backups\' option. <br/><br/>
2173 +The next panel will display available files and directories,
2174 +so you can choose the ones to restore. To restrict the number of files and directories
2175 +displayed in this panel, you have the option to give now a filtering expression,
2176 +applied as a regular expression to the displayed names.<br/><br/>
2177 +You have the responsibility not to restore files which could break the
2178 +functioning of your server.<br/> <br/>Currently, files will be restored from :',
2179 +'bac_BACKUP_CHOICE' => 'Selecting files to display',
2180 +'bac_SELECT_DATE_BEFORE' => 'Restore most recent before',
2181 +'bac_FILTER_EXPRESSION' => 'Names filtered by',
2182 +'bac_READ_COMPLETE' => 'You can choose all the directories and files you want to restore in the displayed list
2183 +(use ctrl or shift for multiple selection). <br/> <b>Warning :</b> If you select a directory,
2184 +all contained files and directories will be restored.<p/>
2185 +By default the most recent version of selected files is restored, but if you specify a date
2186 +in the format <i>[ [ [yyyy/]mm/]dd-]hh:mm[:ss]</i> the process
2187 +will restore only the most recent version modified <b>before the given date</b>.',
2188 +'bac_ERR_INVALID_SELDATE' => 'Date format is invalid, must be [ [ [yyyy/]mm/]dd-]hh:mm[:ss]. ie: 2005/12/31-08:23:32 or
2189 +10-08:32 or 08:32',
2190 +'bac_SELECT_FILES_TO_RESTORE' => 'Select files to restore',
2191 +'bac_ERR_WHILE_UNMOUNTING' => 'Error occurs when unmounting distant share',
2192 +'bac_ERR_DAR_CATALOG' => 'Error when using Dar catalog',
2193 +'bac_COMPRESSION_LEVEL' => 'Backup compression level [0-9]',
2194 +'bac_FULL_ONLY_ON' => 'Full backup is allowed on',
2195 +'bac_ERR_INVALID_COMPRESSION' => 'Compression level must be set between 0 (no compression) and 9 (maximum compression)',
2196 +'bac_DOW' => 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Everyday',
2197 +'bac_CONFIGURATION_TO_BE_DONE' => 'Please configure the backup settings.',
2198 +'bac_WORKSTN_BACKUP_DESC' => '<p>This panel displays the present workstation backup configuration. You can
2199 +change it in this panel and the next one.</p><p/>',
2200 +'bac_WORKSTN_BACKUP_NOT_CONFIGURED' => '<p>Presently, workstation backup is not configured. You can set this configuration
2201 +with this panel and the next one.</p><p/>',
2202 +'bac_WORKSTN_BACKUP_ENABLED' => 'Backup is ',
2203 +'bac_WORKSTN_BACKUP_USB' => 'Backup is made on local removable disk',
2204 +'bac_WORKSTN_BACKUP_MNT' => 'Backup is made on mounted disk',
2205 +'bac_WORKSTN_BACKUP_HOST' => 'Backup is made on LAN workstation ',
2206 +'bac_WORKSTN_BACKUP_VFSTYPE' => ' via ',
2207 +'bac_WORKSTN_BACKUP_SHARE' => 'Destination backup share folder is ',
2208 +'bac_WORKSTN_BACKUP_TOD' => 'Daily backup occurs at ',
2209 +'bac_LOGIN' => 'Login is ',
2210 +'bac_PASSWORD' => 'Password is ',
2211 +'bac_WORKSTN_BACKUP_SETSNUM' => 'Number of rotating backup sets is ',
2212 +'bac_WORKSTN_BACKUP_DAYSINSET' => 'Number of daily backups contained in each set is ',
2213 +'bac_WORKSTN_BACKUP_COMPRESSION' => 'Compression level (0-9) of backup is ',
2214 +'bac_WORKSTN_BACKUP_TIMEOUT' => 'Each daily backup session is cleanly timed out after ',
2215 +'bac_WORKSTN_BACKUP_INCONLY_TIMEOUT' => 'except full backups which are cleanly timed out after 24 hours',
2216 +'bac_WORKSTN_FULL_BACKUP_EVERYDAY' => 'Full backup sessions (new backup set) are allowed everyday',
2217 +'bac_WORKSTN_FULL_BACKUP_DAY' => 'Full backup session (new backup sets) is allowed only on',
2218 +'bac_WORKSTATION_BACKUP_SETCONF' => 'Create or modify workstation backup configuration',
2219 +'bac_SELECT_VFS_TYPE' => 'Select the type of share for backup destination',
2220 +'bac_ERR_NO_USB_DISK' => 'Error : No removable disk available. Please connect a removable disk or select another type of workstation backup.',
2221 +'bac_ERR_NO_MOUNTED_DISK' => 'Error : No mounted disk available. Please mount a disk or select another type of workstation backup.',
2222 +'bac_HOURS' => 'hours.',
2223 +'bac_ERR_NO_FULL_BACKUP' => 'Aborting restore because needed full backup is missing or unreadable.',
2224 +'bac_ERR_NO_INC_BACKUP' => 'Aborting restore because the set has missing or unreadable incremental backup number',
2225 +'bac_CHECK_TO_VERIFY_FULL_RESTORE' => 'Check here to test integrity of all backups needed for a full restore with the selected backup ',
2226 +'bac_TESTING_NEEDED_BACKUPS_FOR_RESTORE' => 'Testing all backups needed for a full restore with selected backup',
2227 +'bac_TESTED_BACKUP' => 'Testing integrity of backup',
2228 +'bac_RESTORE_VERIFY_FAILED' => 'Verify integrity failed',
2229 +'bac_CHECK_INTEGRITY_WARNING' => 'Warning : For large backups, checking integrity may be a long task and should be made with daily workstation backup disabled.',
2230 +'bac_cifs' => 'cifs',
2231 +'bac_nfs' => 'nfs',
2232 +'bac_local removable disk' => 'Local removable disk',
2233 +'bac_Mounted disk' => 'Mounted disk',
2234 +'bac_ERROR_WHEN_TESTING_REMOTE_SERVER' => 'The parameters have been saved, however the remote host is not reachable, please check your settings.',
2235 +
2236 +
2237 +'mai_FORM_TITLE' => 'E-mail settings',
2238 +'mai_E-mail' => 'E-mail',
2239 +'mai_SUCCESS' => 'The new e-mail settings have been saved.',
2240 +'mai_NEVER' => 'not at all',
2241 +'mai_EVERY5MIN' => 'Every 5 minutes',
2242 +'mai_EVERY15MIN' => 'Every 15 minutes',
2243 +'mai_EVERY30MIN' => 'Every 30 minutes',
2244 +'mai_EVERYHOUR' => 'Every hour',
2245 +'mai_EVERY2HRS' => 'Every 2 hours',
2246 +'mai_STANDARD' => 'Standard (SMTP)',
2247 +'mai_ETRN' => 'ETRN (SMTP with client request)',
2248 +'mai_DEFAULT' => 'Default',
2249 +'mai_SPECIFY_BELOW' => 'Specify below',
2250 +'mai_MULTIDROP' => 'multi-drop',
2251 +'mai_LABEL_MODE' => 'E-mail retrieval mode',
2252 +'mai_DESC_MODE' => 'The e-mail retrieval mode can be set to
2253 +standard (for dedicated Internet connections), ETRN (recommended
2254 +for dialup connections), or multi-drop (for dialup connections if
2255 +ETRN is not supported by your Internet provider). Note that
2256 +multi-drop mode is the only option available when the server is
2257 +configured in private server and gateway mode.',
2258 +'mai_LABEL_DELEGATE' => 'Address of internal mail server',
2259 +'mai_DESC_DELEGATE' => '<hr class="sectionbar" /><h2>Delegate mail servers</h2> Your
2260 +server includes a complete, full-featured e-mail server. However,
2261 +if for some reason you wish to delegate e-mail processing to
2262 +another system, specify the IP address of the delegate system
2263 +here. For normal operation, leave this field blank.',
2264 +'mai_LABEL_SECONDARY' => 'Secondary mail server',
2265 +'mai_DESC_SECONDARY' => '<hr class="sectionbar" /><h2>ETRN or multi-drop settings</h2> For
2266 +ETRN or multi-drop, specify the hostname or IP address of your
2267 +secondary mail server. (If using the standard e-mail setup, this
2268 +field can be left blank.)',
2269 +'mai_DESC_FETCH_PERIOD' => 'For ETRN or multi-drop, you can control how frequently this server
2270 +contacts your secondary e-mail server to fetch e-mail. More
2271 +frequent connections mean that you receive your e-mail more
2272 +quickly, but also cause Internet requests to be sent more often,
2273 +possibly increasing your phone and Internet charges.',
2274 +'mai_LABEL_FETCH_PERIOD' => 'During office hours (8:00 AM to 6:00 PM) on weekdays',
2275 +'mai_LABEL_FETCH_PERIOD_NIGHTS' => 'Outside office hours (6:00 PM to 8:00 AM) on weekdays',
2276 +'mai_LABEL_FETCH_PERIOD_WEEKENDS' => 'During the weekend',
2277 +'mai_DESC_POP_ACCOUNT' => 'For multi-drop e-mail, specify the POP user account and password.
2278 +(If using standard or ETRN e-mail, these fields can be blank.)
2279 +Also, for multi-drop, you can either use the default mail sorting
2280 +method, or you can specify a particular message header to use for
2281 +mail sorting.',
2282 +'mai_LABEL_POP_PASS' => 'POP user password (for multi-drop)',
2283 +'mai_LABEL_POP_ACCOUNT' => 'POP user account (for multi-drop)',
2284 +'mai_LABEL_SORT_METHOD' => 'Select sort method (for multi-drop)',
2285 +'mai_LABEL_SORT_HEADER' => 'Select sort header (for multi-drop)',
2286 +'mai_LABEL_FETCH_PROTO' => 'Protocol (for multi-drop)',
2287 +'mai_LABEL_FETCH_SECURE' => 'Tunnel over SSL (for multi-drop)',
2288 +'mai_AUTO' => 'Automatic',
2289 +'mai_ENABLED_BOTH' => 'Allow both HTTP and HTTPS',
2290 +'mai_ENABLED_SECURE_ONLY' => 'Allow HTTPS (secure)',
2291 +'mai_ONLY_LOCAL_NETWORK_SSL' => 'Allow HTTPS (secure) from local networks',
2292 +'mai_INSECURE_POP3' => 'Allow both POP3 and POP3S',
2293 +'mai_ALLOW_PRIVATE' => 'Allow private',
2294 +'mai_SECURE_POP3' => 'Allow private and public (secure POP3S)',
2295 +'mai_INSECURE_IMAP' => 'Allow both IMAP and IMAPS',
2296 +'mai_SECURE_IMAP' => 'Allow private and public (secure IMAPS)',
2297 +'mai_INSECURE_SMTP' => 'Allow both SMTP and SSMTP',
2298 +'mai_SECURE_SMTP' => 'Allow SSMTP (secure)',
2299 +'mai_LABEL_POP_ACCESS_CONTROL' => 'POP3 server access',
2300 +'mai_LABEL_IMAP_ACCESS_CONTROL' => 'IMAP server access',
2301 +'mai_LABEL_SMTP_AUTH_CONTROL' => 'SMTP authentication',
2302 +'mai_FORWARD_TO_ADMIN' => 'Send to administrator',
2303 +'mai_FORWARD_TO' => 'Send to',
2304 +'mai_RETURN_TO_SENDER' => 'Reject',
2305 +'mai_LABEL_UNKNOWN' => 'E-mail to unknown users',
2306 +'mai_DESC_UNKNOWN' => '<h2>Unknown Users</h2>
2307 +Selecting Reject (recommended setting) will configure the server to only
2308 +accept mail for valid email addresses (for example users, groups, pseudonyms).
2309 +Mail for other addresses will be rejected.',
2310 +'mai_LABEL_SMARTHOST' => 'Address of Internet provider\'s mail server',
2311 +'mai_DESC_SMARTHOST' => '<hr class="sectionbar" /><h2>SMTP server</h2>
2312 +The server can deliver outgoing messages directly to their
2313 +destination (recommended in most cases) or can deliver them via
2314 +your Internet provider\'s SMTP server (recommended if you have an
2315 +unreliable Internet connection or are using a residential Internet
2316 +service). If using your Internet provider\'s SMTP server, specify
2317 +its hostname or IP address below. Otherwise leave this field
2318 +blank.',
2319 +'mai_INVALID_SMARTHOST' => 'The smarthost name you entered is not a valid internet domain name
2320 +and is not blank',
2321 +'mai_DESC_POP_ACCESS_CONTROL' => 'You can control POP3 server access. The setting \'Allow access
2322 +only from local networks\' allows POP3 access only from your
2323 +local network(s). The POP3S setting can be used to provide
2324 +encrypted external access to your POP3 server. We recommend
2325 +leaving this setting \'Allow access only from local networks\'
2326 +unless you have a specific reason to do otherwise.',
2327 +'mai_DESC_IMAP_ACCESS_CONTROL' => 'You can control IMAP server access. The setting \'Allow access
2328 +only from local networks\' allows IMAP access only from your
2329 +local network(s). The IMAPS setting can be used to provide
2330 +encrypted external access to your IMAP server. We recommend
2331 +leaving this setting \'Allow access only from local networks\'
2332 +unless you have a specific reason to do otherwise.',
2333 +'mai_DESC_SMTP_AUTH_CONTROL' => 'You can provide authenticated access to your SMTP server, or
2334 +set it to Disabled.
2335 +The SSMTP setting requires <b>all</b> users to use SSL/TLS
2336 +authentication. The SMTP and SSMTP option additionally allows
2337 +STARTTLS to be used to ensure secure authentication.',
2338 +'mai_DESC_WEBMAIL' => 'You can enable or disable webmail on this system. Webmail allows
2339 +users to access their mail through a regular web browser by
2340 +pointing the browser to https://{$FQDN}/webmail,and
2341 + logging in to their account.',
2342 +'mai_LABEL_WEBMAIL' => 'Webmail access',
2343 +'mai_LABEL_BLOCK_EXECUTABLE_CONTENT' => 'Executable content blocking',
2344 +'mai_LABEL_CONTENT_TO_BLOCK' => 'Content to block',
2345 +'mai_DESC_BLOCK_EXECUTABLE_CONTENT' => 'You can block executable content in e-mail attachments
2346 +by highlighting the executable attachment types you wish to
2347 +block. E-mail containing these attachment types will
2348 +be automatically returned to the sender.',
2349 +'mai_UNACCEPTABLE_CHARS' => 'This field requires a valid e-mail address, which must include
2350 +the @ symbol and a domain name.',
2351 +'mai_DESC_STATE_ACCESS' => '<h2>E-mail access</h2>',
2352 +'mai_DESC_STATE_ACCESS_BUTTON' => '<a class="button-like"
2353 +href="emailsettings?page=0&page_stack=&Next=Next&wherenext=EMAIL_PAGE_ACCESS">Change e-mail access settings</a>',
2354 +'mai_DESC_STATE_RECEPTION' => '<hr class="sectionbar" /><h2>E-mail reception</h2>',
2355 +'mai_DESC_STATE_RECEPTION_BUTTON' => '<a class="button-like"
2356 +href="emailsettings?page=0&page_stack=&Next=Next&wherenext=EMAIL_PAGE_RECEPTION">Change e-mail reception settings</a>',
2357 +'mai_DESC_STATE_DELIVERY' => '<hr class="sectionbar" /><h2>E-mail delivery</h2>',
2358 +'mai_DESC_STATE_DELIVERY_BUTTON' => '<a class="button-like"
2359 +href="emailsettings?page=0&page_stack=&Next=Next&wherenext=EMAIL_PAGE_DELIVERY">Change e-mail delivery settings</a>',
2360 +'mai_DESC_STATE_FILTERING_BUTTON' => '<a class="button-like"
2361 +href="emailsettings?page=0&page_stack=&Next=Next&wherenext=EMAIL_PAGE_FILTERING">Change e-mail filtering settings</a>',
2362 +'mai_LABEL_VIRUS_SCAN' => 'Virus scanning',
2363 +'mai_DESC_VIRUS_SCAN' => 'You can scan incoming and outgoing e-mail for viruses. If scanning is enabled and a virus is detected, the e-mail will be rejected and returned to the
2364 +sender.',
2365 +'mai_LABEL_SPAM_SCAN' => 'Spam filtering',
2366 +'mai_DESC_SPAM_SCAN' => 'You can scan e-mail for spam. If Spam filtering is
2367 +enabled, an X-Spam-Status: header is added to each
2368 +message, which can be used for filtering spam.
2369 +You can adjust the sensitivity of the Spam detection
2370 +process from the default of medium. For fine-grained
2371 +control, you can set the Spam sensitivity to Custom
2372 +and then choose a custom tagging level, and
2373 +optionally a level at which to reject the message.',
2374 +'mai_LABEL_SPAM_SUBJECT' => 'SPAM subject prefix',
2375 +'mai_DESC_SPAM_SUBJECT' => 'You can enable to add a tag to the subject of each
2376 +message that is classified as SPAM.
2377 +The value for this tag can be defined below.',
2378 +'mai_LABEL_SPAM_SENSITIVITY' => 'Spam sensitivity',
2379 +'mai_LABEL_SPAM_TAGLEVEL' => 'Custom spam tagging level',
2380 +'mai_LABEL_SPAM_REJECTLEVEL' => 'Custom spam rejection level',
2381 +'mai_LABEL_SPAM_SUBJECTTAG' => 'Modify subject of spam messages',
2382 +'mai_LABEL_SORTSPAM' => 'Sort spam into junkmail folder',
2383 +'mai_VERYHIGH' => 'Very high',
2384 +'mai_HIGH' => 'High',
2385 +'mai_MEDIUM' => 'Medium',
2386 +'mai_LOW' => 'Low',
2387 +'mai_VERYLOW' => 'Very low',
2388 +'mai_CUSTOM' => 'Custom',
2389 +'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' => 'SMTP Authentication for Internet provider',
2390 +'mai_LABEL_SMARTHOST_SMTPAUTH_USERID' => 'Mail server user id',
2391 +'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD' => 'Mail server password',
2392 +'mai_VALIDATION_SMTPAUTH_NONBLANK' => 'This field cannot be left blank if SMTP Authentication is
2393 +enabled.',
2394 +
2395 +'yum_Software installer' => 'Software installer',
2396 +'yum_SUCCESS' => 'The new settings have been saved.',
2397 +'yum_LABEL_YUM_STATUS' => 'Check for updates',
2398 +'yum_LABEL_YUM_AUTOINSTALLUPDATES' => 'Automatically install updates',
2399 +'yum_LABEL_YUM_AUTOINSTALLUPDATES_DESCRIPTION' => 'If enabled this will take precedence over the simple check for updates notification and predownload features. Instead it will install the available updates from enabled repositories. For more information refer to yum and yum-cron manual page.',
2400 +'yum_LABEL_YUM_PACKAGEFUNCTIONS' => 'Manage individual packages',
2401 +'yum_DESC_YUM_PACKAGEFUNCTIONS' => 'The software installer can manage groups of
2402 +related package or individual packages. By
2403 +default, only groups of packages are presented.
2404 +If you wish to manage individual packages,
2405 +enable this option. This should only be done
2406 +by experienced administrators.',
2407 +'yum_LABEL_ENABLED_REPOSITORIES' => 'Enabled repositories',
2408 +'yum_DESC_ENABLED_REPOSITORIES' => 'The software installer can install software
2409 +from any of enabled repositories. To enable
2410 +a repository, select it from the list.
2411 +To disable a repository, de-select it from the list.
2412 +By default, only stable, tested software is available
2413 +for installation.',
2414 +'yum_DESC_UPTODATE' => '<div class="success">
2415 +<h2>This system is up to date.</h2>
2416 +All updates have been installed.
2417 +</div>',
2418 +'yum_DESC_UPDATES_AVAILABLE' => '<div class="success">
2419 +<h2>Updates Available</h2>
2420 +There are updates available for your system. These updates
2421 +should be installed as soon as possible.
2422 +</div>',
2423 +'yum_LABEL_AVAILABLE_UPDATES' => 'Updates available',
2424 +'yum_DESC_AVAILABLE_UPDATES' => 'The following updates are available for your system.
2425 +You should normally install all available updates.
2426 +If there are updates you do not wish to install, de-select
2427 +them from the list below.',
2428 +'yum_INSTALL_UPDATES' => 'Install selected updates',
2429 +'yum_DESC_BUTTON_INSTALL_UPDATES' => '<a class="button-like"
2430 +href="yum?page=0&page_stack=&Next=Next&wherenext=YUM_PAGE_INSTALL_UPDATES">List available updates</a>',
2431 +'yum_HEADER_AVAILABLE_SOFTWARE' => 'The following software is available to be installed
2432 +onto your system. You should only install additional
2433 +software onto this system if you are aware
2434 +of the consequences of doing so.',
2435 +'yum_DESC_AVAILABLE_GROUPS' => 'You can select software groups
2436 +to install from the list below.',
2437 +'yum_LABEL_AVAILABLE_GROUPS' => 'Available groups',
2438 +'yum_DESC_AVAILABLE_PACKAGES' => 'You can also select individual packages
2439 +to install from the list below.',
2440 +'yum_LABEL_AVAILABLE_PACKAGES' => 'Available packages',
2441 +'yum_INSTALL_SOFTWARE' => 'Install',
2442 +'yum_HEADER_INSTALLED_SOFTWARE' => 'The following software is installed
2443 +on this system. You should only remove
2444 +software from this system if you are aware
2445 +of the consequences of doing so.',
2446 +'yum_DESC_INSTALLED_GROUPS' => 'You can select software groups
2447 +to remove from the list below.',
2448 +'yum_LABEL_INSTALLED_GROUPS' => 'Installed groups',
2449 +'yum_DESC_INSTALLED_PACKAGES' => 'You can also select individual packages
2450 +you wish to remove from the list below.',
2451 +'yum_LABEL_INSTALLED_PACKAGES' => 'Installed packages',
2452 +'yum_DESC_BUTTON_CONFIGURATION' => '<a class="button-like"
2453 +href="yum?page=0&page_stack=&Next=Next&wherenext=YUM_PAGE_CONFIGURATION">Change software installer settings</a>
2454 +',
2455 +'yum_DESC_BUTTON_INSTALL_AVAILABLE' => '<a class="button-like"
2456 +href="yum?page=0&page_stack=&Next=Next&wherenext=YUM_PAGE_INSTALL_AVAILABLE">Install additional software</a>',
2457 +'yum_DESC_BUTTON_REMOVE' => '<a class="button-like"
2458 +href="yum?page=0&page_stack=&Next=Next&wherenext=YUM_PAGE_REMOVE">Remove installed software</a>',
2459 +'yum_HEADER_POSTUPGRADE_REQUIRED' => ' The system needs to be reconfigured
2460 + after adding or removing software,
2461 + or applying updates.
2462 +<p>
2463 +Please click on the Reconfigure button at the bottom of
2464 +this page to start the reconfiguration process.
2465 + <b>An automatic reboot will be
2466 + initiated as part of this reconfiguration process</b>
2467 +</p> ',
2468 +'yum_SYSTEM_BEING_RECONFIGURED' => 'Your system is being automatically rebooted to
2469 +complete the reconfiguraton process.',
2470 +'yum_1DAILY' => 'Daily',
2471 +'yum_2WEEKLY' => 'Weekly',
2472 +'yum_3MONTHLY' => 'Monthly',
2473 +'yum_LABEL_YUM_DELTARPMPROCESS' => 'Delta Rpm Update',
2474 +'yum_LABEL_YUM_DELTARPM' => 'A deltarpm contains the difference between an old and a new version of a rpm,
2475 + which can save bandwith. The drawback is that update
2476 + operations consume considerably more CPU cycles',
2477 +'yum_LABEL_YUM_DOWNLOADONLY' => 'Predownload updates',
2478 +'yum_LABEL_YUM_DOWNLOADONLY_DESCRIPTION' => 'The rpm updates can be downloaded during the night,
2479 + this will ease and give faster the yum update process
2480 + (only enabled repositories will be used).',
2481 +
2482 +
2483 +'rma_FORM_TITLE' => 'Change remote access settings',
2484 +'rma_DESCRIPTION' => 'For each of the options below, the private setting allows anyone
2485 +from your local network to access your server. The
2486 +public setting allows access from anywhere on the Internet. The no
2487 +access setting disables access. To understand the security
2488 +implications of changing these options from the default settings, you
2489 +should read the user\'s guide section on remote access.',
2490 +'rma_SUCCESS' => 'The new remote access settings have been saved.',
2491 +'rma_NO_ACCESS' => 'No Access',
2492 +'rma_PASSWORD_LOGIN_PRIVATE' => 'Accept passwords only from local networks',
2493 +'rma_PASSWORD_LOGIN_PUBLIC' => 'Accept passwords from anywhere',
2494 +'rma_LABEL_TELNET_ACCESS' => 'Telnet access',
2495 +'rma_LABEL_FTP_ACCESS' => 'FTP access',
2496 +'rma_LABEL_FTP_LOGIN' => 'FTP password access',
2497 +'rma_LABEL_PPTP' => 'Number of PPTP clients',
2498 + 'rma_NUMBER_OF_PPTP_CLIENTS_MUST_BE_LESSER_THAN_NUMBER_OF_IP_IN_DHCP_RANGE' =>
2499 + 'The number of pptp clients is greater than the number of reserved IP for DHCP. You should take a smaller number.',
2500 +'rma_LABEL_SSH_PORT' => 'TCP Port for secure shell access',
2501 +'rma_LABEL_SSH' => 'Secure shell access',
2502 +'rma_LABEL_SSH_ADMIN' => 'Allow administrative command line access over secure shell',
2503 +'rma_LABEL_SSH_PASSWORD_ACCESS' => 'Allow secure shell access using standard passwords',
2504 +'rma_TITLE_SSH' => 'Secure Shell Settings',
2505 +'rma_DESC_SSH' => 'You can control Secure Shell access to your server.
2506 +The public setting should only be enabled by
2507 +experienced administrators
2508 +for remote problem diagnosis and resolution.
2509 +We recommend leaving this
2510 +parameter set to "No Access"
2511 +unless you have a specific reason to do otherwise.',
2512 +'rma_TITLE_FTP_ACCESS' => 'FTP Settings',
2513 +'rma_DESC_FTP_ACCESS' => 'You can also control <b>FTP</b> access to your server. We
2514 +recommend leaving this parameter set to \'no access\' unless you
2515 +have a specific reason to do otherwise.
2516 +<p>
2517 +Note: these settings limit access to the server and override other
2518 +settings, including those for individual information bays.</p>',
2519 +'rma_DESC_FTP_LOGIN' => 'You can also control authenticated FTP access to information
2520 +bays and user accounts. We strongly recommend leaving this
2521 +parameter set to private unless you have a specific reason to
2522 +do otherwise.
2523 +<p>
2524 +Note: a secure shell sftp client can also be used to access the
2525 +server, if remote access via the secure shell is enabled.
2526 +This method of access protects the
2527 +passwords and data of the FTP session, whereas standard FTP
2528 +provides no protection.</p>',
2529 +'rma_TITLE_PPTP' => 'PPTP Settings',
2530 +'rma_DESC_PPTP' => 'You can allow PPTP access to your server.
2531 +You should leave this feature disabled by setting the value
2532 +to the number 0 unless you require PPTP access.',
2533 +'rma_VALUE_ZERO_OR_POSITIVE' => 'Value must be zero or a positive integer',
2534 +'rma_REMOTE_MANAGEMENT' => 'Remote Management',
2535 +'rma_VALIDFROM_TITLE' => '[_1]',
2536 +'rma_VALIDFROM_DESC' => 'It is possible to allow hosts on remote networks to access the
2537 +server manager by entering those networks here. Use a subnet
2538 +mask of 255.255.255.255 to limit the access to the specified host.
2539 +Any hosts within the specified range will be able to access the
2540 +server manager using HTTPS.',
2541 +'rma_DESC_VALID_FROM_ENTRIES' => 'To add a new remote management network,
2542 +enter the details below.',
2543 +'rma_SUBNET_MASK' => 'Subnet mask',
2544 +'rma_NUM_OF_HOSTS' => 'Number of hosts',
2545 +'rma_NO_ENTRIES_YET' => 'There are no entries yet',
2546 +'rma_INVALID_SUBNET_MASK' => 'Invalid subnet mask',
2547 +'rma_ERR_INVALID_PARAMS' => 'Either provide both a network and subnet mask, or leave both
2548 +fields blank.',
2549 +'rma_ERR_NO_RECORD' => 'Unable to locate httpd-admin record in configuration db',
2550 +'rma_Remote access' => 'Remote access',
2551 +'rma_LABEL_SERIAL_CONSOLE_ACCESS' => 'Serial console',
2552 +'rma_DESC_SERIAL_CONSOLE_ACCESS' => ' <hr class="sectionbar" /><h2>Serial console</h2>
2553 +You can allow access to the server console from a terminal
2554 +connected to a server serial port.',
2555 +'rma_PORT1_ENABLED' => 'Enabled on serial port 1',
2556 +'rma_PORT2_ENABLED' => 'Enabled on serial port 2',
2557 +'rma_LABEL_PPTP_ACCESS' => 'PPTP default user access',
2558 +'rma_TITLE_TELNET_ACCESS' => 'Telnet Settings',
2559 +'rma_DESC_TELNET_ACCESS' => 'WARNING:Telnet is currently enabled, but this feature is
2560 +no longer supported.Telnet is inherently insecure and should only
2561 +be used in circumstances where no practical alternative exists. You
2562 +should change option to {$NO_ACCESS} and use
2563 +secure shell if remote access is
2564 +required.Once disabled, telnet will no longer appear on this
2565 +screen. ',
2566 +'rma_TITLE_IPSECRW' => 'IPSEC Client (Roadwarrior) Settings',
2567 +'rma_DESC_IPSECRW' => 'You can allow IPSEC client access to your server, authenticated by
2568 +digital certificates. You should leave this feature disabled by setting the value
2569 +to the number 0 unless you require IPSEC client access.',
2570 +'rma_LABEL_IPSECRW_SESS' => 'Number of IPSEC clients',
2571 +'rma_DESC_IPSECRW_RESET' => 'If you wish to reset all digital certificates, you
2572 +can do so here.<br>Any old certificates will no longer
2573 +authenticate against the server, so <b><i>all IPSEC clients will
2574 +need to import a new certificate!</i></b>.',
2575 +'rma_LABEL_IPSECRW_RESET' => 'Reset digital certificates',
2576 +
2577 +'usr_FORM_TITLE' => 'Create, modify, or remove user accounts',
2578 +'usr_FIRSTPAGE_DESC' => '<p>
2579 +You can modify, lock or remove any account or reset the
2580 +account\'s password by clicking on the
2581 +corresponding command next to the account.
2582 +</p>
2583 +<p>
2584 +If the account is marked as locked, that means that the
2585 +user\'s password needs to be reset. Please note
2586 +that newly created accounts are automatically locked until
2587 +the password is changed.
2588 +</p>',
2589 +'usr_P2_TITLE' => 'Create or modify',
2590 +'usr_CREATE_MODIFY_DESC' => '<p>
2591 +The account name should contain only lower-case
2592 +letters, numbers, hyphens, periods, underscores and should start with a
2593 +lower-case letter. For example "betty",
2594 +"hjohnson", and "mary-jane" are all valid account names,
2595 +but "3friends", "John Smith", and "henry:miller" are not.
2596 +</p>
2597 +<p>
2598 +Note that two special pseudonyms will be created for each
2599 +new account. These pseudonyms provide the ability to have
2600 +alternative mail accounts for that
2601 +user which include their first name and last name
2602 +separated with a period (.) and underscore (_). So, for
2603 +the account "betty" with first name "Betty" and
2604 +last name "Rubble" two pseudonyms are created as
2605 +betty.rubble and betty_rubble.
2606 +</p>
2607 +<p>
2608 +The directory information (department, company, etc.)
2609 +can be changed from the defaults shown below. The
2610 +changes will apply only to this user.
2611 +</p>',
2612 +'usr_ADD_USER' => 'Add user account',
2613 +'usr_MODIFY_ADMIN_TITLE' => 'Modify the admin account',
2614 +'usr_USER_CREATED' => 'Successfully created user account. ',
2615 +'usr_USER_MODIFIED' => 'Successfully modified user account. ',
2616 +'usr_CANNOT_MODIFY_USER' => 'Error: an internal error occurred while attempting to modify
2617 +the user "[_1]".',
2618 +'usr_CANNOT_MODIFY_USER_GROUPS' =>'Error: an internal error occurred while attempting to modify
2619 +the group "[_1]" for user "[_2]".',
2620 +'usr_TAINTED_USER' => 'The account name "[_1]" contains invalid characters.',
2621 +'usr_ACCOUNT_NAME' => 'Account name',
2622 +'usr_FIRSTNAME' => 'First name',
2623 +'usr_LASTNAME' => 'Last name',
2624 +'usr_DEPARTMENT' => 'Department',
2625 +'usr_COMPANY' => 'Company',
2626 +'usr_STREET_ADDRESS' => 'Street address',
2627 +'usr_CITY' => 'City',
2628 +'usr_PHONE_NUMBER' => 'Phone number',
2629 +'usr_EMAIL_DELIVERY' => 'Email delivery',
2630 +'usr_DELIVER_EMAIL_LOCALLY' => 'Deliver email locally',
2631 +'usr_FORWARD_EMAIL' => 'Forward email to address below',
2632 +'usr_DELIVER_AND_FORWARD' => 'Both deliver locally and forward',
2633 +'usr_FORWARDING_ADDRESS' => 'Forwarding address',
2634 +'usr_GROUP_MEMBERSHIPS' => 'Group memberships',
2635 +'usr_RESET_DESC' => 'You are about to change the password for the user account "[_1]" ([_2])',
2636 +'usr_RESET_DESC2' => 'Enter the new password in the fields below',
2637 +'usr_ERR_OCCURRED_MODIFYING_PASSWORD' => 'An error occurred while updating the password',
2638 +'usr_PASSWORD_CHANGE_SUCCEEDED' => 'Successfully changed password for user "[_1]".',
2639 +'usr_LOCK_DESC' => 'You are about to lock the user account "[_1]" ([_2])',
2640 +'usr_LOCKED_ACCOUNT' => 'Successfully locked account for user "[_1]".',
2641 +'usr_NO_SUCH_USER' => 'Error: the user account "[_1]" does not exist.',
2642 +'usr_PSEUDONYM_CLASH' => 'Error: the pseudonym "[_1]" is already taken by the
2643 +existing user account "[_1]".To differentiate, add
2644 +initials to this field.',
2645 +'usr_LOCK_ACCOUNT' => 'Lock account',
2646 +'usr_LOCK_ACCOUNT_TITLE' => 'Lock user account',
2647 +'usr_LOCK_DESC2' => '
2648 +This user account will be locked. This means that this user
2649 +will not be able to log in, and will not be able
2650 +to collect e-mail. Any e-mail arriving will still be stored
2651 +and/or forwarded to an external e-mail address,
2652 +as configured. The account may be activated in the future by
2653 +setting a new password. The current
2654 +password will not be retained.
2655 +</p>
2656 +<p>
2657 +<b>Are you sure you wish to lock this account?</b>',
2658 +'usr_REMOVE_ACCOUNT_TITLE' => 'Remove user account',
2659 +'usr_REMOVE_DESC' => 'You are about to remove the user account "[_1]" ([_2])',
2660 +'usr_REMOVE_DESC2' => 'All files belonging to this user account will be deleted.
2661 +Also, any e-mail for this user account still
2662 +remaining on the server (i.e. that has not yet been
2663 +retrieved by the user) will be discarded.
2664 +</p><p>
2665 +<b>Are you sure you wish to remove this account?</b>',
2666 +'usr_LOCK' => 'Lock',
2667 +'usr_NO_USER_ACCOUNTS' => 'There are no user accounts on this system.',
2668 +'usr_Users' => 'Users',
2669 +'usr_ACCT_NAME_HAS_INVALID_CHARS' => 'The account name "[_1]" contains invalid characters.
2670 +Account names must start with a lower case letter and contain
2671 +only lower case letters, numbers, hyphens, periods and underscores.',
2672 +'usr_ACCOUNT_TOO_LONG' => 'Error: account name is too long. The maximum is [_1]
2673 +characters.',
2674 +'usr_ACCOUNT_CONFLICT' => 'Error: the account "[_1]" can\'t be created because
2675 +there is already a [_1] account of that name.',
2676 +'usr_ERR_OCCURRED_CREATING' => 'An error occurred creating the user.',
2677 +'usr_CANNOT_CONTAIN_WHITESPACE' => 'This field cannot contain white-space',
2678 +'usr_UNACCEPTABLE_CHARS' => '
2679 +This field must contain only letters, numbers, dots, hypens and
2680 +underscores and start with a letter',
2681 +'usr_MEMBER' => 'Member?',
2682 +'usr_VPN_CLIENT_ACCESS' => 'VPN Client Access',
2683 +'usr_SYSTEM_PASSWORD_FORM_TITLE' => 'Change system password',
2684 +'usr_SYSTEM_PASSWORD_DESCRIPTION' => 'Certain services on this server installation require a
2685 +username and password (for example this web page for the server manager
2686 +application). The username is always admin. You can change the system
2687 +password using the fields below.',
2688 +'usr_SYSTEM_PASSWORD_UNPRINTABLES_IN_PASS' => 'Password must contain only printable characters',
2689 +'usr_SYSTEM_PASSWORD_VERIFY_ERROR' => 'The two passwords are not identical.',
2690 +'usr_SYSTEM_PASSWORD_AUTH_ERROR' => 'The current password is incorrect.',
2691 +'usr_SYSTEM_PASSWORD_CHANGED' => 'The system password has been changed.',
2692 +'usr_CURRENT_SYSTEM_PASSWORD' => 'Current system password',
2693 +'usr_NEW_SYSTEM_PASSWORD' => 'New system password',
2694 +'usr_NEW_SYSTEM_PASSWORD_VERIFY' => 'New system password (verify)',
2695 +'usr_LABEL_IPSECRW_DOWNLOAD' => 'Download digital certificate to IPSec client',
2696 +'usr_ERR_OCCURRED_DELETING' => 'An error occurred while trying to delete the user.',
2697 +
2698 );
2699
2700
2701 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr.pm
2702 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr.pm 2020-01-24 23:45:10.000000000 +0400
2703 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr.pm 2020-02-29 18:37:52.000000000 +0400
2704 @@ -18,7 +18,8 @@
2705
2706 our @ISA = qw(Exporter);
2707
2708 -our @EXPORT_OK = qw( init_session_cgi get_mod_url theme_list getNavigation );
2709 +our @EXPORT_OK = qw( init_session_cgi get_mod_url theme_list
2710 + getNavigation ip_number is_normal_password email_simple);
2711
2712
2713 my $config = plugin( 'Config' => { files => './conf/srvmngr.conf' });
2714 @@ -248,4 +249,59 @@
2715
2716 }
2717
2718 +
2719 +sub ip_number {
2720 +
2721 +# from CGI::FormMagick::Validator qw( ip_number );
2722 +
2723 + my ($c, $data) = @_;
2724 +
2725 + return undef unless defined $data;
2726 +
2727 + return $c->l('FM_IP_NUMBER1') . " (" . $data . ")" unless $data =~ /^[\d.]+$/;
2728 +
2729 + my @octets = split /\./, $data;
2730 + my $dots = ($data =~ tr/.//);
2731 +
2732 + return $c->l('FM_IP_NUMBER2') unless (scalar @octets == 4 and $dots == 3);
2733 +
2734 + foreach my $octet (@octets) {
2735 + return $c->l("FM_IP_NUMBER3", $octet) if $octet > 255;
2736 + }
2737 +
2738 + return 'OK';
2739 +}
2740 +
2741 +
2742 +sub is_normal_password {
2743 +
2744 +# from CGI::FormMagick::Validator qw( password );
2745 +
2746 + my ($c, $data) = @_;
2747 + $_ = $data;
2748 + if (not defined $_) {
2749 + return $c->l("FM_PASSWORD1");
2750 + } elsif (/\d/ and /[A-Z]/ and /[a-z]/ and /\W|_/ and length($_) > 6) {
2751 + return "OK";
2752 + } else {
2753 + return $c->l("FM_PASSWORD2");
2754 + }
2755 +}
2756 +
2757 +
2758 +sub email_simple {
2759 + my ($c, $data) = @_;
2760 +
2761 + use Mail::RFC822::Address;
2762 +
2763 + if (not defined $data ) {
2764 + return $c->l("FM_EMAIL_SIMPLE1");
2765 + } elsif (Mail::RFC822::Address::valid($data)) {
2766 + return "OK";
2767 + } else {
2768 + return $c->l("FM_EMAIL_SIMPLE2");
2769 + }
2770 +}
2771 +
2772 +
2773 1;
2774 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl
2775 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl 2020-02-19 22:43:47.000000000 +0400
2776 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl 2020-02-29 21:24:25.000000000 +0400
2777 @@ -57,6 +57,7 @@
2778 $r->namespaces(['SrvMngr::Controller']);
2779
2780 $r->get('/')->to('initial#main')->name('initial');
2781 +
2782 $r->get('/bugreport')->to('bugreport#main')->name('bugreport');
2783 $r->post('/bugreport')->to('bugreport#do_report')->name('bugreport2');
2784 $r->post('/bugreportD')->to('bugreport#download_config_report')->name('bugreportD');
2785 @@ -132,14 +133,23 @@
2786 $r->get('/reboot')->to('reboot#main')->name('reboot');
2787 $r->post('/reboot')->to('reboot#do_action')->name('rebootact');
2788
2789 +$r->get('/remoteaccess')->to('remoteaccess#main')->name('remoteaccess');
2790 +$r->post('/remoteaccess')->to('remoteaccess#do_action')->name('remoteaccessact');
2791 +
2792 $r->get('/review')->to('review#main')->name('review');
2793 $r->get('/starterwebsite')->to('starterwebsite#main')->name('starterwebsite');
2794 $r->post('/starterwebsite')->to('starterwebsite#do_site')->name('starterwebsite2');
2795 $r->get('/support')->to('support#main')->name('support');
2796 $r->post('/swttheme')->to('swttheme#main')->name('swttheme');
2797
2798 +$r->get('/useraccounts')->to('useraccounts#main')->name('useraccounts');
2799 +$r->post('/useraccounts')->to('useraccounts#do_display')->name('useraccountadd');
2800 +$r->get('/useraccountd')->to('useraccounts#do_display')->name('useraccountdis');
2801 +$r->post('/useraccountd')->to('useraccounts#do_update')->name('useraccountupd');
2802 +
2803 $r->get('/viewlogfiles')->to('viewlogfiles#main')->name('viewlogfiles');
2804 $r->post('/viewlogfiles')->to('viewlogfiles#do_action')->name('viewlogfiles2');
2805 +$r->get('/viewlogfileR')->to('viewlogfiles#do_action')->name('viewlogfileR');
2806
2807 $r->get('/wbl')->to('wbl#main')->name('wbl');
2808 $r->post('/wbl')->to('wbl#do_display')->name('wbldis');
2809 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css
2810 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css 2020-02-19 22:44:47.000000000 +0400
2811 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css 2020-02-29 20:40:32.000000000 +0400
2812 @@ -52,8 +52,8 @@
2813 border-style: solid;
2814 border-color: red ;
2815 padding: 2px;
2816 - margin-left: 20px;
2817 - margin-right: 20px;
2818 + margin-left: 10px;
2819 + margin-right: 10px;
2820 margin-top:0px;
2821 margin-bottom:0px;
2822 }
2823 @@ -67,19 +67,6 @@
2824 position: fixed;
2825 margin-left: 40%;
2826 }
2827 -/*
2828 -label{
2829 - display: inline-block;
2830 - float: left;
2831 - clear: left;
2832 - width: 200px;
2833 - text-align: right;
2834 -}
2835 -data2 {
2836 - display: inline-block;
2837 - float: left;
2838 -}
2839 -*/
2840
2841 label.field-with-error {
2842 color: #dd7e5e
2843 @@ -90,38 +77,39 @@
2844 }
2845
2846 span.label {
2847 + display: inline-block;
2848 font-weight: bold;
2849 - width: 20%;
2850 + background-color: #e8f3e1; /*lightgreen;*/
2851 + width: 30%;
2852 + text-align: right;
2853 }
2854
2855 span.data {
2856 padding: 2px;
2857 font-weight: bold;
2858 margin-left: 0%;
2859 - background-color: lightblue;
2860 +/* background-color: lightblue;*/
2861 }
2862
2863 span.data2 {
2864 padding: 2px;
2865 font-weight: bold;
2866 - background-color: lightblue;
2867 +/* background-color: lightblue; */
2868 }
2869
2870 input.action {
2871 margin-left: 0px;
2872 - color: green;
2873 - background-color: lightgreen;
2874 + color: darkgreen;
2875 + background-color: #bee6a2; /*lightgreen;*/
2876 }
2877 #modul.desc {
2878 padding: 3px;
2879 background-color: grey;
2880 }
2881
2882 -/* #modul form .input */
2883 -
2884 [type = 'text'] {
2885 margin-left: 0px;
2886 - background-color: lightblue;
2887 + /*background-color: lightblue;*/
2888 }
2889
2890 .a, .return {
2891 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.development.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.development.html.ep
2892 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.development.html.ep 2020-01-22 21:59:41.000000000 +0400
2893 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.development.html.ep 2020-02-19 20:55:48.000000000 +0400
2894 @@ -1,4 +1,4 @@
2895 -% layout 'default', title => 'Sme server 2 - Error D', share_dir => '';
2896 +% layout 'defaultlight', title => 'Sme server 2 - Error D', share_dir => '';
2897
2898 % content_for 'module' => begin
2899
2900 @@ -8,7 +8,7 @@
2901 "<%= $self->req->url->path || '/' %>"
2902 could not be found.
2903 <br>dev<br>
2904 - %= link_to Initial => '/'
2905 + %= link_to Initial => '/Initial'
2906 </p>
2907 </div>
2908
2909 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.html.ep
2910 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.html.ep 2020-01-22 15:34:30.000000000 +0400
2911 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/not_found.html.ep 2020-02-19 20:56:00.000000000 +0400
2912 @@ -1,4 +1,4 @@
2913 -% layout 'default', title => 'Sme server 2 - Error P', share_dir => '';
2914 +% layout 'defaultlight', title => 'Sme server 2 - Error P', share_dir => '';
2915 <div id="central">
2916 <p><br><br>
2917 The page you were requesting
2918 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_del.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_del.html.ep
2919 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_del.html.ep 1970-01-01 04:00:00.000000000 +0400
2920 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_del.html.ep 2020-02-27 23:04:11.000000000 +0400
2921 @@ -0,0 +1,28 @@
2922 +<div id='usr_del'>
2923 +
2924 + % my $btn = l('REMOVE');
2925 +
2926 + %= form_for '/useraccountd' => (method => 'POST') => begin
2927 + <p>
2928 + <h2>
2929 + %=l 'usr_REMOVE_ACCOUNT_TITLE'
2930 + </h2>
2931 +
2932 + <br>
2933 + %= $c->l('usr_REMOVE_DESC', $usr_datas->{user}, $usr_datas->{name} );
2934 + <br>
2935 + %= $c->render_to_string(inline => $c->l('usr_REMOVE_DESC2'))
2936 + </p>
2937 +
2938 + <p>
2939 + <br>
2940 + %= submit_button "$btn", class => 'action'
2941 + </p>
2942 +
2943 + %= hidden_field 'trt' => $usr_datas->{trt}
2944 + %= hidden_field 'user' => $usr_datas->{user}
2945 + %= hidden_field 'name' => $usr_datas->{name}
2946 +
2947 + % end
2948 +
2949 +</div>
2950 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_list.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_list.html.ep
2951 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_list.html.ep 1970-01-01 04:00:00.000000000 +0400
2952 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_list.html.ep 2020-02-29 19:22:59.000000000 +0400
2953 @@ -0,0 +1,92 @@
2954 +<div id='usr_list'>
2955 +
2956 +
2957 + % my $btn = l('usr_ADD_USER');
2958 +
2959 + %= form_for '/useraccounts' => (method => 'POST') => begin
2960 +
2961 + <p>
2962 + <br>
2963 + %= submit_button "$btn", class => 'action'
2964 + </p>
2965 +
2966 + % end
2967 +
2968 + <p>
2969 + %= $c->render_to_string(inline => $c->l('usr_FIRSTPAGE_DESC'))
2970 + <br>
2971 + </p>
2972 +
2973 + % my $numUsers = @$users;
2974 + % if ($numUsers == 0){
2975 + %=l 'usr_NO_USER_ACCOUNTS'
2976 + % } else {
2977 + <table class="sme-border"><tbody>
2978 + <tr>
2979 + <th class='sme-border'>
2980 + %=l 'ACCOUNT'
2981 + </th>
2982 + <th class='sme-border'>
2983 + %=l 'USER_NAME'
2984 + </th>
2985 + <th class='sme-border'>
2986 + %=l 'usr_VPN_CLIENT_ACCESS'
2987 + </th>
2988 + <th class='sme-border'>
2989 + %=l 'usr_FORWARDING_ADDRESS'
2990 + </th>
2991 + <th class='sme-border' colspan='4'>
2992 + %=l 'ACTION'
2993 + </th>
2994 + </tr>
2995 +
2996 + % foreach my $user (sort @$users) {
2997 +
2998 + % my $username = $user->key();
2999 + % my $first = $user->prop('FirstName');
3000 + % my $last = $user->prop('LastName');
3001 + % my $lockable = $user->prop('Lockable') || 'yes';
3002 + % my $removable = $user->prop('Removable') || 'yes';
3003 + % my $fwd = (($user->prop('EmailForward') || 'local') =~ m/^forward|both$/) ?
3004 + % $user->prop('ForwardAddress') : '';
3005 + % my $vpnaccess = $user->prop('VPNClientAccess') || 'no';
3006 + % $vpnaccess = $vpnaccess eq 'yes' ? $c->l('YES') : $c->l('NO');
3007 + % my $password_set = $user->prop('PasswordSet');
3008 +
3009 + <tr>
3010 + %= t td => (class => 'sme-border') => $username
3011 + %= t td => (class => 'sme-border') => "$first $last"
3012 + %= t td => (class => 'sme-border') => $vpnaccess
3013 + %= t td => (class => 'sme-border') => $fwd
3014 + % my ($actionModify, $actionLock, $actionResetPw, $actionRemove) = '&nbsp;';
3015 + % if ($username eq 'admin') {
3016 + % $actionModify = "<a href='useraccountd?trt=UPS&user=" . $username . "'>" . l('MODIFY') . "</a>";
3017 + % $actionResetPw = "<a href='useraccountd?trt=PWS&user=" . $username . "'>" . l('PASSWORD_RESET') . "</a>";
3018 + % } else {
3019 + % $actionModify = "<a href='useraccountd?trt=UPD&user=" . $username . "'>" . l('MODIFY') . "</a>";
3020 + % if ($password_set ne 'yes') {
3021 + % $actionLock = l('ACCOUNT_LOCKED');
3022 + % $actionResetPw = "<a href='useraccountd?trt=PWD&user=" . $username . "' class='error'>" . l('PASSWORD_RESET') . "</a>";
3023 + % } else {
3024 + % $actionLock = "<a href='useraccountd?trt=LCK&user=" . $username . "'>" . l('usr_LOCK_ACCOUNT') . "</a>";
3025 + % $actionResetPw = "<a href='useraccountd?trt=PWD&user=" . $username . "'>" . l('PASSWORD_RESET') . "</a>";
3026 + % }
3027 + % if ( $removable eq 'yes' ) {
3028 + % $actionRemove = "<a href='useraccountd?trt=DEL&user=" . $username . "'>" . l('REMOVE') . "</a>";
3029 + % }
3030 + % }
3031 + <td class='sme-border'><%= $c->render_to_string(inline => $actionModify) %></td>
3032 + <td class='sme-border'><%= $c->render_to_string(inline => $actionResetPw) %></td>
3033 + <td class='sme-border'><%= $c->render_to_string(inline => $actionLock) %></td>
3034 + <td class='sme-border'><%= $c->render_to_string(inline => $actionRemove) %></td>
3035 +
3036 + </tr>
3037 + % }
3038 + </tbody>
3039 + </table>
3040 +
3041 + <%} %>
3042 +
3043 + %= hidden_field 'trt' => $usr_datas->{trt}
3044 +
3045 +</div>
3046 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_lock.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_lock.html.ep
3047 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_lock.html.ep 1970-01-01 04:00:00.000000000 +0400
3048 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_lock.html.ep 2020-02-27 23:03:55.000000000 +0400
3049 @@ -0,0 +1,28 @@
3050 +<div id='usr_lock'>
3051 +
3052 + % my $btn = l('usr_LOCK');
3053 +
3054 + %= form_for '/useraccountd' => (method => 'POST') => begin
3055 + <p>
3056 + <h2>
3057 + %=l 'usr_LOCK_ACCOUNT_TITLE'
3058 + </h2>
3059 +
3060 + <br>
3061 + %= $c->l('usr_LOCK_DESC', $usr_datas->{user}, $usr_datas->{name} );
3062 + <br>
3063 + %= $c->render_to_string(inline => $c->l('usr_LOCK_DESC2'))
3064 + </p>
3065 +
3066 + <p>
3067 + <br>
3068 + %= submit_button "$btn", class => 'action'
3069 + </p>
3070 +
3071 + %= hidden_field 'trt' => $usr_datas->{trt}
3072 + %= hidden_field 'user' => $usr_datas->{user}
3073 + %= hidden_field 'name' => $usr_datas->{name}
3074 +
3075 + % end
3076 +
3077 +</div>
3078 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwd.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwd.html.ep
3079 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwd.html.ep 1970-01-01 04:00:00.000000000 +0400
3080 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwd.html.ep 2020-02-26 22:49:00.000000000 +0400
3081 @@ -0,0 +1,44 @@
3082 +<div id='usr_pwd'>
3083 +
3084 + % my $btn = l('SAVE');
3085 +
3086 + %= form_for '/useraccountd' => (method => 'POST') => begin
3087 + <p>
3088 + <h2>
3089 + %=l 'RESET_PASSWORD_TITLE'
3090 + </h2>
3091 +
3092 + <br>
3093 + %= $c->l('usr_RESET_DESC', $usr_datas->{user}, $usr_datas->{name} );
3094 + <br>
3095 + %= l 'usr_RESET_DESC2'
3096 + </p>
3097 +
3098 + <p>
3099 + <span class=label>
3100 + %=l 'PASSWORD_NEW', class => 'label'
3101 + </span><span class=data>
3102 + %= password_field 'newPass', class => 'input'
3103 + </span>
3104 + </p>
3105 +
3106 + <p>
3107 + <span class=label>
3108 + %=l 'PASSWORD_VERIFY_NEW', class => 'label'
3109 + </span><span class=data>
3110 + %= password_field 'newPassVerify', class => 'input'
3111 + </span>
3112 + </p>
3113 +
3114 + <p>
3115 + <br><br>
3116 + %= submit_button "$btn", class => 'action'
3117 + </p>
3118 +
3119 + %= hidden_field 'trt' => $usr_datas->{trt}
3120 + %= hidden_field 'user' => $usr_datas->{user}
3121 + %= hidden_field 'name' => $usr_datas->{name}
3122 +
3123 + % end
3124 +
3125 +</div>
3126 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwds.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwds.html.ep
3127 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwds.html.ep 1970-01-01 04:00:00.000000000 +0400
3128 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_pwds.html.ep 2020-02-29 18:18:12.000000000 +0400
3129 @@ -0,0 +1,62 @@
3130 +<div id='usr_pwds'>
3131 +
3132 + % my $btn = l('SAVE');
3133 +
3134 + %= form_for '/useraccountd' => (method => 'POST') => begin
3135 + <p>
3136 + %= l 'usr_SYSTEM_PASSWORD_DESCRIPTION'
3137 + </p>
3138 +
3139 + <p>
3140 + <span class=label>
3141 + %=l 'usr_CURRENT_SYSTEM_PASSWORD', class => 'label'
3142 + </span><span class=data>
3143 + %= password_field 'CurPass', class => 'input'
3144 + </span>
3145 + </p>
3146 +
3147 + <p>
3148 + <span class=label>
3149 + %=l 'usr_NEW_SYSTEM_PASSWORD', class => 'label'
3150 + </span><span class=data>
3151 + %= password_field 'Pass', class => 'input'
3152 + </span>
3153 + </p>
3154 +
3155 + <p>
3156 + <span class=label>
3157 + %=l 'usr_NEW_SYSTEM_PASSWORD_VERIFY', class => 'label'
3158 + </span><span class=data>
3159 + %= password_field 'PassVerify', class => 'input'
3160 + </span>
3161 + </p>
3162 +
3163 + <p>
3164 + <br><br>
3165 + %= submit_button "$btn", class => 'action'
3166 + </p>
3167 +
3168 + %= hidden_field 'trt' => $usr_datas->{trt}
3169 + %= hidden_field 'user' => $usr_datas->{user}
3170 + %= hidden_field 'name' => $usr_datas->{name}
3171 +
3172 + % end
3173 +
3174 +</div>
3175 +<!--
3176 + <page name="SystemPassword" pre-event="turn_off_buttons()"
3177 + post-event="system_change_password" >
3178 + <description>SYSTEM_PASSWORD_DESCRIPTION</description>
3179 +
3180 + <field type="password" id="curpass" validation="nonblank, system_authenticate_password">
3181 + <label>CURRENT_SYSTEM_PASSWORD</label>
3182 + </field>
3183 + <field type="password" id="pass" validation="nonblank, system_check_password">
3184 + <label>NEW_SYSTEM_PASSWORD</label>
3185 + </field>
3186 + <field type="password" id="passVerify" validation="system_password_compare">
3187 + <label>NEW_SYSTEM_PASSWORD_VERIFY</label>
3188 + </field>
3189 + <subroutine src="print_button('SAVE')" />
3190 + </page>
3191 +-->
3192 \ Pas de fin de ligne à la fin du fichier
3193 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upd.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upd.html.ep
3194 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upd.html.ep 1970-01-01 04:00:00.000000000 +0400
3195 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upd.html.ep 2020-02-29 19:46:22.000000000 +0400
3196 @@ -0,0 +1,183 @@
3197 +<div id='usr_upd'>
3198 +
3199 +
3200 + % my $btn = l('ADD');
3201 +
3202 + %= form_for '/useraccountd' => (method => 'POST') => begin
3203 + <p>
3204 + <h2>
3205 + %=l 'usr_P2_TITLE'
3206 + </h2>
3207 + <br>
3208 + %= $c->render_to_string(inline => l ('usr_CREATE_MODIFY_DESC'))
3209 + </p>
3210 +
3211 + <p>
3212 + <span class=label>
3213 + %=l 'usr_ACCOUNT_NAME'
3214 + </span><span class=data>
3215 + % if ( $usr_datas->{trt} eq 'ADD' ) {
3216 + % param 'user' => $usr_datas->{user} unless param 'user';
3217 + %= text_field 'user', class => 'input'
3218 + % } else {
3219 + % $btn = l('SAVE');
3220 + %= $usr_datas->{user}, class => 'data'
3221 + % }
3222 + </span>
3223 + </p>
3224 +
3225 + <p>
3226 + <span class=label>
3227 + %=l 'usr_FIRSTNAME'
3228 + </span><span class=data>
3229 + % param 'FirstName' => $usr_datas->{firstname} unless param 'FirstName';
3230 + %= text_field 'FirstName', class => 'input'
3231 + </span>
3232 + </p>
3233 + <p>
3234 + <span class=label>
3235 + %=l 'usr_LASTNAME'
3236 + </span><span class=data>
3237 + % param 'LastName' => $usr_datas->{lastname} unless param 'LastName';
3238 + %= text_field 'LastName', class => 'input'
3239 + </span>
3240 + </p>
3241 +
3242 + <p>
3243 + <span class=label>
3244 + %=l 'usr_DEPARTMENT'
3245 + </span><span class=data>
3246 + % param 'Dept' => $usr_datas->{dept} unless param 'Dept';
3247 + %= text_field 'Dept', class => 'input'
3248 + </span>
3249 + </p>
3250 + <p>
3251 + <span class=label>
3252 + %=l 'usr_COMPANY'
3253 + </span><span class=data>
3254 + % param 'Company' => $usr_datas->{company} unless param 'Company';
3255 + %= text_field 'Company', class => 'input'
3256 + </span>
3257 + </p>
3258 + <p>
3259 + <span class=label>
3260 + %=l 'usr_STREET_ADDRESS'
3261 + </span><span class=data>
3262 + % param 'Street' => $usr_datas->{street} unless param 'Street';
3263 + %= text_field 'Street', class => 'input'
3264 + </span>
3265 + </p>
3266 + <p>
3267 + <span class=label>
3268 + %=l 'usr_CITY'
3269 + </span><span class=data>
3270 + % param 'City' => $usr_datas->{city} unless param 'City';
3271 + %= text_field 'City', class => 'input'
3272 + </span>
3273 + </p>
3274 + <p>
3275 + <span class=label>
3276 + %=l 'usr_PHONE_NUMBER'
3277 + </span><span class=data>
3278 + % param 'Phone' => $usr_datas->{phone} unless param 'Phone';
3279 + %= text_field 'Phone', class => 'input'
3280 + </span>
3281 + </p>
3282 + <p>
3283 + <span class=label>
3284 + %=l 'usr_EMAIL_DELIVERY'
3285 + </span><span class=data>
3286 + % param 'EmailForward' => $usr_datas->{emailforward} unless param 'EmailForward';
3287 + %= select_field 'EmailForward' => $c->emailForward_list(), class => 'input'
3288 + </span>
3289 + </p>
3290 + <p>
3291 + <span class=label>
3292 + %=l 'usr_FORWARDING_ADDRESS'
3293 + </span><span class=data>
3294 + % param 'ForwardAddress' => $usr_datas->{forwardaddress} unless param 'ForwardAddress';
3295 + %= text_field 'ForwardAddress', class => 'input'
3296 + </span>
3297 + </p>
3298 +
3299 + <p>
3300 + <span class=label>
3301 + %=l 'usr_VPN_CLIENT_ACCESS'
3302 + </span><span class=data>
3303 + % param 'VPNClientAccess' => $usr_datas->{vpnclientaccess} unless param 'VPNClientAccess';
3304 + %= select_field 'VPNClientAccess' => [[ (l 'NO') => 'no'], [ (l 'YES') => 'yes']], class => 'input'
3305 + </span>
3306 + </p>
3307 +
3308 + % if ( $usr_datas->{trt} eq 'UPD' and $c->ipsec_for_acct eq 'OK' ) {
3309 + % my $url = '/useraccountd?TRT=CRT&user=' . $usr_datas->{user};
3310 + % my $btn2 = $c->l('DOWNLOAD');
3311 + %= form_for $url => (method => 'GET') => begin
3312 + <p>
3313 + <span class=label>
3314 + %=l 'usr_LABEL_IPSECRW_DOWNLOAD'
3315 + </span><span class=data>
3316 + %= submit_button $btn2, class => 'action'
3317 + </span>
3318 + </p>
3319 + %end
3320 + % }
3321 +
3322 + % my @groups = @{$c->get_groups()};
3323 + % if ( @groups ) {
3324 + <p>
3325 + <span class=label>
3326 + %=l 'usr_GROUP_MEMBERSHIPS'
3327 + </span>
3328 + <span class=data>
3329 + <table class="sme-border"><tbody>
3330 + <tr><th class='sme-border'>
3331 + %=l 'usr_MEMBER'
3332 + </th><th class='sme-border'>
3333 + %=l 'GROUP'
3334 + </th><th class='sme-border'>
3335 + %=l 'DESCRIPTION'
3336 + </th></tr>
3337 +
3338 + % foreach my $g ( @groups) {
3339 + % my $user = $usr_datas->{user};
3340 + % my $groupname = $g->key();
3341 + % my $description = $g->prop('Description');
3342 + % my $checked = '';
3343 + % if ( $user and $c->is_user_in_group($user, $groupname) ) {
3344 + % $checked = 'checked';
3345 + % }
3346 + <tr>
3347 +
3348 + <td>
3349 + % if ( $checked eq 'checked' ) {
3350 + <!-- % = check_box 'groupMemberships', value => $groupname, checked => $checked -->
3351 + <input type='checkbox' name='groupMemberships' checked value='<%= $groupname %>'>
3352 + %} else {
3353 + %= check_box 'groupMemberships' => $groupname
3354 + %}
3355 + </td>
3356 + <!-- t td => (class => 'sme-border') => (check_box ' groupMemberships' => $groupname $checked) -->
3357 + %= t td => (class => 'sme-border') => $groupname
3358 + %= t td => (class => 'sme-border') => "$description"
3359 + </tr>
3360 + % }
3361 + </tbody>
3362 + </table>
3363 + </span>
3364 + </p>
3365 + % }
3366 +
3367 + <p>
3368 + <br><br>
3369 + %= submit_button $btn, class => 'action'
3370 + </p>
3371 +
3372 + %= hidden_field 'trt' => $usr_datas->{trt}
3373 + % if ( $usr_datas->{trt} eq 'UPD' ) {
3374 + %= hidden_field 'user' => $usr_datas->{user}
3375 + % }
3376 +
3377 + % end
3378 +
3379 +</div>
3380 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upds.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upds.html.ep
3381 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upds.html.ep 1970-01-01 04:00:00.000000000 +0400
3382 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_usr_upds.html.ep 2020-02-29 18:21:10.000000000 +0400
3383 @@ -0,0 +1,118 @@
3384 +<div id='usr_upds'>
3385 +
3386 + % my $btn = l('SAVE');
3387 +
3388 + %= form_for '/useraccountd' => (method => 'POST') => begin
3389 + <p>
3390 + <h2>
3391 + %=l 'usr_MODIFY_ADMIN_TITLE'
3392 + </h2><br>
3393 + </p>
3394 +
3395 + <p>
3396 + <span class=label>
3397 + %=l 'usr_ACCOUNT_NAME'
3398 + </span><span class=data>
3399 + % $btn = l('SAVE');
3400 + %= $usr_datas->{user}, class => 'data'
3401 + </span>
3402 + </p>
3403 +
3404 + <p>
3405 + <span class=label>
3406 + %=l 'usr_FIRSTNAME'
3407 + </span><span class=data>
3408 + % param 'FirstName' => $usr_datas->{firstname} unless param 'FirstName';
3409 + %= text_field 'FirstName', class => 'input'
3410 + </span>
3411 + </p>
3412 + <p>
3413 + <span class=label>
3414 + %=l 'usr_LASTNAME'
3415 + </span><span class=data>
3416 + % param 'LastName' => $usr_datas->{lastname} unless param 'LastName';
3417 + %= text_field 'LastName', class => 'input'
3418 + </span>
3419 + </p>
3420 +
3421 + <p>
3422 + <span class=label>
3423 + %=l 'usr_EMAIL_DELIVERY'
3424 + </span><span class=data>
3425 + % param 'EmailForward' => $usr_datas->{emailforward} unless param 'EmailForward';
3426 + %= select_field 'EmailForward' => $c->emailForward_list(), class => 'input'
3427 + </span>
3428 + </p>
3429 + <p>
3430 + <span class=label>
3431 + %=l 'usr_FORWARDING_ADDRESS'
3432 + </span><span class=data>
3433 + % param 'ForwardAddress' => $usr_datas->{forwardaddress} unless param 'ForwardAddress';
3434 + %= text_field 'ForwardAddress', class => 'input'
3435 + </span>
3436 + </p>
3437 +
3438 + <p>
3439 + <span class=label>
3440 + %=l 'usr_VPN_CLIENT_ACCESS'
3441 + </span><span class=data>
3442 + % param 'VPNClientAccess' => $usr_datas->{vpnclientaccess} unless param 'VPNClientAccess';
3443 + %= select_field 'VPNClientAccess' => [[ (l 'NO') => 'no'], [ (l 'YES') => 'yes']], class => 'input'
3444 + </span>
3445 + </p>
3446 +
3447 + % if ( $c->ipsec_for_acct eq 'OK' ) {
3448 + % my $url = '/useraccountd?TRT=CRT&user=' . $usr_datas->{user};
3449 + % my $btn2 = $c->l('DOWNLOAD');
3450 + %= form_for $url => (method => 'GET') => begin
3451 + <p>
3452 + <span class=label>
3453 + %=l 'usr_LABEL_IPSECRW_DOWNLOAD'
3454 + </span><span class=data>
3455 + %= submit_button $btn2, class => 'action'
3456 + </span>
3457 + </p>
3458 + %end
3459 + % }
3460 +
3461 + <p>
3462 + <br>
3463 + %= submit_button $btn, class => 'action'
3464 + </p>
3465 +
3466 + %= hidden_field 'trt' => $usr_datas->{trt}
3467 + %= hidden_field 'user' => $usr_datas->{user}
3468 +
3469 + % end
3470 +
3471 +</div>
3472 +<!--
3473 + <page name="ModifyAdmin" pre-event="turn_off_buttons()" post-event="modify_admin()">
3474 + <title>MODIFY_ADMIN_TITLE</title>
3475 + <subroutine src="print_acctName_field()" />
3476 + <field type="text" id="FirstName" validation="nonblank, pseudonym_clash">
3477 + <label>FIRSTNAME</label>
3478 + </field>
3479 + <field type="text" id="LastName" validation="nonblank">
3480 + <label>LASTNAME</label>
3481 + </field>
3482 + <field type="select" id="EmailForward" options="'local' =>
3483 + 'DELIVER_EMAIL_LOCALLY', 'forward' => 'FORWARD_EMAIL',
3484 + 'both' => 'DELIVER_AND_FORWARD'" validation="nonblank" value='local'
3485 + display="display_email_forwarding()"
3486 + >
3487 + <label>EMAIL_DELIVERY</label>
3488 + </field>
3489 + <field type="text" id="ForwardAddress" validation="emailforward()"
3490 + display="display_email_forwarding()"
3491 + >
3492 + <label>FORWARDING_ADDRESS</label>
3493 + </field>
3494 + <field type="select" id="VPNClientAccess" options="'yes' => 'YES',
3495 + 'no' => 'NO'" validation="nonblank" value="get_pptp_value()">
3496 + <label>VPN_CLIENT_ACCESS</label>
3497 + </field>
3498 + <subroutine src="print_ipsec_client_section()" />
3499 + <subroutine src="print_button('SAVE')" />
3500 + </page>
3501 +-->
3502 \ Pas de fin de ligne à la fin du fichier
3503 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/remoteaccess.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/remoteaccess.html.ep
3504 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/remoteaccess.html.ep 1970-01-01 04:00:00.000000000 +0400
3505 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/remoteaccess.html.ep 2020-02-26 17:38:24.000000000 +0400
3506 @@ -0,0 +1,234 @@
3507 +% layout 'default', title => "Sme server 2 - remoteaccess", share_dir => './';
3508 +
3509 +% content_for 'module' => begin
3510 +<div id="module">
3511 +
3512 + % if ($config->{debug} == 1) {
3513 + <p>
3514 + %= dumper $c->current_route
3515 + %= dumper $rma_datas
3516 + </p>
3517 + % }
3518 + <h1><%= $title%></h1>
3519 + % if ( $notif ) {
3520 + <br>
3521 + <span class=sme-error>
3522 + <%= $c->render_to_string(inline => $notif) %>
3523 + </span>
3524 + %}
3525 +
3526 + <hr class='sectionbar' />
3527 +
3528 + <% my $btn = l('SAVE'); %>
3529 +
3530 + %= form_for 'remoteaccess' => (method => 'POST') => begin
3531 +
3532 + % my $ipsec = $c->get_ipsecrw_status();
3533 + % if ( $ipsec ) {
3534 + <p>
3535 + <h2>
3536 + %=l 'rma_TITLE_IPSECRW'
3537 + </h2><br>
3538 +
3539 + %=l 'rma_DESC_IPSECRW'
3540 + <br>
3541 +
3542 + <span class=label>
3543 + %=l 'rma_LABEL_IPSECRW_SESS'
3544 + </span><span class=data>
3545 + % param 'IpsecrwSess' => $c->get_ipsecrw_sessions unless param 'IpsecrwSess';
3546 + %= text_field 'IpsecrwSess', class => 'input'
3547 + </span>
3548 + <br>
3549 +
3550 + %= $c->render_to_string(inline => $c->l('rma_DESC_IPSECRW_RESET'));
3551 + <br>
3552 + <span class=label>
3553 + %=l 'rma_LABEL_IPSECRW_RESET'
3554 + </span><span class=data>
3555 + %= check_box 'IpsecrwReset',class => 'input'
3556 + </span>
3557 + <br><br>
3558 +
3559 + <hr class='sectionbar' />
3560 +
3561 + </p>
3562 + %}
3563 +
3564 + <p><h2>
3565 + %=l 'rma_TITLE_PPTP'
3566 + </h2><br>
3567 + %=l 'rma_DESC_PPTP'
3568 + <br>
3569 + <span class=label>
3570 + %=l 'rma_LABEL_PPTP'
3571 + </span><span class=data>
3572 + % param 'PptpSessions' => $c->get_pptp_sessions unless param 'PptpSessions';
3573 + %= text_field 'PptpSessions' => $c->get_pptp_sessions(), class => 'input'
3574 + </span>
3575 + </p>
3576 +
3577 + <hr class='sectionbar' />
3578 +
3579 + <p><h2>
3580 + %= $c->l('rma_VALIDFROM_TITLE', $c->l('rma_REMOTE_MANAGEMENT'));
3581 + </h2><br>
3582 + %=l 'rma_VALIDFROM_DESC'
3583 + <br><br>
3584 +
3585 + % my @vals = $self->_get_valid_from();
3586 + % if (@vals) {
3587 + <table class="sme-border"><tbody>
3588 + <tr><th class='sme-border'>
3589 + %=l 'NETWORK'
3590 + </th><th class='sme-border'>
3591 + %=l 'SUBNET_MASK'
3592 + </th><th class='sme-border'>
3593 + %=l 'NUM_OF_HOSTS'
3594 + </th><th class='sme-border'>
3595 + %=l 'REMOVE'
3596 + </th></tr>
3597 +
3598 + % foreach my $val ( @vals )
3599 + % {
3600 + % my ($net, $mask) = split '/', $val;
3601 + % $mask = '255.255.255.255' unless ($mask);
3602 + % my ($numhosts,$a,$b) = esmith::util::computeHostRange($net,$mask);
3603 + <tr>
3604 + %= t td => (class => 'sme-border') => $net
3605 + %= t td => (class => 'sme-border') => $mask
3606 + %= t td => (class => 'sme-border') => $numhosts
3607 + <td class='sme-border'><input type='checkbox' name='Remove_nets' value='<%= $net.'/'.$mask %>'> </td>
3608 + </tr>
3609 + % }
3610 +
3611 + </tbody>
3612 + </table>
3613 +
3614 + <!-- my @cbGroup = $q->checkbox_group(-name => 'validFromRemove',
3615 + -values => [@vals], -labels => { map {$_ => ''} @vals });
3616 + foreach my $val (@vals)
3617 + { esmith::cgi::genSmallCell($q, shift(@cbGroup), } -->
3618 + % } else {
3619 + <br><b>
3620 + %= l('rma_NO_ENTRIES_YET');
3621 + </b>
3622 + %}
3623 + </p>
3624 +
3625 + <p>
3626 + %=l 'rma_DESC_VALID_FROM_ENTRIES'
3627 + <br><br>
3628 + <span class=label>
3629 + %=l 'NETWORK'
3630 + </span><span class=data>
3631 + %= text_field 'ValidFromNetwork', class => 'input'
3632 + </span>
3633 + <br>
3634 + <span class=label>
3635 + %=l 'rma_SUBNET_MASK'
3636 + </span><span class=data>
3637 + %= text_field 'ValidFromMask', class => 'input'
3638 + </span>
3639 + </p>
3640 +
3641 + <hr class='sectionbar' />
3642 +
3643 + <p><h2>
3644 + %=l 'rma_TITLE_SSH'
3645 + </h2><br>
3646 + %=l 'rma_DESC_SSH'
3647 + <br><br>
3648 + <span class=label>
3649 + %=l 'rma_LABEL_SSH'
3650 + </span><span class=data>
3651 + % param 'SshAccess' => $c->get_ssh_access() unless param 'SshAccess';
3652 + %= select_field 'SshAccess' => $c->networkAccess_list(), class => 'input'
3653 + </span>
3654 + <br>
3655 +
3656 + <span class=label>
3657 + %=l 'rma_LABEL_SSH_ADMIN'
3658 + </span><span class=data>
3659 + % param 'SshPermitRootLogin' => $rma_datas->{sshPermitRootLogin} unless param 'SshPermitRootLogin';
3660 + %= select_field 'SshPermitRootLogin' => [[(l 'NO'), 'no'], [(l 'YES'), 'yes']], class => 'input'
3661 + </span>
3662 + <br>
3663 +
3664 + <span class=label>
3665 + %=l 'rma_LABEL_SSH_PASSWORD_ACCESS'
3666 + </span><span class=data>
3667 + % param 'SshPasswordAuthentication' => $c->get_ssh_password_auth() unless param 'SshPasswordAuthentication';
3668 + %= select_field 'SshPasswordAuthentication' => [[(l 'NO'), 'no'], [(l 'YES'), 'yes']], class => 'input'
3669 + </span>
3670 + <br>
3671 +
3672 + <span class=label>
3673 + %=l 'rma_LABEL_SSH_PORT'
3674 + </span><span class=data>
3675 + % param 'SshTCPPort' => $c->get_ssh_port() unless param 'SshTCPPort';
3676 + %= text_field 'SshTCPPort', class => 'input'
3677 + </span>
3678 + <br>
3679 + </p>
3680 +
3681 + <hr class='sectionbar' />
3682 +
3683 + <p><h2>
3684 + %=l 'rma_TITLE_FTP_ACCESS'
3685 + </h2><br>
3686 + %= $c->render_to_string(inline => $c->l('rma_DESC_FTP_ACCESS'));
3687 +
3688 + <br>
3689 + <span class=label>
3690 + %=l 'rma_LABEL_FTP_ACCESS'
3691 + </span><span class=data>
3692 + % param 'FtpAccess' => $c->get_ftp_access() unless param 'FtpAccess';
3693 + %= select_field 'FtpAccess' => $c->networkAccess_list(), class => 'input'
3694 + </span>
3695 + <br>
3696 +
3697 + <br>
3698 + %= $c->render_to_string(inline => $c->l('rma_DESC_FTP_LOGIN'));
3699 + <br>
3700 + <span class=label>
3701 + %=l 'rma_LABEL_FTP_LOGIN'
3702 + </span><span class=data>
3703 + % param 'FtpPasswordAccess' => $c->get_ftp_password_login_access() unless param 'FtpPasswordAccess';
3704 + %= select_field 'FtpPasswordAccess' => $c->passwordLogin_list(), class => 'input'
3705 + </span>
3706 + <br>
3707 + </p>
3708 +
3709 + % my $mode = $c->get_telnet_mode();
3710 + % if ( $mode ne 'off') {
3711 + <p>
3712 + <hr class='sectionbar' />
3713 +
3714 + <h2>
3715 + %=l 'rma_TITLE_TELNET_ACCESS'
3716 + </h2><br>
3717 +
3718 + <span class=sme-error>
3719 + %=l 'rma_DESC_TELNET_ACCESS'
3720 + </span>
3721 + <br><br>
3722 +
3723 + <span class=label>
3724 + %=l 'rma_LABEL_TELNET_ACCESS'
3725 + </span><span class=data>
3726 + % param 'TelnetAccess' => $mode unless param 'TelnetAccess';
3727 + %= select_field 'TelnetAccess' => $c->networkAccess_list(), class => 'input'
3728 + </span>
3729 + <br>
3730 +
3731 + </p>
3732 + %}
3733 +
3734 + %= submit_button "$btn", class => 'action'
3735 +
3736 + % end
3737 +
3738 +</div>
3739 +
3740 +% end
3741 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/useraccounts.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/useraccounts.html.ep
3742 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/useraccounts.html.ep 1970-01-01 04:00:00.000000000 +0400
3743 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/useraccounts.html.ep 2020-02-29 01:47:50.000000000 +0400
3744 @@ -0,0 +1,40 @@
3745 +% layout 'default', title => "Sme server 2 - useraccounts", share_dir => './';
3746 +
3747 +% content_for 'module' => begin
3748 +<div id="module">
3749 +
3750 + % if ($config->{debug} == 1) {
3751 + <p>
3752 + %= dumper $c->current_route
3753 + %= dumper $usr_datas
3754 + </p>
3755 + % }
3756 +
3757 + <h1><%= $title%></h1>
3758 +
3759 + % if ( $notif ) {
3760 + <br>
3761 + <span class=sme-error>
3762 + <%= $c->render_to_string(inline => $notif) %>
3763 + </span>
3764 + %}
3765 +
3766 + % if ($usr_datas->{trt} eq 'ADD' or $usr_datas->{trt} eq 'UPD') {
3767 + %= include 'partials/_usr_upd'
3768 + %} elsif ($usr_datas->{trt} eq 'DEL') {
3769 + %= include 'partials/_usr_del'
3770 + %} elsif ($usr_datas->{trt} eq 'LCK') {
3771 + %= include 'partials/_usr_lock'
3772 + %} elsif ($usr_datas->{trt} eq 'PWD') {
3773 + %= include 'partials/_usr_pwd'
3774 + %} elsif ($usr_datas->{trt} eq 'PWS') {
3775 + %= include 'partials/_usr_pwds'
3776 + %} elsif ($usr_datas->{trt} eq 'UPS') {
3777 + %= include 'partials/_usr_upds'
3778 + %} else {
3779 + %= include 'partials/_usr_list'
3780 + %}
3781 +
3782 +</div>
3783 +%end
3784 +
3785 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles2.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles2.html.ep
3786 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles2.html.ep 1970-01-01 04:00:00.000000000 +0400
3787 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles2.html.ep 2020-02-21 23:39:07.000000000 +0400
3788 @@ -0,0 +1,32 @@
3789 +% layout 'default', title => 'Sme server 2 - View log files 2';
3790 +
3791 +% content_for 'module' => begin
3792 +
3793 +<div id="module">
3794 +
3795 + % if ($config->{debug} == 1) {
3796 + <p>
3797 + (DBG)route: <%= $c->current_route %><br>
3798 + (DBG)trt: <%= $log_datas->{trt} %><br>
3799 + </p>
3800 + % }
3801 +
3802 + <h1><%= $title %></h1>
3803 +
3804 + <br><%= $modul %><br>
3805 +
3806 + <p>
3807 + <% my $btn = l('log_REFRESH'); %>
3808 +
3809 + %= form_for 'viewlogfileR' => (method => 'GET') => begin
3810 + %= submit_button "$btn", class => 'action'
3811 + %= hidden_field 'trt' => $log_datas->{trt}
3812 + %= hidden_field 'Filename' => $log_datas->{filename}
3813 + %= hidden_field 'Matchpattern' => $log_datas->{matchpattern}
3814 + %= hidden_field 'Highlightpattern' => $log_datas->{highlightpattern}
3815 + %= hidden_field 'Operation' => $log_datas->{operation}
3816 + % end
3817 +
3818 +</div>
3819 +
3820 +%end
3821 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles.html.ep
3822 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles.html.ep 1970-01-01 04:00:00.000000000 +0400
3823 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/viewlogfiles.html.ep 2020-02-16 00:31:47.000000000 +0400
3824 @@ -0,0 +1,68 @@
3825 +% layout 'default', title => "Sme server 2 - viewlogfiles", share_dir => './';
3826 +
3827 +% content_for 'module' => begin
3828 +<div id="module">
3829 + %if ($config->{debug} == 1) {
3830 + <p>
3831 + (DBG)route: <%= $c->current_route %><br>
3832 + </p>
3833 + %}
3834 + <h1><%= $title %></h1>
3835 + <br>
3836 + <%= $notif %>
3837 + <% my $btn = l('NEXT'); %>
3838 +
3839 + %= form_for 'viewlogfiles' => (method => 'POST') => begin
3840 + <p>
3841 + %=l 'log_FIRSTPAGE_DESC'
3842 + <br>
3843 + <span class=label>
3844 + %=l 'log_LOG_FILE_SELECT_DESC'
3845 + </span><span class=data>
3846 + % param 'Filename' => 'messages';
3847 + <!-- select_field 'Filename' => [['toto'], ['tata']], class => 'input' -->
3848 + %= select_field 'Filename' => $c->findlogFiles(), class => 'input'
3849 + </span>
3850 + </p>
3851 +
3852 + <p>
3853 + %=l 'log_FILTER_PATTERN_DESC'
3854 + <br>
3855 + <span class=label>
3856 + %=l 'log_FILTER_PATTERN_LABEL'
3857 + </span><span class=data>
3858 + %= text_field 'Matchpattern', class => 'input'
3859 + </span>
3860 + </p>
3861 +
3862 + <p>
3863 + %=l 'log_MATCH_PATTERN_DESC'
3864 + <br>
3865 + <span class=label>
3866 + %=l 'log_MATCH_PATTERN_LABEL'
3867 + </span><span class=data>
3868 + %= text_field 'Highlightpattern', class => 'input'
3869 + </span>
3870 + </p>
3871 +
3872 + <p>
3873 + %=l 'log_OP_DESC'
3874 + <br>
3875 + <span class=label>
3876 + %=l 'log_OP_LABEL'
3877 + </span><span class=data>
3878 + %if ($log_datas->{'default_op'} eq 'download') {
3879 + % param 'Operation' => 'download';
3880 + %}
3881 + %= select_field 'Operation' => [[(l 'log_VIEW') => 'view'],[(l 'DOWNLOAD') => 'download']], class => 'input'
3882 + </span>
3883 + </p>
3884 +
3885 + <p>
3886 + %=l 'log_END_DESC'
3887 + </p>
3888 +
3889 + %= submit_button "$btn", class => 'action'
3890 + % end
3891 +</div>
3892 +%end

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed