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

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

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


Revision 1.1 - (show annotations) (download)
Wed Feb 19 20:05:06 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-10_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
* Wed Feb 19 2020 Michel Begue <mab974@gmail.com> 0.1.0-10.sme
- add panels : domains, hostentries and pseudonyms
- remove old navigation menu

1 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm
2 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm 1970-01-01 04:00:00.000000000 +0400
3 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm 2020-02-12 10:19:08.000000000 +0400
4 @@ -0,0 +1,492 @@
5 +package SrvMngr::Controller::Domains;
6 +
7 +use strict;
8 +use warnings;
9 +use Mojo::Base 'Mojolicious::Controller';
10 +
11 +use Locale::gettext;
12 +use SrvMngr::I18N;
13 +
14 +use SrvMngr qw(theme_list init_session_cgi);
15 +
16 +#use Data::Dumper;
17 +
18 +#use esmith::FormMagick::Panel::domains;
19 +
20 +use esmith::DomainsDB;
21 +use esmith::AccountsDB;
22 +#use URI::Escape;
23 +
24 +
25 +our $ddb = esmith::DomainsDB->open || die "Couldn't open domains db";
26 +our $cdb = esmith::ConfigDB->open || die "Couldn't open configuration db";
27 +our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
28 +
29 +our $REGEXP_DOMAIN = qq([a-zA-Z0-9\-\.]+);
30 +
31 +
32 +sub main {
33 +
34 + my $c = shift;
35 + $c->app->log->info($c->log_req);
36 +
37 + my %dom_datas = ();
38 + my $title = $c->l('dom_FORM_TITLE');
39 + my $notif = '';
40 +
41 + $dom_datas{trt} = 'LIST';
42 +
43 + my @domains;
44 + for ($ddb->domains())
45 + {
46 + my $ns = $_->prop('Nameservers') || 'internet';
47 +
48 + push @domains,
49 + { Domain => $_->key, $_->props,
50 + Nameservers => $ns,
51 + }
52 + }
53 + $dom_datas{forwarder} = $cdb->get_prop('dnscache', 'Forwarder');
54 + $dom_datas{forwarder2} = $cdb->get_prop('dnscache', 'Forwarder2') || '';
55 +
56 + $c->stash( title => $title, notif => $notif, dom_datas => \%dom_datas, domains => \@domains );
57 + $c->render(template => 'domains');
58 +
59 +};
60 +
61 +
62 +sub do_display {
63 +
64 + my $c = shift;
65 + $c->app->log->info($c->log_req);
66 +
67 + my $rt = $c->current_route;
68 + my $trt = $c->param('trt');
69 + my $domain = $c->param('Domain') || '';
70 +
71 + $trt = 'DEL' if ( $rt eq 'domaindel1' );
72 + $trt = 'UPD' if ( $rt eq 'domainupd1' );
73 + $trt = 'UP2' if ( $rt eq 'domainup21' );
74 + $trt = 'ADD' if ( $rt eq 'domainadd1' );
75 +
76 + my %dom_datas = ();
77 + my $title = $c->l('dom_FORM_TITLE');
78 + my $notif = '';
79 +
80 + $dom_datas{'trt'} = $trt;
81 +
82 + if ( $trt eq 'ADD' ) {
83 +
84 + }
85 +
86 + if ( $trt eq 'UPD' ) {
87 +
88 + my $rec = $ddb->get($domain);
89 + if ( $rec ) {
90 + $dom_datas{domain} = $domain;
91 + $dom_datas{description} = $rec->prop('Description') || '';
92 + $dom_datas{content} = $rec->prop('Content') || '';
93 + $dom_datas{nameservers} = $rec->prop('Nameservers') || 'internet';
94 + } else {
95 + $notif = "Domain $domain not found !"
96 + }
97 + }
98 +
99 + if ( $trt eq 'UP2' ) {
100 +
101 + $dom_datas{forwarder} = $cdb->get_prop('dnscache', 'Forwarder') || '';
102 + $dom_datas{forwarder2} = $cdb->get_prop('dnscache', 'Forwarder2') || '';
103 +
104 + }
105 +
106 + if ( $trt eq 'DEL' ) {
107 +
108 + my $rec = $ddb->get($domain);
109 + if ( $rec ) {
110 + $dom_datas{domain} = $domain;
111 + $dom_datas{description} = $rec->prop('Description') || '';
112 + }
113 + }
114 +
115 + if ( $trt eq 'LIST' ) {
116 + my @domains;
117 + if ($adb) {
118 + @domains = $ddb->domains();
119 + }
120 + $c->stash( domains => \@domains );
121 +
122 + }
123 +
124 + $c->stash( title => $title, notif => $notif, dom_datas => \%dom_datas );
125 + $c->render( template => 'domains' );
126 +
127 +};
128 +
129 +
130 +sub do_update {
131 +
132 + my $c = shift;
133 + $c->app->log->info($c->log_req);
134 +
135 + my $rt = $c->current_route;
136 + my $trt = ($c->param('trt') || 'LIST');
137 +
138 + my %dom_datas = ();
139 + my $result = '';
140 +
141 + #my $domain = uri_unescape($c->param('domain'));
142 + my $domain = $c->param('Domain');
143 +
144 + if ( $trt eq 'ADD' ) {
145 +
146 + my $account = $c->param('Account');
147 +
148 + # controls (validate ?????)
149 + my $res = '';
150 + # validate_new_domain_name( $c, $domain, $account );
151 + $result .= $res unless $res eq 'OK';
152 +
153 + #$result .= ' blocked';
154 +
155 + if ( ! $result ) {
156 + $res = create_modify_domain( $c, 'create', $domain );
157 + $result .= $res unless $res eq 'OK';
158 + }
159 +
160 + if ( ! $result ) {
161 + $result = $c->l('dom_CREATE_SUCCEEDED') . ' ' . $domain;
162 + $trt = 'SUC';
163 + }
164 + }
165 +
166 + if ( $trt eq 'UPD' ) {
167 +
168 + my $description = $c->param('Description');
169 + my $content = $c->param('Content');
170 + my $nameservers = $c->param('Nameservers');
171 +
172 + #my %props = ('Account' => $account);
173 +
174 + # controls
175 + my $res = '';
176 + #$res = validate_description( $c, $account );
177 + $result .= $res unless $res eq 'OK';
178 +
179 + #$result .= 'blocked';
180 +
181 + if ( ! $result ) {
182 + $res = create_modify_domain( $c, 'update', $domain );
183 + $result .= $res unless $res eq 'OK';
184 + }
185 +
186 + if ( ! $result ) {
187 + $result = $c->l('dom_MODIFY_SUCCEEDED') . ' ' . $domain;
188 + $trt = 'SUC';
189 + }
190 + }
191 +
192 +
193 + if ( $trt eq 'UP2' ) {
194 +
195 + my $forwarder = $c->param('Forwarder');
196 + my $forwarder2 = $c->param('Forwarder2');
197 +
198 + # controls
199 + my $res = '';
200 +
201 + $res = ip_number_or_blank( $c, $forwarder);
202 + $result .= $res unless $res eq 'OK';
203 +
204 + $res = ip_number_or_blank( $c, $forwarder2);
205 + $result .= $res unless $res eq 'OK';
206 +
207 + #$result .= 'blocked';
208 +
209 + if ( ! $result ) {
210 + my $res = modify_dns( $c, $forwarder, $forwarder2 );
211 + $result .= $res unless $res eq 'OK';
212 + }
213 + if ( ! $result ) {
214 + $result = $c->l('SUCCESS') . ' ' . $domain;
215 + $trt = 'SUC';
216 + }
217 + }
218 +
219 +
220 + if ( $trt eq 'DEL' ) {
221 +
222 + # controls
223 + my $res = '';
224 + #$res = validate_is_domain($c, $domain);
225 + $result .= $res unless $res eq 'OK';
226 +
227 + #$result .= 'blocked';
228 +
229 + if ( ! $result ) {
230 + my $res = delete_domain( $c, $domain );
231 + $result .= $res unless $res eq 'OK';
232 + }
233 + if ( ! $result ) {
234 + $result = $c->l('dom_REMOVE_SUCCEEDED') . ' ' . $domain;
235 + $trt = 'SUC';
236 + }
237 + }
238 +
239 + my $title = $c->l('dom_FORM_TITLE');
240 + $dom_datas{'domain'} = $domain;
241 + $dom_datas{'trt'} = $trt;
242 +
243 +# $c->stash( title => $title, notif => $result );
244 +# $c->render(template => 'module');
245 + $c->stash( title => $title, notif => $result, dom_datas => \%dom_datas );
246 + if ($dom_datas{trt} ne 'SUC') {
247 + return $c->render(template => 'domains');
248 + }
249 + $c->redirect_to('/domains');
250 +
251 +
252 +};
253 +
254 +
255 +sub create_modify_domain {
256 +
257 + my ($c, $action, $domain) = @_;
258 +
259 + $domain = $1 if ($domain =~ /^($REGEXP_DOMAIN)$/);
260 + unless ($domain) {
261 + return $c->l($action eq 'create' ? 'dom_ERROR_CREATING_DOMAIN'
262 + : 'dom_ERROR_MODIFYING_DOMAIN');
263 + }
264 +
265 + my $rec = $ddb->get($domain);
266 + if ($rec and $action eq 'create') {
267 + return $c->l('dom_DOMAIN_IN_USE_ERROR');
268 + }
269 + if (not $rec and $action eq 'modify') {
270 + return $c->l('dom_NONEXISTENT_DOMAIN_ERROR');
271 + }
272 +
273 + $rec ||= $ddb->new_record($domain, { type => 'domain' });
274 + my %props;
275 + $props{$_} = $c->param($_) for ( qw(Content Description Nameservers) );
276 + $rec->merge_props(%props);
277 +
278 + my $status = system( "/sbin/e-smith/signal-event",
279 + "domain-$action", "$domain" );
280 +
281 + if ($status) {
282 + return ($action eq 'create' ? 'dom_ERROR_CREATING_DOMAIN'
283 + : 'dom_ERROR_MODIFYING_DOMAIN');
284 + }
285 +
286 + return 'OK';
287 +}
288 +
289 +
290 +sub delete_domain {
291 +
292 + my ($c, $domain) = @_;
293 +
294 + $domain = $1 if ($domain =~ /^($REGEXP_DOMAIN)$/);
295 + return ($c->l('dom_ERROR_WHILE_REMOVING_DOMAIN')) unless ($domain);
296 +
297 + my $rec = $ddb->get($domain);
298 + return ($c->l('dom_NONEXISTENT_DOMAIN_ERROR')) if (not $rec);
299 +
300 + $rec->set_prop('type', 'domain-deleted');
301 +
302 + if (system("/sbin/e-smith/signal-event", "domain-delete", "$domain") == 0) {
303 + $rec->delete;
304 + return 'OK';
305 + }
306 + return ($c->l('dom_ERROR_WHILE_REMOVING_DOMAIN'));
307 +}
308 +
309 +
310 +sub existing_accounts_list {
311 +
312 + my $c = shift;
313 +
314 + my @existingAccounts = ( ['Administrator' => 'admin']);
315 +
316 + foreach my $a ($adb->get_all) {
317 + if ($a->prop('type') =~ /(user|group)/) {
318 + push @existingAccounts, [ $a->key => $a->key ];
319 + }
320 + if ($a->prop('type') eq "domain") {
321 + my $target = $adb->get($a->prop('Account'));
322 +
323 + unless ($target)
324 + {
325 + warn "WARNING: domain (" . $a->key . ") => missing Account("
326 + . $a->prop('Account') . ")\n";
327 + next;
328 + }
329 +
330 + push @existingAccounts, [ $a->key, $a->key ]
331 + unless ($target->prop('type') eq "domain");
332 + }
333 + }
334 +
335 + return(\@existingAccounts);
336 +}
337 +
338 +
339 +sub content_options_list {
340 +
341 + my $c = shift;
342 +
343 + my @options = ( [ $c->l('dom_PRIMARY_SITE') => 'Primary' ]);
344 +
345 + foreach ($adb->ibays) {
346 + push @options, [ $_->prop('Name') => $_->key ]
347 + if ($_->key ne 'Primary');
348 + }
349 +
350 + return \@options
351 +}
352 +
353 +
354 +sub get_content_value
355 +{
356 + my $c = shift;
357 + my $domain = shift;
358 +
359 + return $domain ? $ddb->get_prop($domain, 'Content') : 'Primary';
360 +}
361 +
362 +
363 +sub get_description_value
364 +{
365 + my $c = shift;
366 +
367 + my $domain = $c->param('Domain') || undef;
368 +
369 + return $ddb->get_prop($domain, 'Description');
370 +}
371 +
372 +
373 +sub nameserver_options_list {
374 +
375 + my $c = shift;
376 + my $domain = $c->param('Domain') || undef;
377 +
378 + my @opts = qw(localhost internet);
379 + push @opts, 'corporate' if ($cdb->get_prop('dnscache', 'Forwarder'));
380 + my $ns = ($ddb->get_prop($domain, 'Nameservers') || 'internet');
381 + push @opts, $ns unless scalar grep { /^$ns$/ } @opts;
382 +
383 + my @options;
384 + foreach (@opts) {
385 + push @options, [ $c->l( "dom_$_" ) => $_ ];
386 + }
387 +
388 + return \@options;
389 +}
390 +
391 +
392 +sub get_nameserver_value {
393 + my $c = shift;
394 +
395 + my $domain = $c->param('Domain') || undef;
396 +
397 + return ($ddb->get_prop($domain, 'Nameservers') || 'internet');
398 +}
399 +
400 +
401 +sub validate_Domain
402 +{
403 + my $c = shift;
404 + my $domain = lc shift;
405 +
406 + return ($domain =~ /^($REGEXP_DOMAIN)$/) ? 'OK' :
407 + 'DOMAIN_NAME_VALIDATION_ERROR';
408 +}
409 +
410 +
411 +sub validate_Description
412 +{
413 + # XXX - FIXME - NOTREACHED
414 + # We used to use the Description in the Appletalk volume name
415 + # which meant it needed validation. I don't see any reason to
416 + # do this any more
417 +
418 + my $c = shift;
419 + my $description = shift;
420 +
421 + return ($description =~ /^([\-\'\w][\-\'\w\s\.]*)$/) ? 'OK' :
422 + 'DOMAIN_DESCRIPTION_VALIDATION_ERROR';
423 +}
424 +
425 +
426 +sub ip_number_or_blank {
427 +
428 + # XXX - FIXME - we should push this down into CGI::FormMagick
429 +
430 + my $c = shift;
431 + my $ip = shift;
432 +
433 + if (!defined($ip) || $ip eq "")
434 + {
435 + return 'OK';
436 + }
437 +
438 + return ip_number( $c, $ip );
439 +}
440 +
441 +
442 +sub ip_number {
443 +
444 +# from CGI::FormMagick::Validator qw( ip_number );
445 +
446 + my ($c, $data) = @_;
447 +
448 + return undef unless defined $data;
449 +
450 + return $c->l('FM_IP_NUMBER1') unless $data =~ /^[\d.]+$/;
451 +
452 + my @octets = split /\./, $data;
453 + my $dots = ($data =~ tr/.//);
454 +
455 + return $c->l('FM_IP_NUMBER2') unless (scalar @octets == 4 and $dots == 3);
456 +
457 + foreach my $octet (@octets) {
458 + return $c->l("FM_IP_NUMBER3", $octet) if $octet > 255;
459 + }
460 +
461 + return 'OK';
462 +}
463 +
464 +
465 +
466 +sub modify_dns {
467 +
468 + my ($c, $forwarder, $forwarder2) = @_;
469 +
470 + my $dnscache = $cdb->get('dnscache');
471 +
472 + ($forwarder, $forwarder2) = ($forwarder2, '')
473 + if ($forwarder2 and not $forwarder);
474 +
475 + if ($forwarder) {
476 + $dnscache->set_prop('Forwarder', $forwarder);
477 + } else {
478 + $dnscache->delete_prop('Forwarder');
479 + }
480 +
481 + if ($forwarder2) {
482 + $dnscache->set_prop('Forwarder2', $forwarder2);
483 + } else {
484 + $dnscache->delete_prop('Forwarder2');
485 + }
486 +
487 + unless ( system( "/sbin/e-smith/signal-event", "dns-update" ) == 0 )
488 + {
489 + return $c->l('dom_ERROR_UPDATING');
490 + }
491 +
492 + return 'OK';
493 +}
494 +
495 +
496 +1;
497 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm
498 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm 1970-01-01 04:00:00.000000000 +0400
499 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm 2020-02-11 22:37:33.000000000 +0400
500 @@ -0,0 +1,590 @@
501 +package SrvMngr::Controller::Hostentries;
502 +
503 +use strict;
504 +use warnings;
505 +use Mojo::Base 'Mojolicious::Controller';
506 +
507 +use Locale::gettext;
508 +use SrvMngr::I18N;
509 +
510 +use SrvMngr qw(theme_list init_session_cgi);
511 +
512 +#use Data::Dumper;
513 +
514 +#use esmith::FormMagick::Panel::hostentries;
515 +
516 +use esmith::DomainsDB;
517 +use esmith::AccountsDB;
518 +use esmith::HostsDB;
519 +use esmith::NetworksDB;
520 +use HTML::Entities;
521 +use Net::IPv4Addr qw(ipv4_in_network);
522 +#use URI::Escape;
523 +
524 +
525 +our $ddb = esmith::DomainsDB->open || die "Couldn't open hostentries db";
526 +our $cdb = esmith::ConfigDB->open || die "Couldn't open configuration db";
527 +our $hdb = esmith::HostsDB->open || die "Couldn't open hosts db";
528 +our $ndb = esmith::NetworksDB->open || die "Couldn't open networks db";
529 +
530 +
531 +sub main {
532 +
533 + my $c = shift;
534 + $c->app->log->info($c->log_req);
535 +
536 + my %hos_datas = ();
537 + my $title = $c->l('hos_FORM_TITLE');
538 + my $notif = '';
539 +
540 + $hos_datas{trt} = 'LIST';
541 +
542 + my %dom_hosts = ();
543 +
544 + foreach my $d ( @{domains_list()} )
545 + {
546 + $dom_hosts {$d} = { COUNT => 0, HOSTS => [] };
547 +
548 + if (my @hosts = $hdb->get_hosts_by_domain($d))
549 + {
550 + $dom_hosts {$d} {'COUNT'} = scalar( @hosts );
551 + # my @entries;
552 + push @{ $dom_hosts {$d} {'HOSTS'} },
553 + host_data( $_ ) foreach (@hosts);
554 + }
555 + }
556 +
557 + $c->stash( title => $title, notif => $notif, hos_datas => \%hos_datas, dom_hosts => \%dom_hosts );
558 + $c->render(template => 'hostentries');
559 +
560 +};
561 +
562 +
563 +sub do_display {
564 +
565 + my $c = shift;
566 + $c->app->log->info($c->log_req);
567 +
568 + my $rt = $c->current_route;
569 + my $trt = $c->param('trt') || 'LST';
570 + my $hostname = $c->param('Hostname') || '';
571 +
572 + $trt = 'ADD' if ( $rt eq 'hostentryadd' );
573 + $trt = 'LST' if ($trt ne 'DEL' && $trt ne 'UPD' && $trt ne 'ADD');
574 +
575 + my %hos_datas = ();
576 + my $title = $c->l('hos_FORM_TITLE');
577 + my $notif = '';
578 +
579 + $hos_datas{'trt'} = $trt;
580 +
581 + if ( $trt eq 'ADD' ) {
582 +
583 + }
584 +
585 + if ( $trt eq 'UPD' or $trt eq 'DEL' ) {
586 +
587 + my $rec = $hdb->get($hostname);
588 + if ( $rec ) {
589 + $hos_datas{hostname} = $rec->key;
590 + ( $hos_datas{name}, $hos_datas{domain} ) = split_hostname($hostname);
591 + $hos_datas{internalip} = $rec->prop('InternalIP') || '';
592 + $hos_datas{externalip} = $rec->prop('ExternalIP') || '';
593 + $hos_datas{macaddress} = $rec->prop('MACAddress') || '';
594 + $hos_datas{hosttype} = $rec->prop('HostType');
595 + $hos_datas{comment} = HTML::Entities::encode($rec->prop('Comment'));
596 + } else {
597 + $notif = "Hostname $hostname not found !"
598 + }
599 + }
600 +
601 + #if ( $trt eq 'DEL' ) {
602 +
603 + # my $rec = $hdb->get($hostname);
604 + # if ( $rec ) {
605 + # get_hos_datas( $rec, %hos_datas );
606 + # } else {
607 + # $notif = "Hostname $hostname not found !"
608 + # }
609 + #}
610 +
611 + if ( $trt eq 'LIST' ) {
612 +
613 + }
614 +
615 + $c->stash( title => $title, notif => $notif, hos_datas => \%hos_datas );
616 + $c->render( template => 'hostentries' );
617 +
618 +};
619 +
620 +
621 +sub do_update {
622 +
623 + my $c = shift;
624 + $c->app->log->info($c->log_req);
625 +
626 + my $rt = $c->current_route;
627 + my $trt = ($c->param('trt') || 'LIST');
628 +
629 + my %hos_datas = ();
630 + my $title = $c->l('hos_FORM_TITLE');
631 + my $notif = '';
632 + my $result = '';
633 +
634 + $hos_datas{'name'} = lc $c->param('Name');
635 + $hos_datas{'domain'} = lc $c->param('Domain');
636 + $hos_datas{'hostname'} = $c->param('Hostname');
637 + $hos_datas{'comment'} = $c->param('Comment');
638 + $hos_datas{'hosttype'} = $c->param('Hosttype');
639 + $hos_datas{'internalip'} = $c->param('Internalip');
640 + $hos_datas{'macaddress'} = $c->param('Macaddress');
641 + $hos_datas{'externalip'} = $c->param('Externalip');
642 + my $hostname = "$hos_datas{'name'}.$hos_datas{'domain'}";
643 +
644 + if ( $trt eq 'ADD' ) {
645 +
646 + # controls
647 + my $res = '';
648 + unless ( $hos_datas{'name'} =~ /^[a-z0-9][a-z0-9-]*$/ ) {
649 + $result .= $c->l('hos_HOSTNAME_VALIDATOR_ERROR') . '<br>';
650 + }
651 +
652 + unless ( $hos_datas{comment} =~ /^([a-zA-Z0-9][\_\.\-,A-Za-z0-9\s]*)$/ || $hos_datas{comment} eq '' ) {
653 + $result .= $c->l('hos_HOSTNAME_COMMENT_ERROR') . '<br>';
654 + }
655 +
656 + # Look for duplicate hosts.
657 + my $hostrec = undef;
658 + if ( $hostrec = $hdb->get($hostname) ) {
659 + $result .= $c->l('hos_HOSTNAME_EXISTS_ERROR',
660 + {fullHostName => $hostname, type => $hostrec->prop('HostType')}) . '<br>',;
661 + }
662 +
663 + if ( ! $result and $hos_datas{hosttype} ne 'Self' ) {
664 + if ( $hos_datas{hosttype} eq 'Local' ) {
665 + $hos_datas{'trt'} = 'ALC'; # ADD/LOCAL
666 + } else {
667 + $hos_datas{'trt'} = 'ARM'; # ADD/REMOVE
668 + }
669 +
670 + $c->stash( title => $title, notif => '', hos_datas => \%hos_datas );
671 + return $c->render( template => 'hostentries' );
672 + }
673 +
674 + #!#$result .= ' blocked';
675 +
676 + if ( ! $result ) {
677 + $res = create_modify_hostentry( $c, $trt, %hos_datas );
678 + $result .= $res unless $res eq 'OK';
679 + }
680 + if ( ! $result ) {
681 + $result = $c->l('hos_CREATE_OR_MODIFY_SUCCEEDED') . ' ' . $hostname;
682 + $trt = 'SUC';
683 + }
684 + }
685 +
686 +
687 + if ( $trt eq 'UPD' ) {
688 +
689 + # controls
690 + my $res = '';
691 + #$res = validate_description( $c, $account );
692 + #$result .= $res unless $res eq 'OK';
693 +
694 + unless ( $hos_datas{comment} =~ /^([a-zA-Z0-9][\_\.\-,A-Za-z0-9\s]*)$/ || $hos_datas{comment} eq '' ) {
695 + $result .= $c->l('hos_HOSTNAME_COMMENT_ERROR') . '<br>';
696 + }
697 +
698 + if ( ! $result and $hos_datas{hosttype} ne 'Self' ) {
699 + if ( $hos_datas{hosttype} eq 'Local' ) {
700 + $hos_datas{'trt'} = 'ULC'; # UPDATE/LOCAL
701 + } else {
702 + $hos_datas{'trt'} = 'URM'; # UPDATE/REMOVE
703 + }
704 +
705 + $c->stash( title => $title, notif => '', hos_datas => \%hos_datas );
706 + return $c->render( template => 'hostentries' );
707 + }
708 +
709 + #!#$result .= 'blocked';
710 +
711 + if ( ! $result ) {
712 + $res = create_modify_hostentry( $c, $trt, %hos_datas );
713 + $result .= $res unless $res eq 'OK';
714 + }
715 +
716 + if ( ! $result ) {
717 + $result = $c->l('hos_MODIFY_SUCCEEDED') . ' ' . $hostname;
718 + $trt = 'SUC';
719 + }
720 + }
721 +
722 +
723 + if ( $trt =~ /^.LC$/ ) {
724 +
725 + # controls
726 + my $res = '';
727 + $res = ip_number( $c, $hos_datas{internalip} );
728 + $result .= $res . ' ' unless $res eq 'OK';
729 +
730 + $res = not_in_dhcp_range( $c, $hos_datas{internalip} );
731 + $result .= $res . ' ' unless $res eq 'OK';
732 +
733 + $res = not_taken( $c, $hos_datas{internalip} );
734 + $result .= $res . ' ' unless $res eq 'OK';
735 +
736 + $res = must_be_local( $c, $hos_datas{internalip} );
737 + $result .= $res . ' ' unless $res eq 'OK';
738 +
739 + $res = mac_address_or_blank( $c, $hos_datas{macaddress} );
740 + $result .= $res . ' ' unless $res eq 'OK';
741 +
742 + #!#$result .= 'blocked';
743 +
744 + if ( ! $result ) {
745 + $res = create_modify_hostentry( $c, $trt, %hos_datas );
746 + $result .= $res unless $res eq 'OK';
747 + }
748 +
749 + if ( ! $result ) {
750 + $result = $c->l('hos_MODIFY_SUCCEEDED') . ' ' . $hostname;
751 + $trt = 'SUC';
752 + }
753 + }
754 +
755 +
756 + if ( $trt =~ /^.RM$/ ) {
757 +
758 + # controls
759 + my $res = '';
760 + $res = ip_number_or_blank( $c, $hos_datas{externalip} );
761 + $result .= $res . '<br>' unless $res eq 'OK';
762 +
763 + #!#$result .= 'blocked';
764 +
765 + if ( ! $result ) {
766 + $res = create_modify_hostentry( $c, $trt, %hos_datas );
767 + $result .= $res unless $res eq 'OK';
768 + }
769 +
770 + if ( ! $result ) {
771 + $result = $c->l('hos_MODIFY_SUCCEEDED') . ' ' . $hostname;
772 + $trt = 'SUC';
773 + }
774 +
775 + }
776 +
777 +
778 + #if ( $trt eq 'ULC' ) {
779 + #}
780 +
781 +
782 + #if ( $trt eq 'URM' ) {
783 + #}
784 +
785 +
786 + if ( $trt eq 'DEL' ) {
787 +
788 + # controls
789 + my $res = '';
790 + #$res = validate_is_hostentry($c, $hostname);
791 + #$result .= $res unless $res eq 'OK';
792 +
793 + #!#$result .= 'blocked';
794 +
795 + if ( ! $result ) {
796 + my $res = delete_hostentry( $c, $hos_datas{hostname} );
797 + $result .= $res unless $res eq 'OK';
798 + }
799 + if ( ! $result ) {
800 + $result = $c->l('hos_REMOVE_SUCCEEDED') . ' ' . $hostname;
801 + $trt = 'SUC';
802 + }
803 + }
804 +
805 + $hos_datas{'hostname'} = $hostname;
806 + $hos_datas{'trt'} = $trt;
807 +
808 + $c->stash( title => $title, notif => $result, hos_datas => \%hos_datas );
809 +
810 + if ($hos_datas{trt} ne 'SUC') {
811 + return $c->render(template => 'hostentries');
812 + }
813 + $c->redirect_to('/hostentries');
814 +
815 +
816 +};
817 +
818 +
819 +sub create_modify_hostentry {
820 +
821 + my ($c, $trt, %hos_datas) = @_;
822 +
823 + my $hostname = $hos_datas{hostname};
824 + my $action;
825 +
826 + if ($trt eq 'ADD' or $trt eq 'ALC' or $trt eq 'ARM') {
827 + $action = 'create';
828 + }
829 + if ( $trt eq 'UPD' or $trt eq 'ULC' or $trt eq 'URM') {
830 + $action = 'modify';
831 + }
832 +
833 + unless ($hostname) {
834 + return $c->l($action eq 'create' ? $c->l('hos_ERROR_CREATING_HOST')
835 + : $c->l('hos_ERROR_MODIFYING_HOST'));
836 + }
837 +
838 + # Untaint and lowercase $hostname
839 + $hostname =~ /([\w\.-]+)/; $hostname = lc($1);
840 +
841 + my $rec = $hdb->get($hostname);
842 + if ($rec and $action eq 'create') {
843 + return $c->l('hos_HOSTNAME_IN_USE_ERROR');
844 + }
845 + if (not $rec and $action eq 'modify') {
846 + return $c->l('hos_NONEXISTENT_HOSTNAME_ERROR');
847 + }
848 +
849 + my %props = (
850 + type => 'host',
851 + HostType => $hos_datas{hosttype},
852 + ExternalIP => $hos_datas{externalip},
853 + InternalIP => $hos_datas{internalip},
854 + MACAddress => $hos_datas{macaddress},
855 + Comment => $hos_datas{comment},
856 + );
857 +
858 + if ($action eq 'create') {
859 + if ($hdb->new_record($hostname, \%props)) {
860 + if (system("/sbin/e-smith/signal-event", "host-$action", $hostname) != 0) {
861 + return $c->l('hos_ERROR_WHILE_CREATING_HOST');
862 + }
863 + }
864 + }
865 +
866 + if ($action eq 'modify') {
867 + if ($rec->merge_props(%props)) {
868 + if (system("/sbin/e-smith/signal-event", "host-$action", $hostname) != 0) {
869 + rturn $c->l('hos_ERROR_WHILE_MODIFYING_HOST');
870 + }
871 + }
872 + }
873 + return 'OK';
874 +
875 +}
876 +
877 +
878 +sub delete_hostentry {
879 +
880 + my ($c, $hostname) = @_;
881 +
882 + # Untaint $hostname before use in system()
883 + $hostname =~ /([\w\.-]+)/; $hostname = $1;
884 +
885 + return ($c->l('hos_ERROR_WHILE_REMOVING_HOST')) unless ($hostname);
886 +
887 + my $rec = $hdb->get($hostname);
888 + return ($c->l('hos_NONEXISTENT_HOST_ERROR')) if (not $rec);
889 +
890 +
891 + if ($rec->delete()) {
892 + if (system("/sbin/e-smith/signal-event", "host-delete", "$hostname") == 0) {
893 + return 'OK';
894 + }
895 + }
896 + return ($c->l('hos_ERROR_WHILE_DELETING_HOST'));
897 +}
898 +
899 +
900 +sub domains_list {
901 +
902 + my $d = esmith::DomainsDB->open_ro() or die "Couldn't open DomainsDB";
903 + my @domains;
904 + for ($d->domains)
905 + {
906 + my $ns = $_->prop("Nameservers") || 'localhost';
907 + push @domains, $_->key if ($ns eq 'localhost');
908 + }
909 +
910 + return \@domains;
911 +}
912 +
913 +
914 +sub host_data {
915 +
916 + my $host_record = shift;
917 +
918 + my $ht = $host_record->prop('HostType');
919 + my $ip =
920 + ($ht eq 'Self') ? $cdb->get_value('LocalIP') :
921 + ($ht eq 'Remote') ? $host_record->prop('ExternalIP') :
922 + $host_record->prop('InternalIP');
923 +
924 + my %data = ('IP' => $ip,
925 + 'HostName' => $host_record->key(),
926 + 'HostType' => $host_record->prop('HostType'),
927 + 'MACAddress' => ($host_record->prop('MACAddress') || ''),
928 + 'Comment' => ($host_record->prop('Comment') || ''),
929 + 'static' => ($host_record->prop('static') || 'no'));
930 + return \%data
931 +
932 +}
933 +
934 +
935 +sub hosttype_list {
936 +
937 + my $c = shift;
938 +
939 + return [[ $c->l('SELF') => 'Self'],
940 + [ $c->l('LOCAL') => 'Local'],
941 + [ $c->l('REMOTE') => 'Remote']];
942 +}
943 +
944 +
945 +sub split_hostname {
946 + my $hostname = shift;
947 + return ($hostname =~ /^([^\.]+)\.(.+)$/);
948 +}
949 +
950 +
951 +sub mac_address_or_blank {
952 + my ($c, $data) = @_;
953 + return "OK" unless $data;
954 + return mac_address($c, $data);
955 +}
956 +
957 +
958 +sub mac_address {
959 +
960 +# from CGI::FormMagick::Validator::Network
961 +
962 + my ($c, $data) = @_;
963 +
964 + $_ = lc $data; # easier to match on $_
965 + if (not defined $_) {
966 + return $c->l('FM_MAC_ADDRESS1');
967 + } elsif (/^([0-9a-f][0-9a-f](:[0-9a-f][0-9a-f]){5})$/) {
968 + return "OK";
969 + } else {
970 + return $c->l('FM_MAC_ADDRESS2');
971 + }
972 +}
973 +
974 +
975 +sub ip_number_or_blank {
976 +
977 + # XXX - FIXME - we should push this down into CGI::FormMagick
978 +
979 + my $c = shift;
980 + my $ip = shift;
981 +
982 + if (!defined($ip) || $ip eq "")
983 + {
984 + return 'OK';
985 + }
986 +
987 + return ip_number( $c, $ip );
988 +}
989 +
990 +
991 +sub ip_number {
992 +
993 +# from CGI::FormMagick::Validator qw( ip_number );
994 +
995 + my ($c, $data) = @_;
996 +
997 + return undef unless defined $data;
998 +
999 + return $c->l('FM_IP_NUMBER1') unless $data =~ /^[\d.]+$/;
1000 +
1001 + my @octets = split /\./, $data;
1002 + my $dots = ($data =~ tr/.//);
1003 +
1004 + return $c->l('FM_IP_NUMBER2') unless (scalar @octets == 4 and $dots == 3);
1005 +
1006 + foreach my $octet (@octets) {
1007 + return $c->l("FM_IP_NUMBER3", $octet) if $octet > 255;
1008 + }
1009 +
1010 + return 'OK';
1011 +}
1012 +
1013 +
1014 +sub not_in_dhcp_range {
1015 +
1016 + my $c = shift;
1017 + my $address = shift;
1018 +
1019 + my $status = $cdb->get('dhcpd')->prop('status') || "disabled";
1020 + return 'OK' unless $status eq "enabled";
1021 +
1022 + my $start = $cdb->get('dhcpd')->prop('start');
1023 + my $end = $cdb->get('dhcpd')->prop('end');
1024 +
1025 + return (esmith::util::IPquadToAddr($start)
1026 + <= esmith::util::IPquadToAddr($address)
1027 + &&
1028 + esmith::util::IPquadToAddr($address)
1029 + <= esmith::util::IPquadToAddr($end)) ?
1030 + $c->l('hos_ADDR_IN_DHCP_RANGE') :
1031 + 'OK';
1032 +}
1033 +
1034 +
1035 +sub not_taken {
1036 +
1037 + my $c = shift;
1038 + my $localip = shift;
1039 +
1040 + my $server_localip = $cdb->get_value('LocalIP') || '';
1041 + my $server_gateway = $cdb->get_value('GatewayIP') || '';
1042 + my $server_extip = $cdb->get_value('ExternalIP') || '';
1043 +
1044 + #$c->debug_msg("\$localip is $localip");
1045 + #$c->debug_msg("\$server_localip is $server_localip");
1046 + #$c->debug_msg("\$server_gateway is $server_gateway");
1047 + #$c->debug_msg("\$server_extip is $server_extip");
1048 +
1049 + if ($localip eq $server_localip) {
1050 + return $c->l('hos_ERR_IP_IS_LOCAL_OR_GATEWAY');
1051 + }
1052 +
1053 + if ($localip eq $server_gateway) {
1054 + return $c->l('hos_ERR_IP_IS_LOCAL_OR_GATEWAY');
1055 + }
1056 +
1057 + if (($cdb->get_value('SystemMode') ne 'serveronly') &&
1058 + ($server_extip eq $localip)) {
1059 + return $c->l('hos_ERR_IP_IS_LOCAL_OR_GATEWAY');
1060 + }
1061 +
1062 + if ($localip eq '127.0.0.1') {
1063 + return $c->l('hos_ERR_IP_IS_LOCAL_OR_GATEWAY');
1064 + } else {
1065 + return 'OK';
1066 + }
1067 +}
1068 +
1069 +
1070 +sub must_be_local {
1071 +
1072 + my $c = shift;
1073 + my $localip = shift;
1074 +
1075 + # Make sure that the IP is indeed local.
1076 + #my $ndb = esmith::NetworksDB->open_ro;
1077 + my @local_list = $ndb->local_access_spec;
1078 +
1079 + foreach my $spec (@local_list) {
1080 + next if $spec eq '127.0.0.1';
1081 + if (eval{Net::IPv4Addr::ipv4_in_network($spec, $localip)}) {
1082 + return 'OK';
1083 + }
1084 + }
1085 + # Not OK. The IP is not on any of our local networks.
1086 + return $c->l('hos_ERR_IP_NOT_LOCAL');
1087 +}
1088 +
1089 +
1090 +1;
1091 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm
1092 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm 2020-01-23 11:13:34.000000000 +0400
1093 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm 2020-02-02 21:03:50.000000000 +0400
1094 @@ -17,10 +17,6 @@
1095 init_session( $c );
1096 }
1097
1098 - my %nav = %{SrvMngr::navigation2->getNavigation( $c->languages() )};
1099 -# $c->app->log->info("nav: " . $c->dumper(%{SrvMngr::navigation2->getNavigation( $c->languages() )}));
1100 -# $c->app->log->info("nav: " . $c->dumper(%{SrvMngr::navigation2->getNavigation( $c->session->{lang} )}));
1101 -
1102 my $title = $c->l('initial_FORM_TITLE');
1103 my $modul = $c->render_to_string(inline => $c->l('initial_FRAMES_BODY'));
1104
1105 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm
1106 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm 2020-01-24 18:57:24.000000000 +0400
1107 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm 2020-02-08 16:14:23.000000000 +0400
1108 @@ -9,15 +9,10 @@
1109
1110 use SrvMngr qw(theme_list init_session_cgi);
1111
1112 -#use esmith::config;
1113 -#use esmith::NavigationDB;
1114 -#use esmith::util;
1115 -#use esmith::I18N;
1116 -
1117
1118 sub main {
1119 my $c = shift;
1120 - my $module = $c->param('module');
1121 + my $module = $c->stash('module');
1122
1123 $c->app->log->info($c->log_req);
1124
1125 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm
1126 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm 2020-01-24 18:56:36.000000000 +0400
1127 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm 2020-02-02 21:03:13.000000000 +0400
1128 @@ -9,11 +9,6 @@
1129
1130 use SrvMngr qw(theme_list init_session_cgi);
1131
1132 -#use esmith::config;
1133 -#use esmith::NavigationDB;
1134 -#use esmith::util;
1135 -#use esmith::I18N;
1136 -
1137 sub bugreport {
1138 my $c = shift;
1139
1140 @@ -23,8 +18,7 @@
1141 <br># \$c->stash\(\'lang\', \'releaseVer\'
1142 # \'navigation\'</p>");
1143
1144 -
1145 - $c->stash( modul => $modul, PwdSet => '1', Unsafe => '0' );
1146 + $c->stash( modul => $modul );
1147
1148 };
1149
1150 @@ -62,15 +56,6 @@
1151 my $module = $c->param('module');
1152
1153 $c->app->log->info($c->log_req);
1154 -# my ($lang, $releaseVersion, $copyRight, $PwdSet, $Unsafe, $config) =
1155 -# $c->stash('lang', 'releaseVersion', 'copyRight', 'PwdSet', 'Unsafe',
1156 -# 'navigation', 'modul', 'config');
1157 -
1158 - #my $page = $c->schema->resultset('Page')->single({ name => $module });
1159 - #$c->app->log->info("module page: '$page'");
1160 - #if ($page) {
1161 - #$c->render( page => $page );
1162 - #}
1163
1164 my $redirect_url = SrvMngr->get_mod_url($module);
1165 if($redirect_url ne "-1"){
1166 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm
1167 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm 1970-01-01 04:00:00.000000000 +0400
1168 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm 2020-02-08 17:24:35.000000000 +0400
1169 @@ -0,0 +1,431 @@
1170 +package SrvMngr::Controller::Pseudonyms;
1171 +
1172 +use strict;
1173 +use warnings;
1174 +use Mojo::Base 'Mojolicious::Controller';
1175 +
1176 +use Locale::gettext;
1177 +use SrvMngr::I18N;
1178 +
1179 +use SrvMngr qw(theme_list init_session_cgi);
1180 +
1181 +#use Data::Dumper;
1182 +
1183 +#use esmith::FormMagick::Panel::pseudonyms;
1184 +use esmith::AccountsDB;
1185 +#use URI::Escape;
1186 +
1187 +
1188 +our $cdb = esmith::ConfigDB->open || die "Couldn't open configuration db";
1189 +our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
1190 +
1191 +sub main {
1192 +
1193 + my $c = shift;
1194 + $c->app->log->info($c->log_req);
1195 +
1196 + my %pse_datas = ();
1197 + my $title = $c->l('pse_FORM_TITLE');
1198 + my $notif = '';
1199 +
1200 + $pse_datas{trt} = 'LIST';
1201 +
1202 + my @pseudonyms;
1203 + if ($adb)
1204 + {
1205 + @pseudonyms = $adb->pseudonyms();
1206 + }
1207 +
1208 +# foreach my $i (0 .. $#pseudonyms) {
1209 +# if ( $pseudonyms[$i]->prop('type') eq 'pseudonym' ) {
1210 +# my $account = $pseudonyms[$i]->prop('Account');
1211 +# my $accountO = $account;
1212 +# $account = "Administrator" if ($account eq "admin");
1213 +# $account = $c->l("pse_EVERYONE") if ($account eq "shared");
1214 +# my $visible = $pseudonyms[$i]->prop('Visible');
1215 +# $account .= $c->l("pse_LOCAL_ONLY")
1216 +# if (defined $visible && $visible eq "internal");
1217 +# if ( $account ne $accountO ) {
1218 +# $c->app->log->info( "pseudo $i: $accountO -> $account " );
1219 +# $pseudonyms[$i] =~ s/$accountO/$account/;
1220 +# # . $c->dumper( $pseudonyms[$i] ) )
1221 +# }
1222 +# }
1223 +# }
1224 +# $c->app->log->info("pseudos: " . $c->dumper(@pseudonyms));
1225 +
1226 + $c->stash( title => $title, notif => $notif, pse_datas => \%pse_datas, pseudonyms => \@pseudonyms );
1227 + $c->render(template => 'pseudonyms');
1228 +
1229 +};
1230 +
1231 +
1232 +sub do_display {
1233 +
1234 + my $c = shift;
1235 + $c->app->log->info($c->log_req);
1236 +
1237 + my $rt = $c->current_route;
1238 + my $trt = ($c->param('trt') || 'LIST');
1239 + my $pseudonym = $c->param('pseudonym') || '';
1240 +
1241 + $trt = 'DEL' if ( $rt eq 'pseudodel1' );
1242 + $trt = 'UPD' if ( $rt eq 'pseudoupd1' );
1243 + $trt = 'ADD' if ( $rt eq 'pseudoadd1' );
1244 +
1245 + my %pse_datas = ();
1246 + my $title = $c->l('pse_FORM_TITLE');
1247 + my $notif = '';
1248 +
1249 + $pse_datas{'trt'} = $trt;
1250 +
1251 + if ( $trt eq 'ADD' ) {
1252 +
1253 + }
1254 +
1255 + if ( $trt eq 'UPD' ) {
1256 +
1257 + my $rec = $adb->get($pseudonym);
1258 + if ($rec and $rec->prop('type') eq 'pseudonym') {
1259 +
1260 + $pse_datas{pseudonym} = $pseudonym;
1261 + $pse_datas{account} = $rec->prop('Account') || '';
1262 + $pse_datas{internal} = is_pseudonym_internal($pseudonym);
1263 + }
1264 + }
1265 +
1266 + if ( $trt eq 'DEL' ) {
1267 +
1268 + my $rec = $adb->get($pseudonym);
1269 + if ($rec and $rec->prop('type') eq 'pseudonym') {
1270 +
1271 + $pse_datas{pseudonym} = $pseudonym;
1272 + $pse_datas{account} = $rec->prop('Account') || '';
1273 + $pse_datas{internal} = is_pseudonym_internal($pseudonym);
1274 +
1275 + }
1276 + }
1277 +
1278 + if ( $trt eq 'LIST' ) {
1279 + my @pseudonyms;
1280 + if ($adb) {
1281 + @pseudonyms = $adb->pseudonyms();
1282 + }
1283 + $c->stash( pseudonyms => \@pseudonyms );
1284 +
1285 + }
1286 +
1287 + $c->stash( title => $title, notif => $notif, pse_datas => \%pse_datas );
1288 + $c->render( template => 'pseudonyms' );
1289 +
1290 +};
1291 +
1292 +
1293 +sub do_update {
1294 +
1295 + my $c = shift;
1296 + $c->app->log->info($c->log_req);
1297 +
1298 + my $rt = $c->current_route;
1299 + my $trt = ($c->param('trt') || 'LIST');
1300 +
1301 + my %pse_datas = ();
1302 + my $result = '';
1303 +
1304 + #my $pseudonym = uri_unescape($c->param('Pseudonym'));
1305 + my $pseudonym = $c->param('Pseudonym');
1306 +
1307 + if ( $trt eq 'ADD' ) {
1308 +
1309 + my $account = $c->param('Account');
1310 +
1311 + # controls (validate ?????)
1312 + my $res = validate_new_pseudonym_name( $c, $pseudonym, $account );
1313 + $result .= $res unless $res eq 'OK';
1314 +
1315 + #$result .= ' blocked';
1316 +
1317 + if ( ! $result ) {
1318 +
1319 + $adb->new_record( $pseudonym, { type => 'pseudonym',
1320 + Account => $account} )
1321 + or $result .= "Error occurred while creating pseudonym in database.";
1322 +
1323 + # Untaint $pseudonym before use in system()
1324 + ($pseudonym) = ($pseudonym =~ /(.+)/);
1325 + system( "/sbin/e-smith/signal-event", "pseudonym-create", "$pseudonym",)
1326 + == 0 or $result .= 'pse_CREATE_ERROR.';
1327 +
1328 + }
1329 +
1330 + if ( ! $result ) {
1331 + $result = $c->l('pse_CREATE_SUCCEEDED') . ' ' . $pseudonym;
1332 + $trt = 'SUC';
1333 + }
1334 + }
1335 +
1336 + if ( $trt eq 'UPD' ) {
1337 +
1338 + my $account = $c->param('Account');
1339 + my $internal = $c->param ('Internal') || 'NO';
1340 + my $removable = $adb->get($pseudonym)->prop('Removable') || 'yes';
1341 +
1342 + my %props = ('Account' => $account);
1343 +
1344 + if ($removable eq 'yes') {
1345 + if ($internal eq "YES") { $props{'Visible'} = 'internal'; }
1346 + else { $adb->get($pseudonym)->delete_prop('Visible'); }
1347 + }
1348 +
1349 + # controls
1350 + #my $res = '';
1351 + #$res = validate_description( $c, $account );
1352 + #$result .= $res unless $res eq 'OK';
1353 +
1354 + #$result .= 'blocked';
1355 +
1356 + if ( ! $result ) {
1357 +
1358 + $adb->get($pseudonym)->merge_props(%props)
1359 + or $result .= "Error occurred while modifying pseudonym in database.";
1360 +
1361 + # Untaint $pseudonym before use in system()
1362 + ($pseudonym) = ($pseudonym =~ /(.+)/);
1363 + system( "/sbin/e-smith/signal-event", "pseudonym-modify", "$pseudonym",)
1364 + == 0 or $result .= "Error occurred while modifying pseudonym.";
1365 +
1366 + }
1367 +
1368 + if ( ! $result ) {
1369 + $result = $c->l('pse_MODIFY_SUCCEEDED') . ' ' . $pseudonym;
1370 + $trt = 'SUC';
1371 + }
1372 + }
1373 +
1374 +
1375 + if ( $trt eq 'DEL' ) {
1376 +
1377 + # controls
1378 + my $res = '';
1379 + $res = validate_is_pseudonym($c, $pseudonym);
1380 + $result .= $res unless $res eq 'OK';
1381 +
1382 + #$result .= 'blocked';
1383 +
1384 + if ( ! $result ) {
1385 + my $res = delete_pseudonym( $c, $pseudonym );
1386 + $result .= $res unless $res eq 'OK';
1387 + if ( ! $result ) {
1388 + $result = $c->l('pse_REMOVE_SUCCEEDED') . ' ' . $pseudonym;
1389 + $trt = 'SUC';
1390 + }
1391 + }
1392 + }
1393 +
1394 + my $title = $c->l('pse_FORM_TITLE');
1395 + $pse_datas{'pseudonym'} = $pseudonym;
1396 + $pse_datas{'trt'} = $trt;
1397 +
1398 +# $c->stash( title => $title, notif => $result );
1399 +# $c->render(template => 'module');
1400 + $c->stash( title => $title, notif => $result, pse_datas => \%pse_datas );
1401 + if ($pse_datas{trt} ne 'SUC') {
1402 + return $c->render(template => 'pseudonyms');
1403 + }
1404 + $c->redirect_to('/pseudonyms');
1405 +
1406 +
1407 +};
1408 +
1409 +
1410 +sub delete_pseudonym {
1411 +
1412 + my ($c, $pseudonym) = @_;
1413 +
1414 + my $msg = '';
1415 + #------------------------------------------------------------
1416 + # Make the pseudonym inactive, signal pseudonym-delete event
1417 + # and then delete it
1418 + #------------------------------------------------------------
1419 +
1420 + my @pseudonyms = $adb->pseudonyms();
1421 +
1422 + foreach my $p_rec (@pseudonyms) {
1423 + if ($p_rec->prop("Account") eq $pseudonym) {
1424 + $adb->get($p_rec->key)->set_prop('type','pseudonym-deleted')
1425 + or $msg .= "Error occurred while changing pseudonym type.";
1426 + }
1427 + }
1428 +
1429 + $adb->get($pseudonym)->set_prop('type','pseudonym-deleted')
1430 + or $msg .= "Error occurred while changing pseudonym type.";
1431 +
1432 + # Untaint $pseudonym before use in system()
1433 + ($pseudonym) = ($pseudonym =~ /(.+)/);
1434 + system( "/sbin/e-smith/signal-event", "pseudonym-delete", "$pseudonym") == 0
1435 + or $msg .= "Error occurred while removing pseudonym.";
1436 +
1437 + #TODO: is it ->delete or get()->delete
1438 + foreach my $p_rec (@pseudonyms) {
1439 + if ($p_rec->prop("Account") eq $pseudonym) {
1440 + $adb->get($p_rec->key)->delete()
1441 + or $msg .= "Error occurred while deleting pseudonym from database.";
1442 + }
1443 + }
1444 +
1445 + $adb->get($pseudonym)->delete()
1446 + or $msg .= "Error occurred while deleting pseudonym from database.";
1447 +
1448 + return $msg unless $msg;
1449 +
1450 + return 'OK';
1451 +}
1452 +
1453 +
1454 +
1455 +sub existing_accounts_list {
1456 + my $c = shift;
1457 +
1458 + my @existingAccounts = ( ['Administrator' => 'admin']);
1459 +
1460 + foreach my $a ($adb->get_all) {
1461 + if ($a->prop('type') =~ /(user|group)/) {
1462 + push @existingAccounts, [ $a->key => $a->key ];
1463 + }
1464 + if ($a->prop('type') eq "pseudonym") {
1465 + my $target = $adb->get($a->prop('Account'));
1466 +
1467 + unless ($target)
1468 + {
1469 + warn "WARNING: pseudonym (" . $a->key . ") => missing Account("
1470 + . $a->prop('Account') . ")\n";
1471 + next;
1472 + }
1473 +
1474 + push @existingAccounts, [ $a->key, $a->key ]
1475 + unless ($target->prop('type') eq "pseudonym");
1476 + }
1477 + }
1478 +
1479 + return(\@existingAccounts);
1480 +}
1481 +
1482 +
1483 +=head2 get_pseudonym_account
1484 +
1485 +Returns the current Account property for this pseudonym
1486 +
1487 +=cut
1488 +
1489 +sub get_pseudonym_account {
1490 + my $c = shift;
1491 + my $pseudonym = shift;
1492 +
1493 + my $a = $adb->get($pseudonym)->prop('Account');
1494 + if ($a eq "admin") {
1495 + $a = "Administrator";
1496 + } elsif ($a eq "shared") {
1497 + $a = $c->l("EVERYONE");
1498 + }
1499 + return($a);
1500 +}
1501 +
1502 +=head2 is_pseudonym_not_removable
1503 +
1504 +Returns 1 if the current Account is not removable, 0 otherwise
1505 +
1506 +=cut
1507 +
1508 +sub is_pseudonym_not_removable {
1509 + my $c = shift;
1510 + my $pseudonym = shift;
1511 +
1512 + my $removable = $adb->get($pseudonym)->prop('Removable') || 'yes';
1513 + return 1 if ($removable eq 'yes');
1514 + return 0;
1515 +}
1516 +
1517 +=head2 is_pseudonym_internal
1518 +
1519 +Returns YES if the current Account property Visible is 'internal'
1520 +
1521 +=cut
1522 +
1523 +sub is_pseudonym_internal {
1524 +# my $c = shift;
1525 + my $pseudonym = shift;
1526 +
1527 + my $visible = $adb->get($pseudonym)->prop('Visible') || '';
1528 + return 'YES' if ($visible eq 'internal');
1529 + return 'NO';
1530 +}
1531 +
1532 +=head2 validate_new_pseudonym_name FM PSEUDONYM
1533 +
1534 +Returns "OK" if the pseudonym starts with a letter or number and
1535 +contains only letters, numbers, . - and _ and isn't taken
1536 +
1537 +Returns "VALID_PSEUDONYM_NAMES" if the name contains invalid chars
1538 +
1539 +Returns "NAME_IN_USE" if this pseudonym is taken.
1540 +
1541 +=cut
1542 +
1543 +sub validate_new_pseudonym_name {
1544 +
1545 + my ($c, $pseudonym, $account) = @_;
1546 +
1547 + my $acct = $adb->get($pseudonym);
1548 + if (defined $acct) {
1549 + return($c->l('pse_NAME_IN_USE'));
1550 + }
1551 + elsif ($pseudonym =~ /@/)
1552 + {
1553 + use esmith::DomainsDB;
1554 +
1555 + my $ddb = esmith::DomainsDB->open_ro
1556 + or die "Couldn't open DomainsDB\n";
1557 +
1558 + my ($lhs, $rhs) = split /@/, $pseudonym;
1559 +
1560 + return ($c->l('pse_PSEUDONYM_INVALID_DOMAIN')) unless ($ddb->get($rhs));
1561 +
1562 + return ($c->l('pse_PSEUDONYM_INVALID_SAMEACCT'))
1563 + if ($lhs eq $account);
1564 +
1565 + return ('OK p:' . $pseudonym . ' a:' . $account);
1566 + }
1567 + elsif ( $pseudonym !~ /^([a-z0-9][a-z0-9\.\-_!#\?~\$\^\+&`%\/\*]*)$/ )
1568 + {
1569 + return($c->l('pse_VALID_PSEUDONYM_NAMES'));
1570 + }
1571 + else {
1572 + return('OK');
1573 + }
1574 +}
1575 +
1576 +
1577 +=head2 validate_is_pseudonym FM NAME
1578 +
1579 +returns "OK" if it is.
1580 +returns "NOT_A_PSEUDONYM" if the name in question isn't an existing pseudonym
1581 +
1582 +=cut
1583 +
1584 +sub validate_is_pseudonym {
1585 + my $c = shift;
1586 + my $pseudonym = shift;
1587 +
1588 + $pseudonym = $adb->get($pseudonym);
1589 + return($c->l('pse_NOT_A_PSEUDONYM')) unless $pseudonym;
1590 +
1591 + my $type = $pseudonym->prop('type');
1592 + unless (defined $type && ($type eq 'pseudonym') ) {
1593 + return($c->l('NOT_A_PSEUDONYM'));
1594 + }
1595 +
1596 + return ('OK');
1597 +}
1598 +
1599 +
1600 +1;
1601 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
1602 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm 2020-01-24 18:57:31.000000000 +0400
1603 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm 2020-02-19 22:26:13.000000000 +0400
1604 @@ -2,55 +2,46 @@
1605
1606 use strict;
1607 use warnings;
1608 -
1609 use Mojo::Base 'Mojolicious::Controller';
1610
1611 -use SrvMngr qw(theme_list init_session_cgi);
1612 -
1613 -use esmith::AccountsDB qw(open_ro);
1614 -use esmith::ConfigDB qw(open_ro);
1615 +use Locale::gettext;
1616 +use SrvMngr::I18N;
1617
1618 -#use Locale::gettext;
1619 -#use SrvMngr::I18N;
1620 +use SrvMngr qw(theme_list init_session_cgi);
1621
1622 -# retrieve a configuration db record, both simple (DomainName) or complex (InternalIntefrace), given its name
1623 -sub getconfig {
1624 +# retrieve a configuration db record
1625 +sub config {
1626 my $c = shift;
1627 -# $c -> res -> headers -> header('Access-Control-Allow-Origin' => '*');
1628
1629 - my $dbc = esmith::ConfigDB -> open_ro;
1630 - my $key = $c -> param('key');
1631 + my $key = $c->param('key');
1632 if ($key) {
1633 - my $r = $dbc -> get($key);
1634 - $c -> render(json => {
1635 - $key => {
1636 - $r -> props
1637 - }
1638 - })
1639 - } else {
1640 - $c -> render( text => 'error');
1641 + use esmith::ConfigDB qw(open_ro);
1642 + my $cdb = esmith::ConfigDB->open_ro;
1643 + return getdb( $c, $cdb, $key);
1644 }
1645 -};
1646 +}
1647
1648
1649 # retrieve an accounts db record, given its name
1650 -# we use a relaxed placeholder because keys can have a dot inside
1651 -sub getaccount {
1652 +sub account {
1653 my $c = shift;
1654 -# $c -> res -> headers -> header('Access-Control-Allow-Origin' => '*');
1655
1656 - my $dba = esmith::AccountsDB -> open_ro;
1657 - my $key = $c -> param('key');
1658 + my $key = $c->param('key');
1659 if ($key) {
1660 - my $r = $dba -> get($key);
1661 - $c -> render(json => {
1662 - $key => {
1663 - $r -> props
1664 - }
1665 - })
1666 - } else {
1667 - $c -> render( text => 'error');
1668 + use esmith::AccountsDB qw(open_ro);
1669 + my $adb = esmith::Accounts->open_ro;
1670 + return getdb( $c, $adb, $key);
1671 + }
1672 +}
1673 +
1674 +
1675 +sub getdb {
1676 + my ($c, $db, $key) = @_;
1677 +
1678 + if ( my $rec = $db->get($key) ) {
1679 + return $c->render(json => { $key => { $rec->props }} );
1680 }
1681 + return undef;
1682 }
1683
1684
1685 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm
1686 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm 2020-01-24 18:57:52.000000000 +0400
1687 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm 2020-02-02 20:59:44.000000000 +0400
1688 @@ -6,23 +6,18 @@
1689
1690 use SrvMngr qw(theme_list init_session_cgi);
1691
1692 -#use esmith::config;
1693 -#use esmith::NavigationDB;
1694 use esmith::util;
1695 -#use esmith::I18N;
1696
1697
1698 -sub display_licenses
1699 -{
1700 +sub display_licenses {
1701 +
1702 my $lang = shift;
1703
1704 - #print "<TR><TD><PRE>\n";
1705 my $lic = '';
1706 - foreach my $license (esmith::util::getLicenses($lang))
1707 - {
1708 + foreach my $license (esmith::util::getLicenses($lang)) {
1709 +
1710 $lic .= $license . '<br>';
1711 }
1712 - #print "</PRE></TD></TR>\n";
1713 return $lic;
1714 }
1715
1716 @@ -30,15 +25,10 @@
1717 my $c = shift;
1718 $c->app->log->info($c->log_req);
1719
1720 - esmith::util::setRealToEffective();
1721 -
1722 my $title = $c->l('support_FORM_TITLE');
1723 my $modul = $c->render_to_string(inline => display_licenses($c->session->{lang}));
1724
1725 - $c->stash( releaseVersion => $c->session->{releaseVersion}, copyRight => $c->session->{copyRight},
1726 - PwdSet => $c->session->{PwdSet}, Unsafe => $c->session->{Unsafe}, navigation => $c->session->{navigation},
1727 - title => $title, modul => $modul);
1728 -
1729 + $c->stash( title => $title, modul => $modul );
1730 $c->render(template => 'module');
1731 };
1732
1733 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm
1734 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm 2020-01-24 18:56:46.000000000 +0400
1735 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm 2020-02-02 21:00:20.000000000 +0400
1736 @@ -10,24 +10,16 @@
1737
1738 use SrvMngr qw(theme_list init_session_cgi);
1739
1740 -use SrvMngr::Navigation2;
1741
1742 -
1743 -#page d'accueil
1744 sub main {
1745 my $c = shift;
1746
1747 - $c->app->log->info("Appel de la page d'accueil.");
1748 $c->app->log->info($c->log_req);
1749
1750 my $title = 'Welcome page';
1751 + my $modul .= ' Welcome ';
1752
1753 - my $modul .= ' Welcome result is 10 + 33.';
1754 -
1755 - my %nav = ();
1756 - #%{SrvMngr::Navigation2->getNavigation( $c->languages() )};
1757 -
1758 - $c->stash( title => $title, modul => $modul, navig => \%nav );
1759 + $c->stash( title => $title, modul => $modul );
1760
1761 $c->render(template => 'welcome');
1762 }
1763 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
1764 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm 2020-01-27 00:07:35.000000000 +0400
1765 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm 2020-02-16 00:27:54.000000000 +0400
1766 @@ -12,7 +12,6 @@
1767 cancel => 'Cancel',
1768 hello => 'hello',
1769 'All rights reserved' => 'All Rights Reserved',
1770 -
1771 'Collaboration' => 'Collaboration',
1772 'Administration' => 'Administration',
1773 'Security' => 'Security',
1774 @@ -42,8 +41,7 @@
1775 'GROUP' => 'Group',
1776 'DESC_SECTIONBAR' => '<hr class="sectionbar"/>',
1777 'NO_PIPES_ALLOWED' => 'Pipe symbols (|) are not permitted in this field',
1778 -'ERROR_BELOW' => '
1779 -ERROR: There was an error in the validation of this page. Please
1780 +'ERROR_BELOW' => 'ERROR: There was an error in the validation of this page. Please
1781 scroll down and find the specific problem.',
1782 'ACCESS' => 'Access',
1783 'ACCOUNT_LOCKED' => 'Account is locked',
1784 @@ -244,180 +242,19 @@
1785 </p>
1786 ',
1787 'sws_LABEL_COMPANYNAME' => 'Company name',
1788 -'sws_DESC_HEADER1' => '
1789 -First header, typically used for short phrases such
1790 -as "Leader in the field of textile manufacturing"
1791 -',
1792 -'sws_DESC_TEXT1' =>
1793 -'
1794 -Text following first header, typically used for a
1795 -paragraph of marketing information.
1796 -',
1797 -'sws_DESC_HEADER2' =>
1798 -'
1799 -Second header, typically used for short phrases such
1800 -as "For more information" or "To order our products":
1801 -',
1802 -'sws_DESC_TEXT2' =>
1803 -'
1804 -Text following second header, typically used for contact
1805 -or ordering information:
1806 -',
1807 -'sws_DESC_SUBMIT' =>
1808 -'
1809 -<p>When you create this web page, the file
1810 +'sws_DESC_HEADER1' => 'First header, typically used for short phrases such
1811 +as "Leader in the field of textile manufacturing"',
1812 +'sws_DESC_TEXT1' => 'Text following first header, typically used for a
1813 +paragraph of marketing information.',
1814 +'sws_DESC_HEADER2' => 'Second header, typically used for short phrases such
1815 +as "For more information" or "To order our products":',
1816 +'sws_DESC_TEXT2' => 'Text following second header, typically used for contact
1817 +or ordering information:',
1818 +'sws_DESC_SUBMIT' => '<p>When you create this web page, the file
1819 "index.htm" will be overwritten
1820 in your web site directory.</p>
1821 -<p>Do you wish to proceed?</p>
1822 -',
1823 -'sws_Create starter web site' =>
1824 -'Create starter web site',
1825 -
1826 -'bugr_FORM_TITLE' => 'Report a Bug',
1827 -'bugr_DO_NOT_PANIC' => 'Don\'t Panic!',
1828 -'bugr_SME_EXPERIENCE' =>
1829 -'Unfortunately there is no software without bugs, and you probably came to this page because of an issue you are experiencing with your SME-server installation.',
1830 -'bugr_PLEASE_REPORT_HERE' =>
1831 -'In order to help developers to diagnose and fix your issue, please download one of the following text templates, fill it out and paste it into your bug report at',
1832 -'bugr_USE_TEMPLATE' =>
1833 -'Please refer to the following link on how to report efficiency a bug and use its template',
1834 -'bugr_FOLLOWING_REPORT_MIGHT_HELP' =>
1835 -'It will also help if you provide some vital information on the configuration of your SME-server in your bug report. By clicking on the "Create configuration report" button below, you can create and download a text file containing this information. Please attach this file to your bug report as well.',
1836 -'bugr_REPORT_CONTENT' =>
1837 -'The report will contain the following information',
1838 -'bugr_SME_VERSION' =>
1839 -'Koozali SME Server version',
1840 -'bugr_SERVER_MODE' => 'Server mode',
1841 -'bugr_KERNEL_AND_ARCH' => 'Current running kernel version and architecture',
1842 -'bugr_INSTALLED_RPMS' => 'A list of additional RPMs installed on your server',
1843 -'bugr_ALTERED_TEMPLATES' => 'A list of SME templates that have been altered on your server from a base install',
1844 -'bugr_ALTERED_EVENTS' => 'A list of SME events that have been altered on your server from a base install',
1845 -'bugr_YUM_REPOS' => 'A list of additional software repositories configured on your server',
1846 -'bugr_PRIVACY' => 'No privacy related data (ie. users, passwords, IP addresses) will be included in the report.',
1847 -'bugr_CREATE_REPORT' => 'Create configuration report',
1848 -'bugr_DONATING' => 'Have you considered donating?',
1849 -'bugr_AWARE_SME' => 'You are probaly aware that SME server is developed and supported by a collaborative community of volunteers from all over the world. While SME server is free to download and use, maintaining the infrastructure behind the project (eg. hosting the forums and wiki, providing repositories and build servers etc.) costs real money in the real world.',
1850 -'bugr_YOUR_HELP' => 'In very much the same way you need us to address your current issue, we need YOUR help to keep this project alive!',
1851 -'bugr_CONSIDER_DONATING' => 'Please consider donating to the project by clicking on the image link below:',
1852 -'bugr_THANK_YOU' => 'Thank you for your support!',
1853 -'bugr_Download this report' => 'Download this report !',
1854 -'bugr_Report a bug' => 'Report a bug',
1855 -
1856 -'rvw_FORM_TITLE' => 'Review configuration',
1857 -'rvw_DESCRIPTION' => 'This report summarizes the networking, server, and domain
1858 -parameters on this server relevant to configuring
1859 -the client computers on your network.You may wish to print this
1860 -page and use it as a reference.',
1861 -'rvw_NETWORKING_PARAMS' => 'Networking Parameters',
1862 -'rvw_SERVER_MODE' => 'Server Mode',
1863 -'rvw_LOCAL_IP_ADDRESS_SUBNET_MASK' => 'Local IP address / subnet mask',
1864 -'rvw_EXTERNAL_IP_ADDRESS_SUBNET_MASK' => 'External IP address / subnet mask',
1865 -'rvw_GATEWAY' => 'Gateway',
1866 -'rvw_ADDITIONAL_LOCAL_NETWORKS' => 'Additional local networks',
1867 -'rvw_DHCP_SERVER' => 'DHCP server',
1868 -'rvw_BEGINNING_OF_DHCP_ADDRESS_RANGE' => 'Beginning of DHCP address range',
1869 -'rvw_END_OF_DHCP_ADDRESS_RANGE' => 'End of DHCP address range',
1870 -'rvw_SERVER_NAMES' => 'Server names',
1871 -'rvw_DNS_SERVER' => 'DNS server',
1872 -'rvw_WEB_SERVER' => 'Web server',
1873 -'rvw_PROXY_SERVER' => 'Proxy server',
1874 -'rvw_FTP_SERVER' => 'FTP server',
1875 -'rvw_SMTP_POP_AND_IMAP_MAIL_SERVERS' => 'SMTP, POP, and IMAP mail servers',
1876 -'rvw_HOSTS' => 'Hosts',
1877 -'rvw_DOMAIN_INFORMATION' => 'Domain information',
1878 -'rvw_PRIMARY_DOMAIN' => 'Primary domain',
1879 -'rvw_VIRTUAL_DOMAINS' => 'Virtual domains',
1880 -'rvw_PRIMARY_WEB_SITE' => 'Primary web site',
1881 -'rvw_SERVER_MANAGER' => 'Server manager',
1882 -'rvw_USER_PASSWORD_PANEL' => 'User password panel',
1883 -'rvw_EMAIL_ADDRESSES' => 'Email Addresses',
1884 -'rvw_EMAIL_USERACCOUNT' => 'useraccount',
1885 -'rvw_EMAIL_FIRSTNAME' => 'firstname',
1886 -'rvw_EMAIL_LASTNAME' => 'lastname',
1887 -'rvw_NO_VIRTUAL_DOMAINS' => 'No virtual domains defined',
1888 -'rvw_NO_NETWORKS' => 'No additional networks defined',
1889 -'rvw_INTERNET_VISIBLE_ADDRESS' => 'Internet Visible IP Address',
1890 -
1891 -'dir_FORM_TITLE' => 'Change LDAP directory settings',
1892 -'dir_LABEL_ROOT' => 'Server root',
1893 -'dir_DESCRIPTION' => 'The LDAP server provides a network-available listing of the user accounts
1894 -and groups on your server, and can be accessed using an LDAP client such as the Address Book feature in Netscape Communicator. Configure your LDAP client with the local IP address of your server, port number 389, and the server root parameter shown below.
1895 -',
1896 -'dir_DESC_DIRECTORY_ACCESS' => ' You can control access to your LDAP directory: the private setting allows access only from your local network, and the public setting allows access from anywhere on the Internet. ',
1897 -'dir_DIRECTORY_ACCESS' => 'LDAP directory access',
1898 -'dir_DESC_DEPARTMENT' => 'These fields are the LDAP defaults for your organization.
1899 -Whenever you create a new user account, you will be prompted
1900 -to enter all of these fields (they can be different for each
1901 -user) but the values you set here
1902 -will show up as defaults. This is a convenience to make it
1903 -faster to create user accounts.',
1904 -'dir_DEPARTMENT' => 'Default department',
1905 -'dir_COMPANY' => 'Default company',
1906 -'dir_STREET' => 'Default Street address',
1907 -'dir_CITY' => 'Default City',
1908 -'dir_PHONENUMBER' => 'Default Phone Number',
1909 -'dir_DESC_EXISTING' => 'You can either leave existing user accounts as they are, using the above defaults only for
1910 -new users, or you can apply the above defaults to all existing users as well.',
1911 -'dir_EXISTING' => 'Existing users',
1912 -'dir_SUCCESS' => 'The new LDAP default settings have been saved.',
1913 -'dir_LEAVE' => 'Leave as they are',
1914 -'dir_UPDATE' => 'Update with new defaults',
1915 -'dir_Directory' => 'Directory',
1916 -
1917 -'prx_TITLE' => 'Proxy settings',
1918 -'prx_FIRST_PAGE_DESCRIPTION' => 'This page allows configuration of the server\'s
1919 -proxy settings.
1920 -The server includes a transparent proxy and cache for
1921 -HTTP traffic. This is enabled by default, but not enforced
1922 -if the server is in &quot;serveronly&quot; mode.
1923 -If this server is acting as an e-mail server, connections
1924 -from local network clients to external SMTP servers
1925 -will default to being redirected to the local e-mail server.',
1926 -'prx_HTTP_PROXY_STATUS_DESCRIPTION' => 'The server\'s HTTP proxy works to reduce overall uplink usage by
1927 -caching recently-visited pages. It is transparent to web browsers
1928 -using this server as their gateway. Enable or disable this proxy
1929 -with the following toggle.',
1930 -'prx_HTTP_PROXY_STATUS_LABEL' => 'HTTP proxy status',
1931 -'prx_SMTP_PROXY_STATUS_DESCRIPTION' => 'The server\'s transparent SMTP proxy works to reduce virus traffic
1932 -from infected client hosts by forcing all outgoing SMTP traffic
1933 -through this server if set to "enabled".
1934 -If you wish to use an alternate SMTP server, and this server is
1935 -your gateway to it, set this proxy to "disabled". Setting the
1936 -proxy to "blocked" prevents all SMTP traffic to other servers,
1937 -this is the default. The proxy only intercepts/blocks normal smtp
1938 -(port 25) traffic.',
1939 -'prx_SMTP_PROXY_STATUS_LABEL' => 'SMTP proxy status',
1940 -'prx_ERR_PROXY_UPDATE_FAILED' => 'ERROR: The proxy-update event returned an error.',
1941 -'prx_ERR_NO_SQUID_REC' => 'ERROR: There is no squid record in the configuration database.',
1942 -'prx_SUCCESS' => 'The new proxy settings were applied successfully.',
1943 -'prx_BLOCKED' => 'Blocked',
1944 -
1945 -'qma_FORM_TITLE' => 'Mail Log File Analysis',
1946 -'qma_INITIAL_DESC' => '<P>Analysing the mail system log files can aid both in
1947 -understanding how your system is performing and in
1948 -diagnosing delivery problems. Several different
1949 -reports are available.</P>
1950 -<P>Please note that it may take several minutes to generate
1951 -these reports</P>',
1952 -'qma_REPORT_TYPE' => 'Choose a report type',
1953 -'qma_GENERATE_REPORT' => 'Generate report',
1954 -'qma_LIST_OUTGOING' => 'List outgoing messages and recipients',
1955 -'qma_SUMMARIZE_QUEUE' => 'Summarize status of mail queue',
1956 -'qma_SUCCESSFUL_DELIVERY_DELAY' => 'Successful delivery delay distribution',
1957 -'qma_REASONS_DEFERRAL' => 'Reasons for deferral',
1958 -'qma_REASONS_FAILURE' => 'Reasons for failure',
1959 -'qma_BASIC_STATS' => 'Basic statistics',
1960 -'qma_RECIP_STATS' => 'Recipients statistics',
1961 -'qma_RECIP_HOSTS' => 'Recipient hosts',
1962 -'qma_RECIP_ORDERED' => 'Recipients in best order for mailing lists',
1963 -'qma_SENDER_STATS' => 'Sender statistics',
1964 -'qma_SENDMAIL_STYLE' => 'Sendmail style log',
1965 -'qma_REASONS_SUCCESS' => 'Reasons for success',
1966 -'qma_SENDER_UIDS' => 'Sender uids',
1967 -'qma_INVALID_REPORT_TYPE' => 'Invalid report type: ',
1968 -'qma_REPORT_GENERATED' => 'Report generated: ',
1969 -'qma_END_OF_REPORT' => 'End of Report',
1970 -'qma_Mail log file analysis' => 'Mail log file analysis',
1971 +<p>Do you wish to proceed?</p>',
1972 +'sws_Create starter web site' => 'Create starter web site',
1973
1974 'clm_FORM_TITLE' => 'Antivirus settings',
1975 'clm_LABEL_FILESYSTEM_SCAN_PERIOD' => 'Scan filesystem',
1976 @@ -612,6 +449,152 @@
1977 'prt_MUST_BE_VALID_HOSTNAME_OR_IP' => 'Must be a valid hostname or IP number',
1978 'prt_Printers' => 'Printers',
1979
1980 +'bugr_FORM_TITLE' => 'Report a Bug',
1981 +'bugr_DO_NOT_PANIC' => 'Don\'t Panic!',
1982 +'bugr_SME_EXPERIENCE' =>
1983 +'Unfortunately there is no software without bugs, and you probably came to this page because of an issue you are experiencing with your SME-server installation.',
1984 +'bugr_PLEASE_REPORT_HERE' =>
1985 +'In order to help developers to diagnose and fix your issue, please download one of the following text templates, fill it out and paste it into your bug report at',
1986 +'bugr_USE_TEMPLATE' =>
1987 +'Please refer to the following link on how to report efficiency a bug and use its template',
1988 +'bugr_FOLLOWING_REPORT_MIGHT_HELP' =>
1989 +'It will also help if you provide some vital information on the configuration of your SME-server in your bug report. By clicking on the "Create configuration report" button below, you can create and download a text file containing this information. Please attach this file to your bug report as well.',
1990 +'bugr_REPORT_CONTENT' =>
1991 +'The report will contain the following information',
1992 +'bugr_SME_VERSION' =>
1993 +'Koozali SME Server version',
1994 +'bugr_SERVER_MODE' => 'Server mode',
1995 +'bugr_KERNEL_AND_ARCH' => 'Current running kernel version and architecture',
1996 +'bugr_INSTALLED_RPMS' => 'A list of additional RPMs installed on your server',
1997 +'bugr_ALTERED_TEMPLATES' => 'A list of SME templates that have been altered on your server from a base install',
1998 +'bugr_ALTERED_EVENTS' => 'A list of SME events that have been altered on your server from a base install',
1999 +'bugr_YUM_REPOS' => 'A list of additional software repositories configured on your server',
2000 +'bugr_PRIVACY' => 'No privacy related data (ie. users, passwords, IP addresses) will be included in the report.',
2001 +'bugr_CREATE_REPORT' => 'Create configuration report',
2002 +'bugr_DONATING' => 'Have you considered donating?',
2003 +'bugr_AWARE_SME' => 'You are probaly aware that SME server is developed and supported by a collaborative community of volunteers from all over the world. While SME server is free to download and use, maintaining the infrastructure behind the project (eg. hosting the forums and wiki, providing repositories and build servers etc.) costs real money in the real world.',
2004 +'bugr_YOUR_HELP' => 'In very much the same way you need us to address your current issue, we need YOUR help to keep this project alive!',
2005 +'bugr_CONSIDER_DONATING' => 'Please consider donating to the project by clicking on the image link below:',
2006 +'bugr_THANK_YOU' => 'Thank you for your support!',
2007 +'bugr_Download this report' => 'Download this report !',
2008 +'bugr_Report a bug' => 'Report a bug',
2009 +
2010 +'rvw_FORM_TITLE' => 'Review configuration',
2011 +'rvw_DESCRIPTION' => 'This report summarizes the networking, server, and domain
2012 +parameters on this server relevant to configuring
2013 +the client computers on your network.You may wish to print this
2014 +page and use it as a reference.',
2015 +'rvw_NETWORKING_PARAMS' => 'Networking Parameters',
2016 +'rvw_SERVER_MODE' => 'Server Mode',
2017 +'rvw_LOCAL_IP_ADDRESS_SUBNET_MASK' => 'Local IP address / subnet mask',
2018 +'rvw_EXTERNAL_IP_ADDRESS_SUBNET_MASK' => 'External IP address / subnet mask',
2019 +'rvw_GATEWAY' => 'Gateway',
2020 +'rvw_ADDITIONAL_LOCAL_NETWORKS' => 'Additional local networks',
2021 +'rvw_DHCP_SERVER' => 'DHCP server',
2022 +'rvw_BEGINNING_OF_DHCP_ADDRESS_RANGE' => 'Beginning of DHCP address range',
2023 +'rvw_END_OF_DHCP_ADDRESS_RANGE' => 'End of DHCP address range',
2024 +'rvw_SERVER_NAMES' => 'Server names',
2025 +'rvw_DNS_SERVER' => 'DNS server',
2026 +'rvw_WEB_SERVER' => 'Web server',
2027 +'rvw_PROXY_SERVER' => 'Proxy server',
2028 +'rvw_FTP_SERVER' => 'FTP server',
2029 +'rvw_SMTP_POP_AND_IMAP_MAIL_SERVERS' => 'SMTP, POP, and IMAP mail servers',
2030 +'rvw_HOSTS' => 'Hosts',
2031 +'rvw_DOMAIN_INFORMATION' => 'Domain information',
2032 +'rvw_PRIMARY_DOMAIN' => 'Primary domain',
2033 +'rvw_VIRTUAL_DOMAINS' => 'Virtual domains',
2034 +'rvw_PRIMARY_WEB_SITE' => 'Primary web site',
2035 +'rvw_SERVER_MANAGER' => 'Server manager',
2036 +'rvw_USER_PASSWORD_PANEL' => 'User password panel',
2037 +'rvw_EMAIL_ADDRESSES' => 'Email Addresses',
2038 +'rvw_EMAIL_USERACCOUNT' => 'useraccount',
2039 +'rvw_EMAIL_FIRSTNAME' => 'firstname',
2040 +'rvw_EMAIL_LASTNAME' => 'lastname',
2041 +'rvw_NO_VIRTUAL_DOMAINS' => 'No virtual domains defined',
2042 +'rvw_NO_NETWORKS' => 'No additional networks defined',
2043 +'rvw_INTERNET_VISIBLE_ADDRESS' => 'Internet Visible IP Address',
2044 +
2045 +'dir_FORM_TITLE' => 'Change LDAP directory settings',
2046 +'dir_LABEL_ROOT' => 'Server root',
2047 +'dir_DESCRIPTION' => 'The LDAP server provides a network-available listing of the user accounts
2048 +and groups on your server, and can be accessed using an LDAP client such as the Address Book feature in Netscape Communicator. Configure your LDAP client with the local IP address of your server, port number 389, and the server root parameter shown below.
2049 +',
2050 +'dir_DESC_DIRECTORY_ACCESS' => ' You can control access to your LDAP directory: the private setting allows access only from your local network, and the public setting allows access from anywhere on the Internet. ',
2051 +'dir_DIRECTORY_ACCESS' => 'LDAP directory access',
2052 +'dir_DESC_DEPARTMENT' => 'These fields are the LDAP defaults for your organization.
2053 +Whenever you create a new user account, you will be prompted
2054 +to enter all of these fields (they can be different for each
2055 +user) but the values you set here
2056 +will show up as defaults. This is a convenience to make it
2057 +faster to create user accounts.',
2058 +'dir_DEPARTMENT' => 'Default department',
2059 +'dir_COMPANY' => 'Default company',
2060 +'dir_STREET' => 'Default Street address',
2061 +'dir_CITY' => 'Default City',
2062 +'dir_PHONENUMBER' => 'Default Phone Number',
2063 +'dir_DESC_EXISTING' => 'You can either leave existing user accounts as they are, using the above defaults only for
2064 +new users, or you can apply the above defaults to all existing users as well.',
2065 +'dir_EXISTING' => 'Existing users',
2066 +'dir_SUCCESS' => 'The new LDAP default settings have been saved.',
2067 +'dir_LEAVE' => 'Leave as they are',
2068 +'dir_UPDATE' => 'Update with new defaults',
2069 +'dir_Directory' => 'Directory',
2070 +
2071 +'prx_TITLE' => 'Proxy settings',
2072 +'prx_FIRST_PAGE_DESCRIPTION' => 'This page allows configuration of the server\'s
2073 +proxy settings.
2074 +The server includes a transparent proxy and cache for
2075 +HTTP traffic. This is enabled by default, but not enforced
2076 +if the server is in &quot;serveronly&quot; mode.
2077 +If this server is acting as an e-mail server, connections
2078 +from local network clients to external SMTP servers
2079 +will default to being redirected to the local e-mail server.',
2080 +'prx_HTTP_PROXY_STATUS_DESCRIPTION' => 'The server\'s HTTP proxy works to reduce overall uplink usage by
2081 +caching recently-visited pages. It is transparent to web browsers
2082 +using this server as their gateway. Enable or disable this proxy
2083 +with the following toggle.',
2084 +'prx_HTTP_PROXY_STATUS_LABEL' => 'HTTP proxy status',
2085 +'prx_SMTP_PROXY_STATUS_DESCRIPTION' => 'The server\'s transparent SMTP proxy works to reduce virus traffic
2086 +from infected client hosts by forcing all outgoing SMTP traffic
2087 +through this server if set to "enabled".
2088 +If you wish to use an alternate SMTP server, and this server is
2089 +your gateway to it, set this proxy to "disabled". Setting the
2090 +proxy to "blocked" prevents all SMTP traffic to other servers,
2091 +this is the default. The proxy only intercepts/blocks normal smtp
2092 +(port 25) traffic.',
2093 +'prx_SMTP_PROXY_STATUS_LABEL' => 'SMTP proxy status',
2094 +'prx_ERR_PROXY_UPDATE_FAILED' => 'ERROR: The proxy-update event returned an error.',
2095 +'prx_ERR_NO_SQUID_REC' => 'ERROR: There is no squid record in the configuration database.',
2096 +'prx_SUCCESS' => 'The new proxy settings were applied successfully.',
2097 +'prx_BLOCKED' => 'Blocked',
2098 +
2099 +'qma_FORM_TITLE' => 'Mail Log File Analysis',
2100 +'qma_INITIAL_DESC' => '<P>Analysing the mail system log files can aid both in
2101 +understanding how your system is performing and in
2102 +diagnosing delivery problems. Several different
2103 +reports are available.</P>
2104 +<P>Please note that it may take several minutes to generate
2105 +these reports</P>',
2106 +'qma_REPORT_TYPE' => 'Choose a report type',
2107 +'qma_GENERATE_REPORT' => 'Generate report',
2108 +'qma_LIST_OUTGOING' => 'List outgoing messages and recipients',
2109 +'qma_SUMMARIZE_QUEUE' => 'Summarize status of mail queue',
2110 +'qma_SUCCESSFUL_DELIVERY_DELAY' => 'Successful delivery delay distribution',
2111 +'qma_REASONS_DEFERRAL' => 'Reasons for deferral',
2112 +'qma_REASONS_FAILURE' => 'Reasons for failure',
2113 +'qma_BASIC_STATS' => 'Basic statistics',
2114 +'qma_RECIP_STATS' => 'Recipients statistics',
2115 +'qma_RECIP_HOSTS' => 'Recipient hosts',
2116 +'qma_RECIP_ORDERED' => 'Recipients in best order for mailing lists',
2117 +'qma_SENDER_STATS' => 'Sender statistics',
2118 +'qma_SENDMAIL_STYLE' => 'Sendmail style log',
2119 +'qma_REASONS_SUCCESS' => 'Reasons for success',
2120 +'qma_SENDER_UIDS' => 'Sender uids',
2121 +'qma_INVALID_REPORT_TYPE' => 'Invalid report type: ',
2122 +'qma_REPORT_GENERATED' => 'Report generated: ',
2123 +'qma_END_OF_REPORT' => 'End of Report',
2124 +'qma_Mail log file analysis' => 'Mail log file analysis',
2125 +
2126 'quo_FORM_TITLE' => 'Create, modify, or remove user account quotas',
2127 'quo_UNABLE_TO_OPEN_ACCOUNTS' => 'Unable to open accounts db',
2128 'quo_QUOTA_DESC' => '<p>You can set filesystem quotas for users on your system by clicking
2129 @@ -776,6 +759,250 @@
2130
2131 'swt_THEME' => 'Theme',
2132
2133 +'pse_NO_PSEUDONYMS' => ' <b>There are no pseudonyms in the system.</b> ',
2134 +'pse_REMOVE_PSEUDONYM' => 'Remove pseudonym',
2135 +'pse_ABOUT_TO_REMOVE' => 'You are about to remove the pseudonym: [_1]<br>
2136 +<b>Are you sure you wish to continue?</b>',
2137 +'pse_FORM_TITLE' => 'Create, modify, or remove pseudonyms',
2138 +'pse_DESCRIPTION' => '<p>The server automatically creates
2139 +an e-mail alias for each group. If you want to define an e-mail
2140 +alias for a list of users, simply create a group and the
2141 +list will automatically be maintained by the server.</p>
2142 +<p>Pseudonyms allow you to
2143 +create other names for existing users or groups.
2144 +For example, you may wish to create a pseudonym
2145 +"webmaster" for your "webdevelopers" group or a
2146 +pseudonym "joe" for the user "joseph".</p>
2147 +<p>The server automatically creates pseudonyms of the form
2148 +firstname.lastname and firstname_lastname for every user
2149 +on the system and a pseudonym "everyone" which contains
2150 +all users on the system.</p>
2151 +<p>Pseudonyms also allow you to create e-mail aliases for valid
2152 +(virtual) domains & users. For example you can forward
2153 +"sales@virtualdomain1.com" to user "mary" and
2154 +"sales@virtualdomain2.com" to user "john".
2155 +You must create the domains and user accounts before creating
2156 +the email aliases.</p>
2157 +<p>Pseudonyms can also forward to other pseudonyms, although this
2158 +is limited to one further level. For example the pseudonym
2159 +"webmaster" can forward to the pseudonym "techsupport" which
2160 +then forwards to a specified user "ray". This is useful where
2161 +one user is responsiblefor multiple roles and saves having
2162 +to change the pseudonym\'s associated with that user many times
2163 +in the event that the user departs the organisation.</p>
2164 +<p>You can modify or remove a
2165 +pseudonym by clicking on the corresponding
2166 +command next to the pseudonym.</p>',
2167 +'pse_LOCAL_ONLY' => '(local network only)',
2168 +'pse_SELECT_ACCOUNT' => 'Select account or group',
2169 +'pse_SELECT_INTERNAL' => 'Local network only',
2170 +'pse_CLICK_TO_CREATE' => 'Add pseudonym',
2171 +'pse_PSEUDONYM' => 'Pseudonym',
2172 +'pse_USER_OR_GROUP' => 'User or group',
2173 +'pse_CURRENT_PSEUDONYMS' => 'Current List of Pseudonyms',
2174 +'pse_TITLE_CREATE' => 'Create a pseudonym',
2175 +'pse_DESC_PSEUDONYM_NAME' => ' Please select an existing account or group for the pseudonym from the pulldown menu below',
2176 +'pse_MODIFY_PSEUDONYM' => 'Modify Pseudonym',
2177 +'pse_PSEUDONYM_NAME' => 'Pseudonym name',
2178 +'pse_VALID_PSEUDONYM_NAMES' => ' The pseudonym
2179 + should contain only lower-case letters, numbers, period,
2180 + hyphen and underscore
2181 + and should start with a lower-case letter or
2182 + number. For example "sales", "john.holland", "123"
2183 + and "email-administrator" are all valid pseudonyms,
2184 + but "John Smith" and "Henry Miller" are not.
2185 +<p>You can also create email aliases for accounts and (virtual)
2186 +domains that are valid on this server. For example
2187 +"fred@virtualdomain.com" can be forwarded to "mary"
2188 +(or to another valid user account).</p> ',
2189 +'pse_NAME_IN_USE' => 'Error: That name is in use You cannot create a pseudonym with that name.',
2190 +'pse_NOT_A_PSEUDONYM' => 'That account is not a pseudonym',
2191 +'pse_PSEUDONYM_INVALID_DOMAIN' => 'That domain is not hosted on this server',
2192 +'pse_PSEUDONYM_INVALID_NOACCT' => 'That account is not hosted on this server',
2193 +'pse_PSEUDONYM_INVALID_SAMEACCT' => 'A pseudonym cannot point to the same account',
2194 +'pse_CREATE_SUCCEEDED' => 'Successfully created pseudonym',
2195 +'pse_MODIFY_SUCCEEDED' => 'Successfully modified pseudonym',
2196 +'pse_REMOVE_SUCCEEDED' => 'Successfully removed pseudonym',
2197 +'pse_EVERYONE' => 'Everyone',
2198 +'pse_Pseudonyms' => 'Pseudonyms',
2199 +
2200 +'dom_ADD_DOMAIN' => 'Add domain',
2201 +'dom_FORM_TITLE' => 'Manage domains',
2202 +'dom_FORM_DESCRIPTION' => 'When you create a domain, your server will be able to
2203 +receive e-mail for that domain and will also be able to host a
2204 +web site for that domain.',
2205 +'dom_ADD_DOMAIN' => 'Add domain',
2206 +'dom_NO_VIRTUAL_DOMAINS' => 'There are no domains in the system',
2207 +'dom_CURRENT_DOMAINS' => 'Current list of domains',
2208 +'dom_PRIMARY_SITE' => 'primary site',
2209 +'dom_CONTENT' => '[_1] i-bay',
2210 +'dom_CREATE_TITLE' => 'Create a new domain',
2211 +'dom_CONTENT_FIELD_DESCRIPTION' => 'For the web site, you may choose your primary web site or any
2212 +i-bay as the content.',
2213 +'dom_DOMAIN_NAME_VALIDATION_ERROR' => 'Error: unexpected or missing characters in domain name
2214 +[_1].The domain name should contain one or more
2215 +letters, numbers, periods and minus signs.Did not create new domain.',
2216 +'dom_DOMAIN_DESCRIPTION_VALIDATION_ERROR' => 'Error: unexpected or missing characters in domain description
2217 +[_1]. Did not create new domain.',
2218 +'dom_DOMAIN_IN_USE_ERROR' => 'Error: domain [_1] is already in use.Did not create
2219 +new domain.',
2220 +'dom_SYSTEM_DOMAIN_ERROR' => 'Error: domain [_1] is your system domain name.You
2221 +cannot have a domain with the same name.Did not create new domain.',
2222 +'dom_SUCCESSFULLY_CREATED' => 'Successfully created domain [_1].Your web
2223 +server is now being restarted.The links on this page will be
2224 +inactive until the web server restart is complete.',
2225 +'dom_MODIFY_TITLE' => 'Modify domain',
2226 +'dom_NONEXISTENT_DOMAIN_ERROR' => 'Error: [_1] is not an existing domain.',
2227 +'dom_SUCCESSFULLY_MODIFIED' => 'Successfully modified domain [_1].Your web
2228 +server is now being restarted.The links on this page will be
2229 +inactive until the web server restart is complete.',
2230 +'dom_REMOVE_TITLE' => 'Remove domain',
2231 +'dom_REMOVE_DESCRIPTION' => 'You are about to remove the domain "[_1]" ([_2]).',
2232 +'dom_ABOUT_TO_REMOVE' => 'Are you sure you wish to remove this domain ?',
2233 +'dom_ERROR_WHILE_REMOVING_DOMAIN' => 'Error: internal failure while removing domain [_1].',
2234 +'dom_SUCCESSFULLY_DELETED' => 'Successfully deleted domain [_1]. Your web server
2235 +is now being restarted.The links on this page will be inactive
2236 +until the web server restart is complete.',
2237 +'dom_DESC_CORPORATE_DNS_CURRENT' => 'Corporate DNS Settings',
2238 +'dom_BUTTON_CORPORATE_DNS' => 'If this server does not have access to the Internet, or you have special
2239 +requirements for DNS resolution, enter the DNS server IP address here.
2240 +You should not enter the address of your ISP\'s DNS servers here, as the server
2241 +is capable of resolving all Internet DNS names without this additional
2242 +configuration.',
2243 +'dom_DOMAINS_PAGE_CORPORATE_DNS' => 'Modify corporate DNS settings',
2244 +'dom_DESC_CORPORATE_DNS' => 'If this server does not have access to the Internet, or
2245 +you have special requirements for DNS resolution,
2246 +enter the DNS server IP addresses here.
2247 +These fields should be left blank unless
2248 +you have a specific reason to configure other DNS servers.
2249 +You should not enter the address of your ISP\'s DNS servers
2250 +here, as the server is capable of resolving all
2251 +Internet DNS names without this additional configuration.',
2252 +'dom_LABEL_CORPORATE_DNS_PRIMARY' => 'Primary corporate DNS server',
2253 +'dom_LABEL_CORPORATE_DNS_SECONDARY' => 'Secondary corporate DNS server',
2254 +'dom_DESC_NAMESERVERS' => 'You can select whether this domain is resolved locally,
2255 +passed to the corporate DNS servers, or resolved by
2256 +the Internet DNS servers. The default will be correct
2257 +for most networks.',
2258 +'dom_LABEL_NAMESERVERS' => 'Domain DNS servers',
2259 +'dom_localhost' => 'Resolve locally',
2260 +'dom_internet' => 'Internet DNS servers',
2261 +'dom_corporate' => 'Corporate DNS servers',
2262 +'dom_REMOVE_DESC' => 'You are about to remove the domain ',
2263 +'dom_REMOVE_DESC2' => ' Are you sure you wish to remove this Domain ? ',
2264 +
2265 +'hos_FORM_TITLE' => 'Hostnames and addresses',
2266 +'hos_UNABLE_TO_OPEN_CONFIGDB' => 'Unable to open configuration database',
2267 +'hos_DNS_FORWARDER_ENABLED' => 'A DNS forwarder has been configured. This means that all DNS
2268 +lookups will be handled by the DNS forwarder. Hostnames
2269 +and addresses cannot be modified on this server while
2270 +a DNS forwarder is configured.',
2271 +'hos_ADD_HOSTNAME' => 'Add hostname',
2272 +'hos_HOSTNAME' => 'Hostname',
2273 +'hos_HOSTTYPE' => 'Location',
2274 +'hos_LOCAL_IP' => 'Local IP',
2275 +'hos_ETHERNET_ADDRESS' => 'Ethernet address',
2276 +'hos_CURRENT_HOSTNAMES_FOR_DOMAIN' => 'Current list of hostnames for [_1].',
2277 +'hos_NO_HOSTNAMES_FOR_SERVICENAME' => 'There are no hostnames in the system for [_1].',
2278 +'hos_CURRENT_HOSTNAMES_FOR_LOCAL_DOMAIN' => 'Current list of hostnames for [_1]',
2279 +'hos_NO_HOSTNAMES_FOR_LOCAL_DOMAIN' => 'There are no hostnames in the system for [_1].',
2280 +'hos_STATIC_HOST_MESSAGE' => '- This host represents your system name and cannot be modifiedor removed.',
2281 +'hos_CREATE_LOCAL_HOST_TITLE' => 'Create a new hostname for this server',
2282 +'hos_HOSTNAME_VALIDATION_ERROR' => 'Error: unexpected characters in host name: "[_1]".
2283 +The host name should contain only
2284 +letters, numbers, and hyphens and must start
2285 +with a letter or a number.',
2286 +'hos_HOSTNAME_LENGTH_ERROR' => 'Error: account name [_1] is too long. The
2287 +maximum is 32 characters.',
2288 +'hos_DOMAIN_VALIDATION_ERROR' => 'Error: unexpected or missing characters in domain name
2289 +[_1]. The domain name should contain one or more
2290 +letters, numbers, periods and minus signs. Did not create new
2291 +domain.',
2292 +'hos_HOSTNAME_EXISTS_ERROR' => 'Error: account [_1] hostname.',
2293 +'hos_SUCCESSFULLY_CREATED' => 'Successfully created hostname.',
2294 +'hos_HOSTNAME_DESCRIPTION' => 'The hostname must contain only letters, numbers, and hyphens, and must start with a letter or number. ',
2295 +'hos_LOCAL_IP_DESCRIPTION' => 'The Local IP address is the IP address of another machine on
2296 +the local network. Please enter a valid IP address in the
2297 +format "aaa.bbb.ccc.ddd".',
2298 +'hos_ETHERNET_ADDRESS_DESCRIPTION' => 'The ethernet address is optional and causes the DHCP server to
2299 +statically bind the local IP address to the computer with this
2300 +ethernet address.If specified, it must be of the form
2301 +"AA:BB:CC:DD:EE:FF" and must contain only the numbers 0-9 and
2302 +the letters A-F.',
2303 +'hos_CREATE_LOCAL_HOST_TITLE' => 'Create a new hostname referring to a local host.',
2304 +'hos_DIDNT_ENTER_LOCAL_IP' => 'Error: You did not specify a Local IP address.IP
2305 +addresses must contain only numbers and periods and
2306 +be in the form "aaa.bbb.ccc.ddd".Did not create hostname.',
2307 +'hos_IP_VALIDATION_ERROR' => 'Error: IP Address [_1] is
2308 +invalid. IP Addresses must contain only numbers and periodsand be in the form "aaa.bbb.ccc.ddd". Did not create hostname.',
2309 +'hos_MAC_ADDRESS_VALIDATION_ERROR' => 'Error: Ethernet address [_1]
2310 +is invalid.Ethernet addresses must be in the
2311 +form "AA:BB:CC:DD:EE:FF" and only contain the
2312 +numbers 0-9 and the letters A-F. Did not create
2313 +hostname.',
2314 +'hos_CREATE_REMOTE_HOST_TITLE' => 'Create a new hostname referring to a remote host',
2315 +'hos_CREATE_TITLE' => 'Create or modify hostname',
2316 +'hos_MODIFY_TITLE' => 'Modify hostname',
2317 +'hos_LOCAL_PAGE_DESCRIPTION' => 'Please enter the following additional details for a localhost:',
2318 +'hos_REMOTE_PAGE_DESCRIPTION' => 'Please enter the following additional details for a remotehost:',
2319 +'hos_SUCCESSFULLY_DELETED' => 'Successfully deleted host.',
2320 +'hos_SUCCESSFULLY_MODIFIED' => 'Successfully modified host.',
2321 +'hos_REMOVE_TITLE' => 'Remove hostname',
2322 +'hos_REMOVE_PAGE_DESCRIPTION' => 'You are about to remove the hostname "[_1]"',
2323 +'hos_ABOUT_TO_REMOVE' => 'Are you sure you wish to remove this hostname?',
2324 +'hos_CONFIRM_DESCRIPTION' => 'Please confirm the following details.',
2325 +'hos_NO_HOSTS_FOR_THIS_DOMAIN' => 'There are no hosts for this domain.',
2326 +'hos_ADDR_IN_DHCP_RANGE' => 'Address is inside the DHCP assigned dynamic range',
2327 +'hos_ERROR_WHILE_CREATING_HOST' => 'Error occurred while creating hostname.',
2328 +'hos_ERROR_WHILE_MODIFYING_HOST' => 'Error occurred while modifying hostname.',
2329 +'hos_ERROR_WHILE_DELETING_HOST' => 'Error occurred while deleting hostname.',
2330 +'hos_ERR_IP_IS_LOCAL_OR_GATEWAY' => 'Error: IP cannot be server IP or Gateway IP.',
2331 +'hos_ERR_IP_NOT_LOCAL' => 'Error: This IP address is not on any of our local networks.',
2332 +'hos_MUST_BE_VALID_HOSTNAME_OR_IP' => 'Must be a valid hostname or IP number',
2333 +'hos_HOSTNAME_COMMENT_ERROR' => 'Error: unexpected characters in the comment of "[_1]".
2334 +The comment must contain only letters, spaces, numbers, dots, commas, undescores, hyphens and must start with a letter or number.',
2335 +'hos_HOSTNAME_VALIDATOR_ERROR' => 'Error: unexpected characters in host name: "[_1]". The host name should contain only
2336 +letters, numbers, and hyphens and must start with a letter or a number. ',
2337 +
2338 +'log_View log files' => 'View log files',
2339 +'log_FIRSTPAGE_DESC' => 'This panel allows you to view or download the log files generated
2340 +by the services running on your server.',
2341 +'log_LOG_FILE_SELECT_DESC' => 'Choose a log file to view',
2342 +'log_FILTER_PATTERN_DESC' => 'You may optionally specify a filter pattern to display only the
2343 +lines from the log file which match this pattern.If you leave
2344 +this field blank, all available lines of the log file will be
2345 +displayed. Note that this option is not used if you download the
2346 +logfile.',
2347 +'log_FILTER_PATTERN_LABEL' => 'Filter Pattern (optional)',
2348 +'log_MATCH_PATTERN_DESC' => 'You may also optionally specify a highlight pattern to mark in bold
2349 +any lines from the log file which match the highlight pattern. The
2350 +highlight pattern is applied to any lines which have already
2351 +matched the filter pattern. Note that this option is not used if
2352 +you download the logfile.',
2353 +'log_MATCH_PATTERN_LABEL' => 'Highlight Pattern (optional)',
2354 +'log_END_DESC' => 'Please note that it may take quite some time to generate these
2355 +reports.',
2356 +'log_VIEW' => 'View log file',
2357 +'log_LOG_FILE_EMPTY' => 'Log file "[_1]" is empty!',
2358 +'log_VIEWING_TIME' => 'Viewed at [_1].',
2359 +'log_MATCH_HEADER' => 'Displaying lines matching: "[_1]".',
2360 +'log_HIGHLIGHT_HEADER' => 'Highlighting lines matching: "[_1]".',
2361 +'log_NO_MATCHING_LINES' => 'No matching lines displayed.',
2362 +'log_FILENAME_ERROR' => '<p>Error while specifying log file name.</p>
2363 +<p>Invalid report type "[_1]".</p>',
2364 +'log_REFRESH' => 'Refresh this logfile',
2365 +'log_OP_DESC' => 'You must choose between viewing the logfile in your browser, or
2366 +downloading the logfile to your computer. If the logfile is
2367 +particularly large, you may wish to download it instead of
2368 +attempting to open it in your browser, as this is a problem for
2369 +some web browsers.',
2370 +'log_OP_LABEL' => 'Operation',
2371 +'log_DOWNLOAD_PAGE_DESC' => 'Your logfile download is now prepared. It will proceed as soon
2372 +as you click on the &quot;Next&quot; button below, and instruct
2373 +your browser to accept the download via the pop-up window that
2374 +will appear.',
2375 +'log_DOWNLOAD_FILE' => 'Preparing to download the logfile [_1].',
2376 +
2377 );
2378
2379
2380 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Navigation.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Navigation.pm
2381 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Navigation.pm 2020-01-23 12:35:27.000000000 +0400
2382 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Navigation.pm 1970-01-01 04:00:00.000000000 +0400
2383 @@ -1,352 +0,0 @@
2384 -#!/usr/bin/perl -wT
2385 -
2386 -package SrvMngr::Navigation;
2387 -
2388 -use strict;
2389 -use warnings;
2390 -
2391 -use esmith::cgi;
2392 -use esmith::config;
2393 -use esmith::NavigationDB;
2394 -use esmith::util;
2395 -use esmith::I18N;
2396 -
2397 -esmith::util::setRealToEffective ();
2398 -
2399 -# Use the one script for navigation and noframes
2400 -my $NO_FRAMES = ($0 =~ /noframes/);
2401 -
2402 -
2403 -#------------------------------------------------------
2404 -# subroutine to determine which group a user belongs to
2405 -#------------------------------------------------------
2406 -
2407 -sub determineGroup
2408 -{
2409 - my ($user) = shift;
2410 -
2411 - # Group file for authentication
2412 - my $group_file = '/etc/group';
2413 - open ( GF, $group_file )
2414 - or die "Cannot open group file: $group_file: $!\n";
2415 -
2416 - # list of groups this user belongs to
2417 - my @groupList;
2418 - while (<GF>)
2419 - {
2420 - if (/[:,]$user\b/)
2421 - {
2422 - my ($groupName, undef) = split(/:/);
2423 - push @groupList, $groupName;
2424 - }
2425 - }
2426 - close GF;
2427 - return @groupList;
2428 -}
2429 -
2430 -#------------------------------------------------------------
2431 -# subroutine to display navigation bar
2432 -#------------------------------------------------------------
2433 -
2434 -sub showNavigation ()
2435 -{
2436 - my $q = shift;
2437 - #my $c = shift;
2438 - my $config = shift;
2439 -
2440 - my $navig_script = "themes/".$config->{theme}."/public/js/navigation.js";
2441 - my $navig_div = "themes/".$config->{theme}."/templates/partials/_navig.html.ep";
2442 -
2443 - my $navigation = "";
2444 -
2445 - # Use this variable throughout to keep track of files
2446 - # list of just the files
2447 - my $c = "1";
2448 - my @files = ();
2449 - my %files_hash = ();
2450 - my @panel_group = "admin";
2451 -# my @panel_group = $ENV{'REMOTE_USER'} eq "admin" ?
2452 -# ("admin") : determineGroup($ENV{'REMOTE_USER'});
2453 -
2454 - #-----------------------------------------------------
2455 - # Determine the directory where the functions are kept
2456 - #-----------------------------------------------------
2457 -
2458 - my $navigation_ignore =
2459 - "(\.\.?|navigation|noframes|online-manual|(internal|pleasewait)(-.*)?)";
2460 -
2461 - my $cgidir = 'nowhere';
2462 - if ($panel_group[0] eq 'admin')
2463 - {
2464 - $cgidir = '/etc/e-smith/web/panels/manager/cgi-bin/';
2465 -
2466 - if (opendir (DIR, $cgidir))
2467 - {
2468 - @files = grep (!/^${navigation_ignore}$/,
2469 - readdir (DIR));
2470 - closedir (DIR);
2471 - }
2472 - else
2473 - {
2474 - warn "Can't open directory $cgidir\n";
2475 - }
2476 -
2477 - foreach my $file (@files)
2478 - {
2479 - next if (-d "$cgidir/$file");
2480 - $files_hash{$file} = $cgidir;
2481 - }
2482 -
2483 - }
2484 - else
2485 - {
2486 - foreach my $panel (@panel_group)
2487 - {
2488 - $cgidir = "/etc/e-smith/web/panels/manager/$panel/cgi-bin";
2489 -
2490 - if (opendir (DIR, $cgidir))
2491 - {
2492 - @files = grep (!/^${navigation_ignore}$/,
2493 - readdir (DIR));
2494 - closedir (DIR);
2495 - foreach my $file (@files)
2496 - {
2497 - next if (-d "$cgidir/$file");
2498 - $files_hash{$file} = $cgidir;
2499 - }
2500 - }
2501 - else
2502 - {
2503 - warn "Can't open directory $cgidir\n";
2504 - }
2505 - }
2506 - }
2507 -
2508 - #--------------------------------------------------
2509 - # For each script, extract the description and category
2510 - # information. Build up an associative array mapping headings
2511 - # to heading structures. Each heading structure contains the
2512 - # total weight for the heading, the number of times the heading
2513 - # has been encountered, and another associative array mapping
2514 - # descriptions to description structures. Each description
2515 - # structure contains the filename of the particular cgi script
2516 - # and a weight.
2517 - #--------------------------------------------------
2518 - my %nav = ();
2519 -
2520 - use constant NAVIGATIONDIR => '/home/e-smith/db/navigation';
2521 - use constant WEBFUNCTIONS => '/etc/e-smith/web/functions';
2522 -
2523 - my $i18n = new esmith::I18N;
2524 -
2525 - my $language = $i18n->preferredLanguage( $ENV{HTTP_ACCEPT_LANGUAGE} );
2526 -
2527 - my $navinfo = NAVIGATIONDIR . "/navigation.$language";
2528 -
2529 - my $navdb = esmith::NavigationDB->open_ro( $navinfo ) or
2530 - die "Couldn't open $navinfo\n";
2531 -
2532 - # Check the navdb for anything with a UrlPath, which means that it doesn't
2533 - # have a cgi file to be picked up by the above code. Ideally, only pages
2534 - # that exist should be in the db, but that's not the case. Anything
2535 - # without a cgi file will have to remove themselves on uninstall from the
2536 - # navigation dbs.
2537 - foreach my $rec ($navdb->get_all)
2538 - {
2539 - if ($rec->prop('UrlPath'))
2540 - {
2541 - $files_hash{$rec->{key}} = $cgidir;
2542 - }
2543 - }
2544 -
2545 - foreach my $file (keys %files_hash)
2546 - {
2547 - my $heading = 'Unknown';
2548 - my $description = $file;
2549 - my $headingWeight = 99999;
2550 - my $descriptionWeight = 99999;
2551 - my $urlpath = '';
2552 -
2553 - my $rec = $navdb->get($file);
2554 -
2555 - if (defined $rec)
2556 - {
2557 - $heading = $rec->prop('Heading');
2558 - $description = $rec->prop('Description');
2559 - $headingWeight = $rec->prop('HeadingWeight');
2560 - $descriptionWeight = $rec->prop('DescriptionWeight');
2561 - $urlpath = $rec->prop('UrlPath') || '';
2562 - }
2563 -
2564 - #--------------------------------------------------
2565 - # add heading, description and weight information to data structure
2566 - #--------------------------------------------------
2567 -
2568 - unless (exists $nav {$heading})
2569 - {
2570 - $nav {$heading} = { COUNT => 0, WEIGHT => 0, DESCRIPTIONS => [] };
2571 - }
2572 -
2573 - $nav {$heading} {'COUNT'} ++;
2574 - $nav {$heading} {'WEIGHT'} += $headingWeight;
2575 -
2576 - # Check for manager panel, and assign the appropriate
2577 - # cgi-bin prefix for the links.
2578 - # Grab the last 2 directories by splitting for '/'s and
2579 - # then concatenating the last 2
2580 - # probably a better way, but I don't know it.
2581 - my @filename = split /\//, $files_hash{$file};
2582 -
2583 - #### mabmodif new version of module exists
2584 - my $path = (SrvMngr->get_mod_url($file) ne '-1') ?
2585 - "2" :
2586 - ###### mabmodif
2587 - ($cgidir eq '/etc/e-smith/web/panels/manager/cgi-bin/') ?
2588 - "/$filename[scalar @filename - 1]" :
2589 - "/$filename[scalar @filename - 2]/$filename[scalar @filename - 1]";
2590 - push @{ $nav {$heading} {'DESCRIPTIONS'} },
2591 - { DESCRIPTION => $description,
2592 - WEIGHT => $descriptionWeight,
2593 - FILENAME => $urlpath ? $urlpath : "$path/$file",
2594 - CGIPATH => $path
2595 - };
2596 - }
2597 -
2598 - #--------------------------------------------------
2599 - # generate list of headings sorted by average weight
2600 - #--------------------------------------------------
2601 -
2602 - #
2603 - # generate script .js
2604 - #
2605 - open(SCR, "> $navig_script")
2606 - or die "access file error: \'$navig_script\'\n$!";
2607 -
2608 - printf SCR '
2609 - //
2610 - // Do N O T modify this file : it is automatically generated !
2611 - //
2612 - //This swap the class of the selected item.
2613 - function swapClass() {
2614 - var i,x,tB,j=0,tA=new Array(),arg=swapClass.arguments;
2615 - if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
2616 - for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
2617 - if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
2618 - tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
2619 - }else if(arg[0]==1 && arg[1]==\'none\'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
2620 - tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
2621 - }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}}
2622 - ';
2623 - printf SCR "
2624 - // language $language
2625 - //This swap the class of the selected item.
2626 - function swapClasses() {
2627 - var arg=swapClasses.arguments;
2628 - swapClass(0,'none','item-current','item','a');
2629 - swapClass(0,'none','warn-current','warn','a');
2630 - swapClass(0,arg[0],'item-current','item','a');
2631 - //swapClass(0,'none','item-current accent','item accent','a');
2632 - //swapClass(0,'none','warn-current accent','warn accent','a');
2633 - //swapClass(0,arg[0],'item-current accent','item accent','a');
2634 - }
2635 -
2636 - // End script hiding -->
2637 - ";
2638 -
2639 - close SCR;
2640 -
2641 - #
2642 - # generate navigation div part
2643 - #
2644 -
2645 - open(DIV, "> $navig_div")
2646 - or die "access file error: \'$navig_div\'\n$!";
2647 -
2648 - # enable utf8 binmode so new translations work
2649 - binmode DIV, ":utf8";
2650 -
2651 - printf DIV "<!-- ";
2652 - printf DIV "\n!! Do N O T modify this file : it is automatically generated !!";
2653 - printf DIV "\n-->";
2654 -
2655 - #printf DIV "<!-- ";
2656 -
2657 - if ( $NO_FRAMES )
2658 - {
2659 -# esmith::cgi::genNoframesHeader ($q);
2660 - }
2661 - else
2662 - {
2663 -#### esmith::cgi::genNavigationHeader ($q, undef);
2664 - printf DIV "\n <div id='navigat'>\n";
2665 -## printf DIV "\n <script type='text/javascript' src='$navig_script'></script>";
2666 -## printf DIV "\n <script type='text/javascript' src='<%= $share_dir %>$navig_script'></script>";
2667 -
2668 - }
2669 -
2670 - foreach my $h (sort {
2671 - ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'}) <=>
2672 - ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav)
2673 - {
2674 - if ( $NO_FRAMES )
2675 - {
2676 - printf DIV $q->h2 ($h);
2677 - }
2678 - else
2679 - {
2680 - printf DIV "\n <div class='section'> $h </div>";
2681 -# printf DIV "\n", $q->Tr ($q->td({class => "section"},$q->span({class => "section"}, $h)));
2682 - }
2683 -
2684 - #--------------------------------------------------
2685 - # generate list of descriptions sorted by weight
2686 - #--------------------------------------------------
2687 - printf DIV "<ul>\n" if ( $NO_FRAMES );
2688 -
2689 - foreach (sort { $a->{'WEIGHT'} <=> $b->{'WEIGHT'} } @{$nav {$h}{'DESCRIPTIONS'}})
2690 - {
2691 - my ($target, $classNew) = ( $_->{'FILENAME'} =~ m/^2\// ) ?
2692 - ('_self',' accent') :
2693 - ('main','') ;
2694 -
2695 - my $href = '/server-manager' . $_->{'FILENAME'};
2696 - if ( $NO_FRAMES )
2697 - {
2698 - printf DIV $q->li ($q->a ({href => "$href?noframes=1"}, $_->{'DESCRIPTION'}));
2699 - }
2700 - else
2701 - {
2702 - printf DIV "\n <div class='menu-cell'><a class='item$classNew' target='$target' " .
2703 - "onclick=\"swapClasses('sme$c')\" id='sme$c' href='$href'>" .
2704 - "$_->{'DESCRIPTION'}</a></div>";
2705 -# printf DIV "\n<div class='menu-cell'><a class='item' target='main' " .
2706 -# "onclick='swapClasses('sme$c')' href='$href' id='sme$c'>" .
2707 -# "$_->{'DESCRIPTION'}</a></div>";
2708 -
2709 -# printf DIV "\n",$q->Tr(
2710 -# $q->td ({-class => "menu-cell"},
2711 -# $q->a ({-id => "sme$c",
2712 -# -class => "item",
2713 -# -onClick => "swapClasses('sme$c')",
2714 -# href => $href,
2715 -# target => 'main'},
2716 -# $_->{'DESCRIPTION'})
2717 -# ));
2718 - }
2719 - $c++;
2720 -
2721 - }
2722 -
2723 - printf DIV "</ul>\n" if ($NO_FRAMES);
2724 - }
2725 -
2726 - unless ( $NO_FRAMES )
2727 - {
2728 -### esmith::cgi::genNavigationFooter ($q);
2729 - }
2730 - print DIV "\n </div>";
2731 -# print DIV "\n -->";
2732 - close DIV
2733 -}
2734 -
2735 -1;
2736 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
2737 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl 2020-01-27 12:03:33.000000000 +0400
2738 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl 2020-02-19 22:43:47.778000000 +0400
2739 @@ -25,7 +25,7 @@
2740
2741 use SrvMngr::I18N;
2742 my $locale = plugin I18N => {namespace => 'SrvMngr::I18N', default => 'en'};
2743 -
2744 +#my $locale = plugin I18N => {namespace => 'SrvMngr::I18N'};
2745
2746 my $VERSION = '0.0.1';
2747 #app->mode('production');
2748 @@ -63,11 +63,23 @@
2749
2750 $r->get('/clamav')->to('clamav#main')->name('clamav');
2751 $r->post('/clamav')->to('clamav#do_update')->name('clamav2');
2752 +
2753 $r->get('/datetime')->to('datetime#main')->name('datetime');
2754 $r->post('/datetime')->to('datetime#do_update')->name('datetime2');
2755 +
2756 $r->get('/directory')->to('directory#main')->name('directory');
2757 $r->post('/directory')->to('directory#do_update')->name('directory2');
2758
2759 +$r->get('/domains')->to('domains#main')->name('domains');
2760 +$r->post('/domains')->to('domains#do_display')->name('domainadd1');
2761 +$r->post('/domainadd')->to('domains#do_update')->name('domainadd2');
2762 +$r->get('/domainupd')->to('domains#do_display')->name('domainupd1');
2763 +$r->post('/domainupd')->to('domains#do_update')->name('domainupd2');
2764 +$r->get('/domaindel')->to('domains#do_display')->name('domaindel1');
2765 +$r->post('/domaindel')->to('domains#do_update')->name('domaindel2');
2766 +$r->get('/domainup2')->to('domains#do_display')->name('domainup21');
2767 +$r->post('/domainup2')->to('domains#do_update')->name('domainup22');
2768 +
2769 $r->get('/groups')->to('groups#main')->name('groups');
2770 $r->post('/groups')->to('groups#do_display')->name('groupadd1');
2771 $r->post('/groupadd')->to('groups#do_update')->name('groupadd2');
2772 @@ -76,6 +88,11 @@
2773 $r->get('/groupdel')->to('groups#do_display')->name('groupdel1');
2774 $r->post('/groupdel')->to('groups#do_update')->name('groupdel2');
2775
2776 +$r->get('/hostentries')->to('hostentries#main')->name('hostentries');
2777 +$r->post('/hostentries')->to('hostentries#do_display')->name('hostentryadd');
2778 +$r->get('/hostentryd')->to('hostentries#do_display')->name('hostentrydis');
2779 +$r->post('/hostentryd')->to('hostentries#do_update')->name('hostentryupd');
2780 +
2781 $r->get('/ibays')->to('ibays#main')->name('ibays');
2782 $r->post('/ibays')->to('ibays#do_display')->name('ibayadd');
2783 $r->get('/ibayd')->to('ibays#do_display')->name('ibaydis');
2784 @@ -95,6 +112,15 @@
2785
2786 $r->get('/proxy')->to('proxy#main')->name('proxy');
2787 $r->post('/proxy')->to('proxy#do_update')->name('proxy2');
2788 +
2789 +$r->get('/pseudonyms')->to('pseudonyms#main')->name('pseudonyms');
2790 +$r->post('/pseudonyms')->to('pseudonyms#do_display')->name('pseudoadd1');
2791 +$r->post('/pseudoadd')->to('pseudonyms#do_update')->name('pseudoadd2');
2792 +$r->get('/pseudoupd')->to('pseudonyms#do_display')->name('pseudoupd1');
2793 +$r->post('/pseudoupd')->to('pseudonyms#do_update')->name('pseudoupd2');
2794 +$r->get('/pseudodel')->to('pseudonyms#do_display')->name('pseudodel1');
2795 +$r->post('/pseudodel')->to('pseudonyms#do_update')->name('pseudodel2');
2796 +
2797 $r->get('/qmailanalog')->to('qmailanalog#main')->name('qmailanalog');
2798 $r->post('/qmailanalog')->to('qmailanalog#do_update')->name('qmailanalog2');
2799
2800 @@ -111,14 +137,20 @@
2801 $r->post('/starterwebsite')->to('starterwebsite#do_site')->name('starterwebsite2');
2802 $r->get('/support')->to('support#main')->name('support');
2803 $r->post('/swttheme')->to('swttheme#main')->name('swttheme');
2804 +
2805 +$r->get('/viewlogfiles')->to('viewlogfiles#main')->name('viewlogfiles');
2806 +$r->post('/viewlogfiles')->to('viewlogfiles#do_action')->name('viewlogfiles2');
2807 +
2808 $r->get('/wbl')->to('wbl#main')->name('wbl');
2809 $r->post('/wbl')->to('wbl#do_display')->name('wbldis');
2810 $r->post('/wbl2')->to('wbl#do_update')->name('wblupd');
2811 +
2812 $r->get('/welcome')->to('welcome#main')->name('welcome');
2813 $r->get('/workgroup')->to('workgroup#main')->name('workgroup');
2814 $r->post('/workgroup')->to('workgroup#do_update')->name('workgroup2');
2815 -$r->get('/getconfig/:key' => {key => qr/[a-z0-9]{2,32}/})->to('request#getconfig')->name('getrequest');
2816 -$r->get('/getaccount/:key' => {key => qr/[a-z0-9]{2,32}/})->to('request#getaccount')->name('getaccount');
2817 +
2818 +$r->get('/config/:key' => {key => qr/[a-z0-9]{2,32}/})->to('request#getconfig')->name('getconfig');
2819 +$r->get('/account/:key' => {key => qr/[a-z0-9]{2,32}/})->to('request#getaccount')->name('getaccount');
2820 $r->get('/:module' => {module => qr/[a-z0-9]{2,32}/})->to('modsearch#main')->name('module_search');
2821 #my $mod = any('/modules')->to('modules#default');
2822 #$mod->get('/:module' => {module => qr/[a-z0-9]{2,32}/})->to('#mod_search')->name('module_search2');
2823 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
2824 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css 2020-01-20 21:09:46.000000000 +0400
2825 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css 2020-02-19 22:44:47.000000000 +0400
2826 @@ -24,13 +24,6 @@
2827 padding: 10px;
2828 }
2829
2830 -label.field-with-error {
2831 - color: #dd7e5e
2832 -}
2833 -
2834 -input.field-with-error {
2835 - background-color: #fd9e7e
2836 -}
2837
2838 #central{
2839 margin-left: 0px;
2840 @@ -74,6 +67,27 @@
2841 position: fixed;
2842 margin-left: 40%;
2843 }
2844 +/*
2845 +label{
2846 + display: inline-block;
2847 + float: left;
2848 + clear: left;
2849 + width: 200px;
2850 + text-align: right;
2851 +}
2852 +data2 {
2853 + display: inline-block;
2854 + float: left;
2855 +}
2856 +*/
2857 +
2858 +label.field-with-error {
2859 + color: #dd7e5e
2860 +}
2861 +
2862 +input.field-with-error {
2863 + background-color: #fd9e7e
2864 +}
2865
2866 span.label {
2867 font-weight: bold;
2868 @@ -161,10 +175,3 @@
2869 width: 10%;
2870 text-align: center;
2871 }
2872 -
2873 -
2874 -
2875 -/*#h2e23 {
2876 - float: right;
2877 - width: 15%;
2878 -}*/
2879 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation2.js smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation2.js
2880 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation2.js 1970-01-01 04:00:00.000000000 +0400
2881 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation2.js 2020-02-02 16:59:48.000000000 +0400
2882 @@ -0,0 +1,5 @@
2883 +
2884 + //This swap the class of the selected item. (navigation2 to be done)
2885 +// function swapClass() {
2886 +// function swapClasses() {
2887 + // End script hiding -->
2888 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation.js smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation.js
2889 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation.js 2020-01-22 15:34:30.000000000 +0400
2890 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation.js 1970-01-01 04:00:00.000000000 +0400
2891 @@ -1,29 +0,0 @@
2892 -
2893 - //
2894 - // Do N O T modify this file : it is automatically generated !
2895 - //
2896 - //This swap the class of the selected item.
2897 - function swapClass() {
2898 - var i,x,tB,j=0,tA=new Array(),arg=swapClass.arguments;
2899 - if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
2900 - for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
2901 - if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
2902 - tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
2903 - }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
2904 - tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
2905 - }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}}
2906 -
2907 - // language en
2908 - //This swap the class of the selected item.
2909 - function swapClasses() {
2910 - var arg=swapClasses.arguments;
2911 - swapClass(0,'none','item-current','item','a');
2912 - swapClass(0,'none','warn-current','warn','a');
2913 - swapClass(0,arg[0],'item-current','item','a');
2914 - //swapClass(0,'none','item-current accent','item accent','a');
2915 - //swapClass(0,'none','warn-current accent','warn accent','a');
2916 - //swapClass(0,arg[0],'item-current accent','item accent','a');
2917 - }
2918 -
2919 - // End script hiding -->
2920 -
2921 \ Pas de fin de ligne à la fin du fichier
2922 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/domains.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/domains.html.ep
2923 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/domains.html.ep 1970-01-01 04:00:00.000000000 +0400
2924 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/domains.html.ep 2020-02-06 22:27:13.000000000 +0400
2925 @@ -0,0 +1,36 @@
2926 +% layout 'default', title => "Sme server 2 - domains", share_dir => './';
2927 +
2928 +% content_for 'module' => begin
2929 +<div id="module">
2930 +
2931 + % if ($config->{debug} == 1) {
2932 + <p>
2933 + %= dumper $c->current_route
2934 + %= dumper $dom_datas
2935 + </p>
2936 + % }
2937 +
2938 + <h1><%= $title%></h1>
2939 +
2940 + % if ( $notif ) {
2941 + <br>
2942 + <span class=sme-error>
2943 + %= $notif
2944 + </span>
2945 + %}
2946 +
2947 +
2948 + % if ($dom_datas->{trt} eq 'ADD') {
2949 + %= include 'partials/_dom_upd'
2950 + %} elsif ($dom_datas->{trt} eq 'DEL') {
2951 + %= include 'partials/_dom_del'
2952 + %} elsif ($dom_datas->{trt} eq 'UPD') {
2953 + %= include 'partials/_dom_upd'
2954 + %} elsif ($dom_datas->{trt} eq 'UP2') {
2955 + %= include 'partials/_dom_up2'
2956 + %} else {
2957 + %= include 'partials/_dom_list'
2958 + %}
2959 +
2960 +</div>
2961 +%end
2962 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/hostentries.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/hostentries.html.ep
2963 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/hostentries.html.ep 1970-01-01 04:00:00.000000000 +0400
2964 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/hostentries.html.ep 2020-02-10 12:23:31.000000000 +0400
2965 @@ -0,0 +1,35 @@
2966 +% layout 'default', title => "Sme server 2 - hostentries", share_dir => './';
2967 +
2968 +% content_for 'module' => begin
2969 +<div id="module">
2970 +
2971 + % if ($config->{debug} == 1) {
2972 + <p>
2973 + %= dumper $c->current_route
2974 + %= dumper $hos_datas
2975 + </p>
2976 + % }
2977 +
2978 + <h1><%= $title%></h1>
2979 +
2980 + % if ( $notif ) {
2981 + <br>
2982 + <span class=sme-error>
2983 + <%= $c->render_to_string(inline => $notif) %>
2984 + </span>
2985 + %}
2986 +
2987 + % if ($hos_datas->{trt} eq 'ADD' or $hos_datas->{trt} eq 'UPD') {
2988 + %= include 'partials/_hos_upd'
2989 + %} elsif ($hos_datas->{trt} eq 'DEL') {
2990 + %= include 'partials/_hos_del'
2991 + %} elsif ( $hos_datas->{trt} eq 'ALC' or $hos_datas->{trt} eq 'ULC') {
2992 + %= include 'partials/_hos_ulc'
2993 + %} elsif ( $hos_datas->{trt} eq 'ARM' or $hos_datas->{trt} eq 'URM') {
2994 + %= include 'partials/_hos_urm'
2995 + %} else {
2996 + %= include 'partials/_hos_list'
2997 + %}
2998 +
2999 +</div>
3000 +%end
3001 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/layouts/default.html.ep
3002 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/layouts/default.html.ep 2020-01-27 13:21:56.000000000 +0400
3003 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/layouts/default.html.ep 2020-02-05 20:31:06.000000000 +0400
3004 @@ -7,16 +7,17 @@
3005 <title><%= $title %></title>
3006 <link rev="made" href="mailto:bugs%40koozali.org">
3007 <meta name="copyright" content="(head.tmpl)Copyright 2003-2004 Mitel Corporation">
3008 - <link rel="stylesheet" type="text/css" media="all" href='css/sme_core.css'>
3009 - <link rel="stylesheet" type="text/css" media="all" href='css/sme_main.css'>
3010 - <!--link rel="stylesheet" type="text/css" media="all" href='css/sme_menu.css'-->
3011 - <link rel="stylesheet" type="text/css" media="all" href='css/styles.css'>
3012 + %= stylesheet 'css/sme_core.css'
3013 + %= stylesheet 'css/sme_main.css'
3014 + <!-- % = stylesheet 'css/sme_menu.css' -->
3015 + %= stylesheet 'css/styles.css'
3016 %= include 'partials/_head'
3017 </head>
3018
3019 <body>
3020 % if ( not defined $c->session->{lang} ) {
3021 % SrvMngr::init_session_cgi ( $c );
3022 + <br>INIT_SESSION_CGI<br>
3023 % }
3024 <div id="header">
3025 %= include 'partials/_header'
3026 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_del.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_del.html.ep
3027 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_del.html.ep 1970-01-01 04:00:00.000000000 +0400
3028 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_del.html.ep 2020-02-06 16:46:34.000000000 +0400
3029 @@ -0,0 +1,29 @@
3030 +<div id='dom_del'>
3031 +
3032 + % my $btn = l('REMOVE');
3033 + %= form_for '/domaindel' => (method => 'POST') => begin
3034 + <p>
3035 + <h2>
3036 + %=l 'dom_REMOVE_TITLE'
3037 + </h2>
3038 + </p>
3039 +
3040 + <p>
3041 + %= $c->l('dom_REMOVE_DESCRIPTION', $dom_datas->{domain}, $dom_datas->{description});
3042 + </p>
3043 +
3044 + <p><b>
3045 + %= l('dom_ABOUT_TO_REMOVE')
3046 + <b></p>
3047 +
3048 + <p>
3049 + <br>
3050 + %= submit_button "$btn", class => 'action'
3051 + </p>
3052 +
3053 + %= hidden_field 'trt' => $dom_datas->{trt}
3054 + %= hidden_field 'Domain' => $dom_datas->{domain}
3055 +
3056 + % end
3057 +
3058 +</div>
3059 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_list.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_list.html.ep
3060 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_list.html.ep 1970-01-01 04:00:00.000000000 +0400
3061 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_list.html.ep 2020-02-11 23:01:01.000000000 +0400
3062 @@ -0,0 +1,105 @@
3063 +<div id='dom_list'>
3064 +
3065 + % my $btn = l('dom_ADD_DOMAIN');
3066 +
3067 +
3068 + %= form_for '/domains' => (method => 'POST') => begin
3069 +
3070 + %= l('dom_FORM_DESCRIPTION');
3071 +
3072 + <p>
3073 + <br>
3074 + %= submit_button "$btn", class => 'action'
3075 + </p>
3076 +
3077 + <p>
3078 + <h2>
3079 + %=l 'dom_CURRENT_DOMAINS'
3080 + </h2>
3081 + <table class="sme-border"><tbody>
3082 + <tr>
3083 + <th class='sme-border'>
3084 + %=l 'DOMAIN_NAME'
3085 + </th>
3086 + <th class='sme-border'>
3087 + %=l 'DESCRIPTION_BRIEF'
3088 + </th>
3089 + <th class='sme-border'>
3090 + %=l 'dom_CONTENT'
3091 + </th>
3092 + <th class='sme-border'>
3093 + %=l 'dom_LABEL_NAMESERVERS'
3094 + </th>
3095 + <th class='sme-border' colspan='2'>
3096 + %=l 'ACTION'
3097 + </th>
3098 + </tr>
3099 +
3100 + % foreach my $domain ( @$domains ) {
3101 + <tr>
3102 + %= t td => (class => 'sme-border') => $domain->{Domain}
3103 + %= t td => (class => 'sme-border') => $domain->{'Description'}
3104 + %= t td => (class => 'sme-border') => $domain->{'Content'}
3105 + %= t td => (class => 'sme-border') => l('dom_' . $domain->{'Nameservers'})
3106 +
3107 + % my $actionModify = "<a href='domainupd?trt=UPD&Domain=" . $domain->{Domain} . "'>" . l('MODIFY') . "</a>";
3108 +
3109 + % my $removable = ($domain->{Removable} || 'yes');
3110 + % my $actionRemove = '&nbsp;';
3111 +
3112 + % if ($removable eq 'yes') {
3113 + % $actionRemove = "<a href='domaindel?trt=DEL&Domain=" . $domain->{Domain} . "'>" . l('REMOVE') . "</a>";
3114 + % }
3115 +
3116 + <td class='sme-border'><%= $c->render_to_string(inline => $actionModify) %></td>
3117 + <td class='sme-border'><%= $c->render_to_string(inline => $actionRemove) %></td>
3118 + </tr>
3119 + % }
3120 +
3121 + </tbody>
3122 + </table>
3123 + </p>
3124 +
3125 + % end
3126 +
3127 + %= form_for '/domainup2' => (method => 'GET') => begin
3128 +
3129 + <HR class="sectionbar">
3130 +
3131 + % my $btn2 = l('dom_DOMAINS_PAGE_CORPORATE_DNS');
3132 +
3133 + <h3>
3134 + %= l 'dom_DESC_CORPORATE_DNS_CURRENT'
3135 + </h3>
3136 +
3137 + <p>
3138 + <span class=label>
3139 + %=l 'dom_LABEL_CORPORATE_DNS_PRIMARY'
3140 + </span><span class=data>
3141 + %= $dom_datas->{forwarder}
3142 + </span>
3143 + </p>
3144 +
3145 + % if ($dom_datas->{forwarder2}) {
3146 + <p>
3147 + <span class=label>
3148 + %=l 'dom_LABEL_CORPORATE_DNS_SECONDARY'
3149 + </span><span class=data>
3150 + %= $dom_datas->{forwarder2}
3151 + </span>
3152 + </p>
3153 + % }
3154 +
3155 + <p>
3156 + %= submit_button "$btn2", class => 'action'
3157 + </p>
3158 +
3159 + <p>
3160 + %= l 'dom_BUTTON_CORPORATE_DNS'
3161 + </p>
3162 +
3163 + %= hidden_field 'trt' => $dom_datas->{trt}
3164 +
3165 + % end
3166 +
3167 +</div>
3168 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_up2.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_up2.html.ep
3169 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_up2.html.ep 1970-01-01 04:00:00.000000000 +0400
3170 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_up2.html.ep 2020-02-06 23:34:05.000000000 +0400
3171 @@ -0,0 +1,37 @@
3172 +<div id='dom_up2'>
3173 +
3174 + % my $btn = l('SAVE');
3175 +
3176 + %= form_for '/domainup2' => (method => 'POST') => begin
3177 +
3178 + <p><br>
3179 + %=l 'dom_DESC_CORPORATE_DNS'
3180 + </p>
3181 +
3182 + <p>
3183 + <span class=label>
3184 + %=l 'dom_LABEL_CORPORATE_DNS_PRIMARY'
3185 + </span><span class=data>
3186 + % param 'Forwarder' => $dom_datas->{forwarder} unless param 'Forwarder';
3187 + %= text_field 'Forwarder', class => 'input'
3188 + </span>
3189 + </p>
3190 +
3191 + <p>
3192 + <span class=label>
3193 + %=l 'dom_LABEL_CORPORATE_DNS_SECONDARY', class => 'label'
3194 + </span><span class=data>
3195 + % param 'Forwarder2' => $dom_datas->{forwarder2} unless param 'Forwarder2';
3196 + %= text_field 'Forwarder2', class => 'input'
3197 + </span>
3198 + </p>
3199 +
3200 + <p>
3201 + %= submit_button "$btn", class => 'action'
3202 + </p>
3203 +
3204 + %= hidden_field 'trt' => $dom_datas->{trt}
3205 +
3206 + %end
3207 +
3208 +</div>
3209 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_upd.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_upd.html.ep
3210 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_upd.html.ep 1970-01-01 04:00:00.000000000 +0400
3211 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_dom_upd.html.ep 2020-02-06 23:17:20.000000000 +0400
3212 @@ -0,0 +1,70 @@
3213 +<div id='dom_upd'>
3214 +
3215 + % my $btn = l('ADD');
3216 +
3217 + %= form_for '/domainupd' => (method => 'POST') => begin
3218 + <p>
3219 + <h2>
3220 + % if ( $dom_datas->{trt} eq "ADD" ) {
3221 + %=l 'dom_CREATE_TITLE'
3222 + % } else {
3223 + %=l 'dom_MODIFY_TITLE'
3224 + % $btn = l('MODIFY');
3225 + % }
3226 + </h2>
3227 + </p>
3228 +
3229 + <p><br>
3230 + <span class=label>
3231 + %=l 'DOMAIN_NAME', class => 'label'
3232 + </span><span class=data>
3233 + % if ( $dom_datas->{trt} eq "ADD" ) {
3234 + % param 'Domain' => $dom_datas->{domain} unless param 'Domain';
3235 + %= text_field 'Domain', class => 'input'
3236 + % } else {
3237 + %= hidden_field 'Domain' => $dom_datas->{domain}
3238 + %= $dom_datas->{domain}, class => 'data'
3239 + % }
3240 + </span>
3241 + </p>
3242 +
3243 + <p><br>
3244 + <span class=label>
3245 + %=l 'DESCRIPTION_BRIEF', class => 'label'
3246 + </span><span class=data>
3247 + % param 'Description' => $dom_datas->{description} unless param 'Description';
3248 + %= text_field 'Description', class => 'input'
3249 + </span>
3250 + </p>
3251 +
3252 + <p><br>
3253 + %=l 'dom_CONTENT_FIELD_DESCRIPTION'
3254 + <br>
3255 + <span class=label>
3256 + %= $c->l('dom_CONTENT', '');
3257 + </span><span class=data>
3258 + % param 'Content' => $dom_datas->{content} unless param 'Content';
3259 + %= select_field 'Content', $c->content_options_list(), class => 'input'
3260 + </span>
3261 + </p>
3262 +
3263 + <p><br>
3264 + %=l 'dom_DESC_NAMESERVERS'
3265 + <br>
3266 + <span class=label>
3267 + %=l 'dom_LABEL_NAMESERVERS', class => 'label'
3268 + </span><span class=data>
3269 + % param 'Nameservers' => $dom_datas->{nameservers} unless param 'Nameservers';
3270 + %= select_field 'Nameservers', $c->nameserver_options_list(), class => 'input'
3271 + </span>
3272 + </p>
3273 +
3274 + <p><br>
3275 + %= submit_button "$btn", class => 'action'
3276 + </p>
3277 +
3278 + %= hidden_field 'trt' => $dom_datas->{trt}
3279 +
3280 + %end
3281 +
3282 +</div>
3283 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_footer.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_footer.html.ep
3284 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_footer.html.ep 2020-01-27 00:12:51.000000000 +0400
3285 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_footer.html.ep 2020-02-02 23:10:58.000000000 +0400
3286 @@ -5,5 +5,4 @@
3287 Copyright 1999-2006 Mitel Corporation<br>
3288 <%= session 'copyRight' %>
3289 <br>Copyright (c) 2013-2016 Koozali Foundation Inc.<br>
3290 -Theme: <%= session 'CurrentTheme' %><br>
3291 </font>
3292 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_grp_add.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_grp_add.html.ep
3293 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_grp_add.html.ep 2020-01-25 20:54:20.000000000 +0400
3294 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_grp_add.html.ep 2020-02-02 20:32:42.000000000 +0400
3295 @@ -1,4 +1,4 @@
3296 -<div id='prt_add'>
3297 +<div id='grp_add'>
3298
3299 % my $btn = l('ADD');
3300
3301 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_head.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_head.html.ep
3302 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_head.html.ep 2020-01-22 15:34:30.000000000 +0400
3303 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_head.html.ep 2020-02-02 21:11:18.000000000 +0400
3304 @@ -1 +1 @@
3305 - <script type="text/javascript" src="js/navigation.js"></script>
3306 + <!-- script type="text/javascript" src="js/navigation2.js"></script> -->
3307 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_del.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_del.html.ep
3308 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_del.html.ep 1970-01-01 04:00:00.000000000 +0400
3309 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_del.html.ep 2020-02-10 11:14:19.000000000 +0400
3310 @@ -0,0 +1,29 @@
3311 +<div id='hos_del'>
3312 +
3313 + % my $btn = l('REMOVE');
3314 + %= form_for '/hostentryd' => (method => 'POST') => begin
3315 + <p>
3316 + <h2>
3317 + %=l 'hos_REMOVE_TITLE'
3318 + </h2>
3319 + </p>
3320 +
3321 + <p>
3322 + %= $c->l('hos_REMOVE_PAGE_DESCRIPTION', $hos_datas->{hostname});
3323 + </p>
3324 +
3325 + <p><b>
3326 + %=l 'hos_ABOUT_TO_REMOVE'
3327 + <b></p>
3328 +
3329 + <p>
3330 + <br>
3331 + %= submit_button "$btn", class => 'action'
3332 + </p>
3333 +
3334 + %= hidden_field 'trt' => $hos_datas->{trt}
3335 + %= hidden_field 'Hostname' => $hos_datas->{hostname}
3336 +
3337 + % end
3338 +
3339 +</div>
3340 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_list.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_list.html.ep
3341 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_list.html.ep 1970-01-01 04:00:00.000000000 +0400
3342 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_list.html.ep 2020-02-15 17:50:05.000000000 +0400
3343 @@ -0,0 +1,69 @@
3344 +<div id='hos_list'>
3345 +
3346 + % my $btn = l('hos_ADD_HOSTNAME');
3347 +
3348 + %= form_for '/hostentries' => (method => 'POST') => begin
3349 +
3350 + <p>
3351 + %= submit_button "$btn", class => 'action'
3352 + <br></p>
3353 +
3354 + % my %dom_hos = %{$dom_hosts};
3355 + % foreach my $domain ( sort ( keys %dom_hos ) ) {
3356 +
3357 + <p><br><b>
3358 + %= $c->l('hos_CURRENT_HOSTNAMES_FOR_LOCAL_DOMAIN', $domain);
3359 + </b><br></p>
3360 +
3361 + <table class="sme-border"><tbody>
3362 + <tr>
3363 + <th class='sme-border'>
3364 + %=l 'hos_HOSTNAME'
3365 + </th>
3366 + <th class='sme-border'>
3367 + %=l 'hos_HOSTTYPE'
3368 + </th>
3369 + <th class='sme-border'>
3370 + %=l 'IP_ADDRESS_OR_FQDN'
3371 + </th>
3372 + <th class='sme-border'>
3373 + %=l 'hos_ETHERNET_ADDRESS'
3374 + </th>
3375 + <th class='sme-border'>
3376 + %=l 'COMMENT'
3377 + </th>
3378 + <th class='sme-border' colspan='2'>
3379 + %=l 'ACTION'
3380 + </th>
3381 + </tr>
3382 +
3383 + % foreach (@{$dom_hos{$domain}{'HOSTS'}}) {
3384 + <tr>
3385 + %= t td => (class => 'sme-border') => $_->{'HostName'};
3386 + %= t td => (class => 'sme-border') => $_->{'HostType'};
3387 + %= t td => (class => 'sme-border') => $_->{'IP'};
3388 + %= t td => (class => 'sme-border') => $_->{'MACAddress'};
3389 + %= t td => (class => 'sme-border') => $_->{'Comment'};
3390 + % my ($actionModify, $actionRemove) = '&nbsp;';
3391 + % if ($_->{'static'} ne 'yes') {
3392 + % $actionModify = "<a href='hostentryd?trt=UPD&Hostname=" . $_->{'HostName'} . "'>" . l('MODIFY') . "</a>";
3393 + % $actionRemove = "<a href='hostentryd?trt=DEL&Hostname=" . $_->{'HostName'} . "'>" . l('REMOVE') . "</a>";
3394 + % }
3395 + <td class='sme-border'><%= $c->render_to_string(inline => $actionModify) %></td>
3396 + <td class='sme-border'><%= $c->render_to_string(inline => $actionRemove) %></td>
3397 +
3398 + </tr>
3399 +
3400 + % }
3401 +
3402 + </tbody>
3403 + </table>
3404 + </p>
3405 +
3406 + % }
3407 +
3408 + %= hidden_field 'trt' => $hos_datas->{trt}
3409 +
3410 + % end
3411 +
3412 +</div>
3413 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_ulc.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_ulc.html.ep
3414 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_ulc.html.ep 1970-01-01 04:00:00.000000000 +0400
3415 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_ulc.html.ep 2020-02-10 20:45:24.000000000 +0400
3416 @@ -0,0 +1,60 @@
3417 +<div id='hos_ulc'>
3418 +<!-- UPDATE HOST TYPE -->
3419 +
3420 + % my $btn = l('NEXT');
3421 +
3422 + %= form_for '/hostentryd' => (method => 'POST') => begin
3423 + <p><h2>
3424 + % if ( $hos_datas->{trt} eq "ALC" ) {
3425 + %=l 'hos_CREATE_TYPE'
3426 + % } else {
3427 + %=l 'hos_MODIFY_TYPE'
3428 + % $btn = l('MODIFY');
3429 + % }
3430 + </h2></p>
3431 +
3432 + <p>
3433 + %=l 'hos_LOCAL_PAGE_DESCRIPTION'
3434 + </p>
3435 +
3436 + <p>
3437 + %=l 'hos_LOCAL_IP_DESCRIPTION'
3438 + </p>
3439 +
3440 + <p>
3441 + <span class=label>
3442 + %=l 'hos_LOCAL_IP', class => 'label'
3443 + </span><span class=data>
3444 + % param 'Internalip' => $hos_datas->{internalip} unless param 'Internalip';
3445 + %= text_field 'Internalip', class => 'input'
3446 + </span>
3447 + </p>
3448 +
3449 + <p>
3450 + %=l 'hos_ETHERNET_ADDRESS_DESCRIPTION'
3451 + </p>
3452 +
3453 + <p>
3454 + <span class=label>
3455 + %=l 'hos_ETHERNET_ADDRESS', class => 'label'
3456 + </span><span class=data>
3457 + % param 'Macaddress' => $hos_datas->{macaddress} unless param 'Macaddress';
3458 + %= text_field 'Macaddress', class => 'input'
3459 + </span>
3460 + </p>
3461 +
3462 + <p><br>
3463 + %= submit_button "$btn", class => 'action'
3464 + </p>
3465 +
3466 + %= hidden_field 'trt' => $hos_datas->{trt}
3467 + %= hidden_field 'Hostname' => $hos_datas->{hostname}
3468 + %= hidden_field 'Name' => $hos_datas->{name}
3469 + %= hidden_field 'Domain' => $hos_datas->{domain}
3470 + %= hidden_field 'Comment'=> $hos_datas->{comment}
3471 + %= hidden_field 'Hosttype'=> $hos_datas->{hosttype}
3472 + %= hidden_field 'Externalip' => $hos_datas->{externalip}
3473 +
3474 + %end
3475 +
3476 +</div>
3477 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_upd.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_upd.html.ep
3478 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_upd.html.ep 1970-01-01 04:00:00.000000000 +0400
3479 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_upd.html.ep 2020-02-10 20:40:30.000000000 +0400
3480 @@ -0,0 +1,77 @@
3481 +<div id='hos_upd'>
3482 +
3483 + % my $btn = l('NEXT');
3484 +
3485 + %= form_for '/hostentryd' => (method => 'POST') => begin
3486 + <p><h2>
3487 + % if ( $hos_datas->{trt} eq "ADD" ) {
3488 + %=l 'hos_CREATE_TITLE'
3489 + % } else {
3490 + %=l 'hos_MODIFY_TITLE'
3491 + % $btn = l('MODIFY');
3492 + % }
3493 + </h2></p>
3494 +
3495 + <p>
3496 + %=l 'hos_HOSTNAME_DESCRIPTION'
3497 + </p>
3498 +
3499 + <p>
3500 + <span class=label>
3501 + %=l 'hos_HOSTNAME', class => 'label'
3502 + </span><span class=data>
3503 + % if ( $hos_datas->{trt} eq "ADD" ) {
3504 + % param 'Name' => $hos_datas->{name} unless param 'Name';
3505 + %= text_field 'Name', class => 'input'
3506 + % } else {
3507 + %= hidden_field 'Name' => $hos_datas->{name}
3508 + %= $hos_datas->{name}, class => 'data'
3509 + % }
3510 + </span>
3511 + </p>
3512 +
3513 + <p>
3514 + <span class=label>
3515 + %=l 'DOMAIN', class => 'label'
3516 + </span><span class=data>
3517 + % if ( $hos_datas->{trt} eq "ADD" ) {
3518 + % param 'Domain' => $hos_datas->{domain} unless param 'Domain';
3519 + %= select_field 'Domain', $c->domains_list(), class => 'input'
3520 + % } else {
3521 + %= hidden_field 'Domain' => $hos_datas->{domain}
3522 + %= $hos_datas->{domain}, class => 'data'
3523 + % }
3524 + </span>
3525 + </p>
3526 +
3527 + <p>
3528 + <span class=label>
3529 + %= $c->l('COMMENT', '');
3530 + </span><span class=data>
3531 + % param 'Comment' => $hos_datas->{comment} unless param 'Comment';
3532 + %= text_field 'Comment', class => 'input'
3533 + </span>
3534 + </p>
3535 +
3536 + <p>
3537 + <span class=label>
3538 + %=l 'LOCATION', class => 'label'
3539 + </span><span class=data>
3540 + % param 'Hosttype' => $hos_datas->{hosttype} unless param 'Hosttype';
3541 + %= select_field 'Hosttype', $c->hosttype_list(), class => 'input'
3542 + </span>
3543 + </p>
3544 +
3545 + <p><br>
3546 + %= submit_button "$btn", class => 'action'
3547 + </p>
3548 +
3549 + %= hidden_field 'trt' => $hos_datas->{trt}
3550 + %= hidden_field 'Hostname' => $hos_datas->{hostname}
3551 + %= hidden_field 'Internalip' => $hos_datas->{internalip}
3552 + %= hidden_field 'Externalip' => $hos_datas->{externalip}
3553 + %= hidden_field 'Macaddress' => $hos_datas->{macaddress}
3554 +
3555 + %end
3556 +
3557 +</div>
3558 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_urm.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_urm.html.ep
3559 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_urm.html.ep 1970-01-01 04:00:00.000000000 +0400
3560 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_hos_urm.html.ep 2020-02-11 22:40:27.000000000 +0400
3561 @@ -0,0 +1,37 @@
3562 +<div id='hos_urm'>
3563 +<!-- UPDATE HOST TYPE -->
3564 +
3565 + % my $btn = l('MODIFY');
3566 +
3567 + %= form_for '/hostentryd' => (method => 'POST') => begin
3568 +
3569 + <p>
3570 + %=l 'hos_REMOTE_PAGE_DESCRIPTION'
3571 + </p>
3572 +
3573 + <p>
3574 + <span class=label>
3575 + %=l 'IP_ADDRESS_OR_FQDN', class => 'label'
3576 + </span><span class=data>
3577 + % param 'Externalip' => $hos_datas->{externalip} unless param 'Externalip';
3578 + %= text_field 'Externalip', class => 'input'
3579 + </span>
3580 + </p>
3581 +
3582 +
3583 + <p><br>
3584 + %= submit_button "$btn", class => 'action'
3585 + </p>
3586 +
3587 + %= hidden_field 'trt' => $hos_datas->{trt}
3588 + %= hidden_field 'Hostname' => $hos_datas->{hostname}
3589 + %= hidden_field 'Name' => $hos_datas->{name}
3590 + %= hidden_field 'Domain' => $hos_datas->{domain}
3591 + %= hidden_field 'Comment'=> $hos_datas->{comment}
3592 + %= hidden_field 'Hosttype'=> $hos_datas->{hosttype}
3593 + %= hidden_field 'Internalip' => $hos_datas->{internalip}
3594 + %= hidden_field 'Macaddress' => $hos_datas->{macaddress}
3595 +
3596 + %end
3597 +
3598 +</div>
3599 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_add.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_add.html.ep
3600 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_add.html.ep 1970-01-01 04:00:00.000000000 +0400
3601 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_add.html.ep 2020-02-03 23:14:55.000000000 +0400
3602 @@ -0,0 +1,39 @@
3603 +<div id='pse_add'>
3604 +
3605 + % my $btn = l('ADD');
3606 +
3607 + %= form_for '/pseudoadd' => (method => 'POST') => begin
3608 + <p>
3609 + <h2>
3610 + %=l 'pse_TITLE_CREATE'
3611 + </h2>
3612 + <br>
3613 + %= $c->render_to_string(inline => l('pse_VALID_PSEUDONYM_NAMES'));
3614 + </p>
3615 +
3616 + <p>
3617 + <span class=label>
3618 + %=l 'pse_PSEUDONYM_NAME', class => 'label'
3619 + </span><span class=data>
3620 + %= text_field 'Pseudonym', class => 'input'
3621 + </span>
3622 + </p>
3623 +
3624 + <p>
3625 + <span class=label>
3626 + %=l 'pse_SELECT_ACCOUNT', class => 'label'
3627 + </span><span class=data>
3628 + %= select_field 'Account' => $c->existing_accounts_list(), class => 'input'
3629 + </span>
3630 + </p>
3631 +
3632 + <p>
3633 + <br><br>
3634 + %= submit_button "$btn", class => 'action'
3635 + </p>
3636 +
3637 + %= hidden_field 'trt' => $pse_datas->{trt}
3638 +
3639 + % end
3640 +
3641 +</div>
3642 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_del.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_del.html.ep
3643 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_del.html.ep 1970-01-01 04:00:00.000000000 +0400
3644 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_del.html.ep 2020-02-05 17:13:41.000000000 +0400
3645 @@ -0,0 +1,25 @@
3646 +<div id='pse_del'>
3647 +
3648 + % my $btn = l('REMOVE');
3649 + %= form_for '/pseudodel' => (method => 'POST') => begin
3650 + <p>
3651 + <h2>
3652 + %=l 'pse_REMOVE_PSEUDONYM'
3653 + </h2>
3654 +
3655 + <p>
3656 + %= $c->render_to_string(inline => l('pse_ABOUT_TO_REMOVE', $pse_datas->{pseudonym}));
3657 +
3658 + </p>
3659 +
3660 + <p>
3661 + <br>
3662 + %= submit_button "$btn", class => 'action'
3663 + </p>
3664 +
3665 + %= hidden_field 'trt' => $pse_datas->{trt}
3666 + %= hidden_field 'Pseudonym' => $pse_datas->{pseudonym}
3667 +
3668 + % end
3669 +
3670 +</div>
3671 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_list.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_list.html.ep
3672 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_list.html.ep 1970-01-01 04:00:00.000000000 +0400
3673 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_list.html.ep 2020-02-05 22:15:20.000000000 +0400
3674 @@ -0,0 +1,78 @@
3675 +<div id='pse_list'>
3676 +
3677 +
3678 + % my $btn = l('pse_CLICK_TO_CREATE');
3679 +
3680 + %= $c->render_to_string(inline => l('pse_DESCRIPTION'));
3681 +
3682 + %= form_for '/pseudonyms' => (method => 'POST') => begin
3683 +
3684 + <p>
3685 + <br>
3686 + %= submit_button "$btn", class => 'action'
3687 + </p>
3688 +
3689 + <p>
3690 + <h2>
3691 + %=l 'pse_CURRENT_PSEUDONYMS'
3692 + </h2>
3693 + <br>
3694 + % my $numPseudonyms = @$pseudonyms;
3695 + % if ($numPseudonyms == 0){
3696 + %=l 'pse_ACCOUNT_PSEUDONYM_NONE'
3697 + % } else {
3698 + <table class="sme-border"><tbody>
3699 + <tr>
3700 + <th class='sme-border'>
3701 + %=l 'pse_PSEUDONYM'
3702 + </th>
3703 + <th class='sme-border'>
3704 + %=l 'pse_USER_OR_GROUP'
3705 + </th>
3706 + <th class='sme-border' colspan='2'>
3707 +
3708 + %=l 'ACTION'
3709 + </th>
3710 + </tr>
3711 +
3712 + % foreach my $pseudonym ( @$pseudonyms )
3713 + % {
3714 + % my $modifiable = $pseudonym->prop('Changeable') || 'yes';
3715 + % my $removable = $pseudonym->prop('Removable') || 'yes';
3716 +
3717 + % my $account = $pseudonym->prop('Account');
3718 + % $account = "Administrator" if ($account eq "admin");
3719 + % $account = $c->l("pse_EVERYONE") if ($account eq "shared");
3720 +
3721 + % my $visible = $pseudonym->prop('Visible');
3722 + % $account .= $c->l("pse_LOCAL_ONLY")
3723 + % if (defined $visible && $visible eq "internal");
3724 +
3725 + <tr>
3726 + %= t td => (class => 'sme-border') => $pseudonym->key
3727 + %= t td => (class => 'sme-border') => $account
3728 +
3729 + % my ($actionModify, $actionRemove) = '&nbsp;';
3730 + % if ($modifiable eq 'yes') {
3731 + % $actionModify = "<a href='pseudoupd?trt=UPD&pseudonym=" . $pseudonym->key . "'>" . l('MODIFY') . "</a>";
3732 + % }
3733 + % if ($removable eq 'yes') {
3734 + % $actionRemove = "<a href='pseudodel?trt=DEL&pseudonym=" . $pseudonym->key . "'>" . l('REMOVE') . "</a>";
3735 + % }
3736 +
3737 + <td class='sme-border'><%= $c->render_to_string(inline => $actionModify) %></td>
3738 + <td class='sme-border'><%= $c->render_to_string(inline => $actionRemove) %></td>
3739 + </tr>
3740 +
3741 + % }
3742 + </tbody>
3743 + </table>
3744 + <%} %>
3745 + </p>
3746 +
3747 + %= hidden_field 'trt' => $pse_datas->{trt}
3748 +
3749 + % end
3750 +
3751 +</div>
3752 +
3753 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_upd.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_upd.html.ep
3754 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_upd.html.ep 1970-01-01 04:00:00.000000000 +0400
3755 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_pse_upd.html.ep 2020-02-05 17:13:28.000000000 +0400
3756 @@ -0,0 +1,53 @@
3757 +<div id='pse_upd'>
3758 +
3759 + % my $btn = l('SAVE');
3760 +
3761 + %= form_for '/pseudoupd' => (method => 'POST') => begin
3762 + <p>
3763 + <h2>
3764 + %=l 'pse_MODIFY_PSEUDONYM'
3765 + </h2>
3766 + <br>
3767 + %=l 'pse_DESC_PSEUDONYM_NAME'
3768 + </p>
3769 +
3770 + <p>
3771 + <span class=label>
3772 + %=l 'pse_PSEUDONYM_NAME', class => 'label'
3773 + </span><span class=data>
3774 + %= $pse_datas->{pseudonym}, class => 'data'
3775 + </span>
3776 + </p>
3777 +
3778 + <p>
3779 + <span class=label>
3780 + %=l 'pse_SELECT_ACCOUNT', class => 'label'
3781 + </span><span class=data>
3782 + % param 'Account' => $pse_datas->{account} unless param 'Account';
3783 + %= select_field 'Account' => $c->existing_accounts_list(), class => 'input'
3784 + </span>
3785 + </p>
3786 +
3787 + %if ( $c->is_pseudonym_not_removable( $pse_datas->{pseudonym} ) ) {
3788 +
3789 + <p>
3790 + <span class=label>
3791 + %=l 'pse_SELECT_INTERNAL', class => 'label'
3792 + </span><span class=data>
3793 + % param 'Internal' => $pse_datas->{internal} unless param 'Internal';
3794 + %= select_field 'Internal' => [ [(l 'YES') => 'YES'], [(l 'NO') => 'NO'] ], class => 'input'
3795 + </span>
3796 + </p>
3797 +
3798 + %}
3799 +
3800 + <p>
3801 + %= submit_button "$btn", class => 'action'
3802 + </p>
3803 +
3804 + %= hidden_field 'trt' => $pse_datas->{trt}
3805 + %= hidden_field 'Pseudonym' => $pse_datas->{pseudonym}
3806 +
3807 + %end
3808 +
3809 +</div>
3810 diff -urN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/pseudonyms.html.ep smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/pseudonyms.html.ep
3811 --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/pseudonyms.html.ep 1970-01-01 04:00:00.000000000 +0400
3812 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/pseudonyms.html.ep 2020-02-05 20:53:58.000000000 +0400
3813 @@ -0,0 +1,34 @@
3814 +% layout 'default', title => "Sme server 2 - pseudonyms", share_dir => './';
3815 +
3816 +% content_for 'module' => begin
3817 +<div id="module">
3818 +
3819 + % if ($config->{debug} == 1) {
3820 + <p>
3821 + %= dumper $c->current_route
3822 + %= dumper $pse_datas
3823 + </p>
3824 + % }
3825 +
3826 + <h1><%= $title%></h1>
3827 +
3828 + % if ( $notif ) {
3829 + <br>
3830 + <span class=sme-error>
3831 + %= $notif
3832 + </span>
3833 + %}
3834 +
3835 +
3836 + % if ($pse_datas->{trt} eq 'ADD') {
3837 + %= include 'partials/_pse_add'
3838 + %} elsif ($pse_datas->{trt} eq 'DEL') {
3839 + %= include 'partials/_pse_del'
3840 + %} elsif ($pse_datas->{trt} eq 'UPD') {
3841 + %= include 'partials/_pse_upd'
3842 + %} else {
3843 + %= include 'partials/_pse_list'
3844 + %}
3845 +
3846 +</div>
3847 +%end

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