Skip to content

Commit

Permalink
remove data dumper
Browse files Browse the repository at this point in the history
  • Loading branch information
stgmsa committed Jul 11, 2024
1 parent 637cb96 commit 59b0d07
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion addons/upgrade/to-14.0-update-domain-config-section.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ =head1 AUTHOR
=head1 COPYRIGHT
Copyright (C) 2005-2023 Inverse inc.
Copyright (C) 2005-2024 Inverse inc.
=head1 LICENSE
Expand Down
2 changes: 1 addition & 1 deletion bin/pyntlm_auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def dns_lookup(hostname, dns_server):


def find_ldap_servers(domain, dns_server):
query_name = f'_ldap._tcp.{domain}'
query_name = f'_ldap._tcp.dc._msdcs.{domain}'

if dns_server != "":
resolver = dns.resolver.Resolver(configure=False)
Expand Down
7 changes: 2 additions & 5 deletions go/caddy/api/ntlm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/inverse-inc/packetfence/go/caddy/ntlm"
"github.com/julienschmidt/httprouter"
"net/http"
"os"
)

type PasswordChangeEvent struct {
Expand Down Expand Up @@ -61,8 +60,7 @@ func (h APIHandler) eventReport(w http.ResponseWriter, r *http.Request, p httpro
return
}

hostname, _ := os.Hostname()
sectionConf, exists := domainConfig.Element[hostname+" "+req.Domain]
sectionConf, exists := domainConfig.Element[req.Domain]
if !exists {
w.WriteHeader(http.StatusNotFound)
res := &response{
Expand Down Expand Up @@ -147,8 +145,7 @@ func (h APIHandler) ntlmTest(w http.ResponseWriter, r *http.Request, p httproute
return
}

hostname, _ := os.Hostname()
sectionConf, exists := domainConfig.Element[hostname+" "+req.Id]
sectionConf, exists := domainConfig.Element[req.Id]
if !exists {
w.WriteHeader(http.StatusNotFound)
res := &response{
Expand Down
7 changes: 4 additions & 3 deletions lib/pf/UnifiedApi/Controller/Config/Domains.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use Digest::MD4 qw(md4_hex);
use Encode qw(encode);
use Net::DNS;
use JSON;
use pf::constants qw($TRUE $FALSE);

my $host_id = hostname();

Expand Down Expand Up @@ -61,15 +62,15 @@ sub get {
$item = $self->cleanupItemForGet($item);
return $self->render(json => { item => $item }, status => 200);
}
return $self->render_error(500, "Unknown error getting item");;
return $self->render_error(500, "Unknown error getting item");
}

sub item_shown {
my ($self, $item) = @_;
if ($item->{id} =~ s/$host_id //i) {
return 1;
return $TRUE;
}
return 0;
return $FALSE;
}

sub handle_search {
Expand Down
1 change: 0 additions & 1 deletion lib/pfconfig/namespaces/config/Domain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use warnings;
use JSON;

use pfconfig::namespaces::config;
use Data::Dumper;
use pf::log;
use pf::file_paths qw($domain_config_file);
use Sys::Hostname;
Expand Down

0 comments on commit 59b0d07

Please sign in to comment.