X-Git-Url: https://git.octo.it/?p=licom.git;a=blobdiff_plain;f=lib%2FLiCoM%2FPerson.pm;h=6ba43a91138898ddde7642347fec861679b05ea4;hp=a5bf4e2e4c37b8bcae0ca2b6069145be039a07c9;hb=094b50a6b3c8e7f55c7033217196aa97a9b502ec;hpb=328bdcb841ecaa72c69379e6ccd7165f44e7c2e4 diff --git a/lib/LiCoM/Person.pm b/lib/LiCoM/Person.pm index a5bf4e2..6ba43a9 100644 --- a/lib/LiCoM/Person.pm +++ b/lib/LiCoM/Person.pm @@ -47,6 +47,24 @@ our %ExternalNames = return (1); +sub new +{ + my $pkg = shift; + my $entry = shift; + my $obj = {}; + + $obj->{'dn'} = $entry->dn (); + $obj->{'ldap'} = $entry; + + for (keys %ValidFields) + { + my $key = $_; + $obj->{$key} = $entry->get_value ($key, asref => $ValidFields{$key}); + } + + return (bless ($obj, $pkg)); +} + =head1 STATIC FUNCTIONS =over 4