/[smeserver]/rpms/e-smith-portforwarding/sme7/e-smith-portforwarding-2.2.0-fwd2local_serveronly.patch
ViewVC logotype

Contents of /rpms/e-smith-portforwarding/sme7/e-smith-portforwarding-2.2.0-fwd2local_serveronly.patch

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


Revision 1.1 - (show annotations) (download)
Thu Jun 3 14:02:36 2010 UTC (14 years, 6 months ago) by slords
Branch: MAIN
CVS Tags: e-smith-portforwarding-2_0_0-3_el4_sme, HEAD
* Thu Mar 11 2010 Jonathan Martens <smeserver-contribs@snetram.nl> 2.0.0-3.sme
- Enable port forwards to localhost if mode is serveronly [SME: 5849]

1 diff -Naur e-smith-portforwarding-2.2.0-old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/portforwarding e-smith-portforwarding-2.2.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/portforwarding
2 --- e-smith-portforwarding-2.2.0-old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/portforwarding 2009-12-15 21:36:17.000000000 +0100
3 +++ e-smith-portforwarding-2.2.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/portforwarding 2009-12-15 21:38:40.000000000 +0100
4 @@ -162,7 +162,7 @@
5 <base>IN_SERVERONLY</base>
6 <trans>
7 This server is currently in serveronly mode and portforwarding
8 - is not possible.
9 + is possible only to localhost.
10 </trans>
11 </entry>
12 </lexicon>
13 diff -Naur e-smith-portforwarding-2.2.0-old/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/portforwarding.pm e-smith-portforwarding-2.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/portforwarding.pm
14 --- e-smith-portforwarding-2.2.0-old/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/portforwarding.pm 2009-12-15 21:36:17.000000000 +0100
15 +++ e-smith-portforwarding-2.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/portforwarding.pm 2009-12-15 21:37:32.000000000 +0100
16 @@ -115,22 +115,13 @@
17 $forwards{TCP} = \@tcpforwards;
18 $forwards{UDP} = \@udpforwards;
19
20 - my $systemmode = $db->get_value('SystemMode');
21 -
22 - unless ($systemmode eq 'serveronly')
23 - {
24 - print $q->Tr(
25 - $q->td({-colspan => 2},
26 - '<br>' .
27 - $q->a({-class => "button-like",
28 - -href => "portforwarding?page=0&page_stack=&Next=Create"},
29 - $self->localise('CREATE_RULE'))));
30 - }
31 + print $q->Tr(
32 + $q->td({-colspan => 2},
33 + '<br>' .
34 + $q->a({-class => "button-like",
35 + -href => "portforwarding?page=0&page_stack=&Next=Create"},
36 + $self->localise('CREATE_RULE'))));
37
38 - if ($systemmode eq 'serveronly')
39 - {
40 - $empty = 1;
41 - }
42 unless ($empty) {
43 print $q->Tr(
44 $q->td({-colspan => 2},
45 @@ -215,12 +206,6 @@
46 print '</td></tr>';
47
48 }
49 - elsif ($systemmode eq 'serveronly')
50 - {
51 - print $q->Tr(
52 - $q->td({-colspan => 2}, '<br>' .
53 - $self->localise('IN_SERVERONLY')));
54 - }
55 else {
56 print $q->Tr(
57 $q->td({-colspan => 2}, '<br>' .
58 @@ -428,7 +413,7 @@
59 $dhost =~ s/^\s+|\s+$//g;
60
61 my $localip = $db->get_prop('InternalInterface', 'IPAddress');
62 - my $external_ip = $db->get_prop('ExternalInterface', 'IPAddress');
63 + my $external_ip = $db->get_prop('ExternalInterface', 'IPAddress') || $localip;
64
65 if ($dhost =~ /^(localhost|127.0.0.1|$localip|$external_ip)$/i)
66 {
67 @@ -437,6 +422,12 @@
68 return "OK";
69 }
70
71 + my $systemmode = $db->get_value('SystemMode');
72 +
73 + if ($systemmode eq 'serveronly') {
74 + return $self->localise('IN_SERVERONLY');
75 + }
76 +
77 if (isValidIP($dhost)) {
78 return 'OK';
79 }
80 @@ -518,9 +509,6 @@
81
82 print $q->p($description);
83
84 - my $localip = $db->get_prop('InternalInterface', 'IPAddress');
85 - my $external_ip = $db->get_prop('ExternalInterface', 'IPAddress');
86 -
87 my $dhost = $self->get_destination_host();
88 foreach my $tablearrayref (
89 [$self->localise('LABEL_PROTOCOL')
90 @@ -675,7 +663,7 @@
91 my $q = $self->{cgi};
92 my $dhost = $q->param("destination_host");
93 my $localip = $db->get_prop('InternalInterface', 'IPAddress');
94 - my $external_ip = $db->get_prop('ExternalInterface', 'IPAddress');
95 + my $external_ip = $db->get_prop('ExternalInterface', 'IPAddress') || $localip;
96
97 if ($dhost =~ /^(127.0.0.1|$localip|$external_ip)$/i)
98 {

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