[rt-users] Problem with update dept from ldap action in RT Essentials
Jim Meyer
purp at acm.org
Thu Jan 5 03:22:51 EST 2006
Hello!
On Wed, 2006-01-04 at 16:18, Mike Patterson wrote:
> How would I go about "loading" Net::LDAP?
Have you tried:
use Net::LDAP;
As in:
> ------------
use Net::LDAP;
> my $email = ($self->TicketObj->RequestorAddresses)[0];
> my $ldap = Net::LDAP->new( 'directory.unex.berkeley.edu' );
> $ldap->bind;
> my $msg = $ldap->search( base => 'dc=unex,dc=berkeley,dc=edu',
> filter => "(email=$email)",
> );
> my $entry = $msg->entry(0);
> my $dept = $entry->get_value('ou');
> my $cf = RT::CustomField->new( $RT::SystemUser );
> $cf->LoadByName( Name => 'Department' );
> $self->TicketObj->AddCustomFieldValue( Field => $cf, Value =>
> $dept );
> return 1;
> --------------
I think that might work.
Cheers!
--j
--
Jim Meyer, Geek at Large purp at acm.org
More information about the rt-users
mailing list