I've been using the person.pl script to populate user details from LDAP. Since 
upgrading from Packetfence 5.4 to 5.7, it no longer works.

[root@packetfence lookup]# perl /usr/local/pf/lib/pf/lookup/person.pl
Can't call method "get_value" on an undefined value at 
/usr/local/pf/lib/pf/Authentication/Source/LDAPSource.pm line 558.

-------------------------
#!/usr/bin/perl
=head1 NAME

person.pl - Person Lookup

=cut
require 5.8.5;
use strict;
use warnings;

use FindBin;
use Pod::Usage;

BEGIN {
     use constant INSTALL_DIR => '/usr/local/pf';
     use lib INSTALL_DIR . "/lib";
}

use pf::node;
use pf::db;
use pf::util;
use pf::person;
use pf::lookup::person;

my @person = person_view_all;
my $source_id = 'AD';

foreach my $pers ( @person ) {

     pf::lookup::person::lookup_person($pers->{'pid'},$source_id);

}


=head1 AUTHOR

Inverse inc. <[email protected]>

=head1 COPYRIGHT

Copyright (C) 2005-2015 Inverse inc.

=head1 LICENSE

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.

=cut

# vim: set shiftwidth=4:
# vim: set expandtab:
# vim: set backspace=indent,eol,start:
--------------------------


The error happens in /usr/local/pf/lib/pf/Authentication/Source/LDAPSource.pm 
line 558

    555     my $info = {};
    556     foreach my $attrs (keys %ATTRIBUTES_MAP){
    557         foreach my $attr (split('\|',$ATTRIBUTES_MAP{$attrs})) {
    558             if(defined($entry->get_value($attr))){
    559                 $info->{$attrs} = $entry->get_value($attr);
    560             }
    561         }
    562     }

Any ideas why this no longer works?

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to