Jifty::Manual::Cookbook

Jifty::Manual::Cookbook contains recipes for common tasks in Jifty.
Download

Jifty::Manual::Cookbook Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jesse Vincent, Alex Vandiver and David Glasser
  • Publisher web site:
  • http://search.cpan.org/~sartak/

Jifty::Manual::Cookbook Tags


Jifty::Manual::Cookbook Description

Jifty::Manual::Cookbook contains recipes for common tasks in Jifty. Jifty::Manual::Cookbook contains recipes for common tasks in Jifty.Create an LDAP autocomplete fieldYou need an action in your application. Then run jifty action --name LdapSearchin lib/myApp/Action/LdapSearch.pm add the search field use Jifty::Action schema { param search => autocompleter is &ldap_search; }we need Net::LDAP and an accessor to our LDAP value. use Net::LDAP; __PACKAGE__->mk_accessors(qw(LDAP));and we can write our ldap_search fonction. Search need at least 3 characters and return an array of DisplayName (login) sub ldap_search { my $self = shift; my $search = shift; my @res; if (length $search > 2) { if (! $self->LDAP() ) { $self->LDAP( Net::LDAP->new('ldap.myorg.org'); $self->LDAP()->bind( ); } $self->LDAP()->search( base => 'ou=people,dc=myorg,dc=org', filter => '(cn='.$filter.')', attrs => , sizelimit => 10 ); foreach my $entr ( $result->sorted('cn') ) { push @res, $entr->get_value('displayname').' ('.$entr->get_value('uid').')'; } } return @res; } Requirements: · Perl


Jifty::Manual::Cookbook Related Software