%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,mail,shell_exec,system,proc_open,popen,ini_alter,dl,proc_close,curl_exec,curl_multi_exec,readfile,parse_ini_file,escapeshellarg,escapeshellcmd,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,mail,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/dhcpd/ |
Upload File : |
#!/usr/bin/perl # lookup_host.cgi # Find a host with a certain name and re-direct to its editing form # or present a list of matching hosts if multiple hosts are found require './dhcpd-lib.pl'; &ReadParse(); $in{'host'} || &error($text{'lookup_ehostname'}); # Recursively find hosts $conf = &get_config(); @hosts = &find_recursive("host", $conf); # Check to see if the host contains 6 hex bytes for a Mac address if ($in{'host'} =~ /:|\-|\./) { (my $justbytes = $in{'host'}) =~ s/[^A-Fa-f0-9]//g; if ($justbytes =~ /^[0-9a-f]{12}$/i) { # Treat this host as a mac address with arbitrary formatting $in{'host'} = join(':', unpack("(A2)*", $justbytes) ); } } # Look for a match %access = &get_module_acl(); foreach $h (@hosts) { local $can_view = &can('r', \%access, $h); next if !$can_view && $access{'hide'}; local $fixed = &find("fixed-address", $h->{'members'}); local $hard = &find("hardware", $h->{'members'}); if (&search_re($h->{'values'}->[0], $in{'host'}) || $fixed && &search_re($fixed->{'values'}->[0], $in{'host'}) || $hard && &search_re($hard->{'values'}->[1], $in{'host'})) { push(@foundhosts, $h); } } # Go to the host if only 1 match found if(scalar(@foundhosts)==1) { $host=@foundhosts[0]; ($gidx, $uidx, $sidx) = &find_parents($host); &redirect("edit_host.cgi?idx=$host->{'index'}". (defined($gidx) ? "&gidx=$gidx" : ""). (defined($uidx) ? "&uidx=$uidx" : ""). (defined($sidx) ? "&sidx=$sidx" : "")); } # List multiple matching hosts elsif(scalar(@foundhosts) > 1) { $desc = &text('ehost_hostlist', $in{'host'} ); &ui_print_header($desc, "Matches", "" ); foreach $h (@foundhosts) { ($gidx, $uidx, $sidx) = &find_parents($h); local $params="idx=$h->{'index'}". (defined($gidx) ? "&gidx=$gidx" : ""). (defined($uidx) ? "&uidx=$uidx" : ""). (defined($sidx) ? "&sidx=$sidx" : ""); printf("<a href=\"edit_host.cgi?%s\">%s</a><br/>\n", $params, $h->{'values'}->[0] ); } } # Show an error if no matches else { &error(&text('lookup_ehost', $in{'host'})); }