diff -Nur e-smith-base-5.2.0-old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess e-smith-base-5.2.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess
--- e-smith-base-5.2.0-old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess 2014-04-05 17:51:15.278940872 +0200
+++ e-smith-base-5.2.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/remoteaccess 2014-04-06 10:27:07.542188253 +0200
@@ -48,6 +48,10 @@
Number of PPTP clients
+ NUMBER_OF_PPTP_CLIENTS_MUST_BE_LESSER_THAN_NUMBER_OF_IP_IN_DHCP_RANGE
+ The number of pptp clients is greater than the number of reserved IP for DHCP. You should take a smaller number.
+
+
LABEL_SSH_PORT
TCP Port for secure shell access
diff -Nur e-smith-base-5.2.0-old/root/etc/e-smith/web/functions/remoteaccess e-smith-base-5.2.0/root/etc/e-smith/web/functions/remoteaccess
--- e-smith-base-5.2.0-old/root/etc/e-smith/web/functions/remoteaccess 2014-04-05 17:51:15.278940872 +0200
+++ e-smith-base-5.2.0/root/etc/e-smith/web/functions/remoteaccess 2014-04-06 09:20:55.799381623 +0200
@@ -113,7 +113,7 @@
-
DESC_PPTP
diff -Nur e-smith-base-5.2.0-old/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/remoteaccess.pm e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/remoteaccess.pm
--- e-smith-base-5.2.0-old/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/remoteaccess.pm 2014-04-05 17:51:15.298943308 +0200
+++ e-smith-base-5.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/remoteaccess.pm 2014-04-06 10:25:12.267521705 +0200
@@ -31,6 +31,7 @@
use File::Basename;
use Exporter;
use Carp;
+use Socket qw( inet_aton );
our @ISA = qw(esmith::FormMagick Exporter);
@@ -40,7 +41,7 @@
show_valid_from_list add_new_valid_from remove_valid_from
validate_network_and_mask ip_number_or_blank subnet_mask_or_blank
show_telnet_section get_serial_console show_ftp_section
- get_ipsecrw_sessions show_ipsecrw_section
+ get_ipsecrw_sessions show_ipsecrw_section pptp_and_dhcp_range
);
@@ -370,6 +371,36 @@
=pod
+=head2 pptp_and_dhcp_range
+
+Validate the input of pptp session if it is not superior than the maximum number of ip between dhcpd_start and dhcpd_end
+
+=cut
+
+sub pptp_and_dhcp_range
+{
+ my $self = shift;
+ my $val = shift || 0;
+ my $dhcp_status = $db->get_prop('dhcpd','status') || 'disabled';
+ my $dhcp_end = $db->get_prop('dhcpd','end') || '';
+ my $dhcp_start = $db->get_prop('dhcpd','start') || '';
+
+ if ( $dhcp_status eq 'enabled' )
+ {
+ my $ip_start = unpack 'N', inet_aton($dhcp_start);
+ my $ip_end = unpack 'N', inet_aton($dhcp_end);
+ my $ip_count = $ip_end - $ip_start;
+ return 'OK' if( $val < $ip_count );
+ return $self->localise('NUMBER_OF_PPTP_CLIENTS_MUST_BE_LESSER_THAN_NUMBER_OF_IP_IN_DHCP_RANGE');
+ }
+ else
+ {
+ return 'OK';
+ }
+}
+
+=pod
+
=head2 _get_valid_from
Reads the ValidFrom property of config entry httpd-admin and returns a list