1 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm |
2 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2023-12-19 09:44:56.678590486 +0000 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2023-12-19 09:44:56.678590486 +0000 |
3 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2024-01-22 19:57:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/lib/SrvMngr/Controller/Dhcpd.pm 2024-01-23 10:14:00.000000000 +0000 |
4 |
@@ -140,12 +140,12 @@ |
@@ -140,12 +140,12 @@ |
5 |
my $c = shift; |
my $c = shift; |
6 |
my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE"); |
my $title = $c->l("dhcpd_SCANNING_NETWORK_TITLE"); |
31 |
return ; |
return ; |
32 |
} |
} |
33 |
|
|
34 |
@@ -352,17 +352,17 @@ |
@@ -350,19 +350,19 @@ |
35 |
|
# delete it |
36 |
|
# If deletion not ok return message |
37 |
# else return "ok" |
# else return "ok" |
38 |
my $ret = delete_lease($c); |
- my $ret = delete_lease($c); |
39 |
|
+ my $ret = delete_one_lease($c); |
40 |
if ($ret == 'ok') { |
if ($ret == 'ok') { |
41 |
- dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
- dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
42 |
+ $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
+ $dhcp_data{"success"}="dhcpd_SUCCESSFULLY_SAVED_SETTINGS"; |
71 |
return "ok"; |
return "ok"; |
72 |
} |
} |
73 |
|
|
74 |
@@ -391,6 +391,169 @@ |
@@ -391,6 +391,171 @@ |
75 |
return @leases; |
return @leases; |
76 |
} |
} |
77 |
|
|
96 |
+ ###Pull CGI object from parameters array |
+ ###Pull CGI object from parameters array |
97 |
+ my $c = shift; |
+ my $c = shift; |
98 |
+ |
+ |
99 |
|
+#my $fred = 1/0; |
100 |
|
+ |
101 |
+ ###Pull entry to delete |
+ ###Pull entry to delete |
102 |
+ my $ip = $c->param('host'); |
+ my $ip = $c->param('ip'); |
103 |
+ my $name = $c->param('name'); |
+ my $name = $c->param('name'); |
104 |
+ my $name_in_file = '/var/lib/dhcpd/dhcpd.leases' ; |
+ my $name_in_file = '/var/lib/dhcpd/dhcpd.leases' ; |
105 |
+ my $name_tmp_file = '/var/lib/dhcpd/dhcpd.leases.tmp' ; |
+ my $name_tmp_file = '/var/lib/dhcpd/dhcpd.leases.tmp' ; |
243 |
#========================================================================= |
#========================================================================= |
244 |
# Procedure qui charge le dhcpd.conf |
# Procedure qui charge le dhcpd.conf |
245 |
# retourne un tableau contenant les informations |
# retourne un tableau contenant les informations |
246 |
@@ -536,4 +699,4 @@ |
@@ -536,4 +701,4 @@ |
247 |
|
|
248 |
1; |
1; |
249 |
|
|
437 |
+1; |
+1; |
438 |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep |
diff -urN smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep |
439 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2023-12-19 09:44:56.681590497 +0000 |
--- smeserver-dhcpmanager-2.0.4.old/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2023-12-19 09:44:56.681590497 +0000 |
440 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2024-01-20 11:29:00.000000000 +0000 |
+++ smeserver-dhcpmanager-2.0.4/root/usr/share/smanager/themes/default/templates/partials/_dhcpd_leases.html.ep 2024-01-23 10:12:00.000000000 +0000 |
441 |
@@ -1,17 +1,17 @@ |
@@ -1,17 +1,17 @@ |
442 |
<div id='dhcpd-leases'> |
<div id='dhcpd-leases'> |
443 |
<table><tr><td> |
<table><tr><td> |
485 |
% foreach my $ip (@$leases) { |
% foreach my $ip (@$leases) { |
486 |
<tr> |
<tr> |
487 |
%= t td => (class => 'sme-border') => $ip->{ip} |
%= t td => (class => 'sme-border') => $ip->{ip} |
488 |
@@ -66,9 +68,12 @@ |
@@ -65,9 +67,7 @@ |
489 |
|
%= t td => (class => 'sme-border') => $ip->{end} |
490 |
%= t td => (class => 'sme-border') => $ip->{mac} |
%= t td => (class => 'sme-border') => $ip->{mac} |
491 |
<td class = 'sme-border'> |
<td class = 'sme-border'> |
492 |
<a href="/smanager/dhcpd6?trt=DEL&ip=<%= $ip->{ip}%>" onclick="Remove_lease_confirm(event,'<%=$c->l('dhcpd_REMOVE_A_DHCP_LEASE_ACTION')%>',this);"><center><%=l 'dhcpd_REMOVE'%></center></a> |
- <a href="/smanager/dhcpd6?trt=DEL&ip=<%= $ip->{ip}%>" onclick="Remove_lease_confirm(event,'<%=$c->l('dhcpd_REMOVE_A_DHCP_LEASE_ACTION')%>',this);"><center><%=l 'dhcpd_REMOVE'%></center></a> |
493 |
- </td><td class = 'sme-border'> |
- </td><td class = 'sme-border'> |
494 |
+ </td> |
- <a href="/smanager/dhcpd8?trt=WIN&ip=<%= $ip->{ip}%>" onclick="Winpop_confirm(event,'<%=$c->l('dhcpd_SENDING_A_WINPOPUP')%>',this);"><center><%=l 'dhcpd_WINPOPUP_ACTION'%></center></a> |
495 |
+ <!-- |
+ <a href="/smanager/dhcpd6?trt=DEL&ip=<%= $ip->{ip}%>&name=<%= $ip->{name}%>" onclick="Remove_lease_confirm(event,'<%=$c->l('dhcpd_REMOVE_A_DHCP_LEASE_ACTION')%>',this);"><center><%=l 'dhcpd_REMOVE'%></center></a> |
|
+ <td class = 'sme-border'> |
|
|
<a href="/smanager/dhcpd8?trt=WIN&ip=<%= $ip->{ip}%>" onclick="Winpop_confirm(event,'<%=$c->l('dhcpd_SENDING_A_WINPOPUP')%>',this);"><center><%=l 'dhcpd_WINPOPUP_ACTION'%></center></a> |
|
496 |
</td> |
</td> |
|
+ --> |
|
497 |
</tr> |
</tr> |
498 |
%} |
%} |
499 |
</tbody> |
@@ -102,7 +102,7 @@ |
500 |
@@ -110,4 +115,4 @@ |
function Remove_lease_confirm(event,msg,current){ |
501 |
|
const getIP = /.*ip\=(.*)/; |
502 |
|
var IP = current.href.match(getIP)[1]; |
503 |
|
- if (prompt(msg+" IP: "+IP)) |
504 |
|
+ if (confirm(msg+" IP: "+IP)) |
505 |
|
{ return true;} |
506 |
|
else {event.preventDefault();return false;} |
507 |
|
} |
508 |
|
@@ -110,4 +110,4 @@ |
509 |
%end |
%end |
510 |
|
|
511 |
|
|