/[virtual-ldap]/lib/LDAP/Koha.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/LDAP/Koha.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 61 by dpavlin, Fri Nov 13 12:43:47 2009 UTC revision 62 by dpavlin, Thu Feb 18 16:22:32 2010 UTC
# Line 15  use File::Slurp; Line 15  use File::Slurp;
15    
16  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
17    
18    my $debug = 0; # XXX very slow
19    
20  # XXX test with:  # XXX test with:
21  #  #
22  # ldapsearch -h localhost -p 2389 -b dc=ffzg,dc=hr -x 'otherPager=200903160021'  # ldapsearch -h localhost -p 2389 -b dc=ffzg,dc=hr -x 'otherPager=200903160021'
# Line 120  sub __ldap_search_to_sql { Line 122  sub __ldap_search_to_sql {
122  sub _dn_attributes {  sub _dn_attributes {
123          my ($row,$base) = @_;          my ($row,$base) = @_;
124    
125          warn "## row = ",dump( $row );          warn "## row = ",dump( $row ) if $debug;
126    
127          die "no objectClass column in ",dump( $row ) unless defined $row->{objectClass};          die "no objectClass column in ",dump( $row ) unless defined $row->{objectClass};
128    
129          $row->{objectClass} = [ split(/\s+/, $row->{objectClass}) ] if $row->{objectClass} =~ m{\n};          $row->{objectClass} = [ split(/\s+/, $row->{objectClass}) ] if $row->{objectClass} =~ m{\n};
130    
131          warn "## row = ",dump( $row );          warn "## row = ",dump( $row ) if $debug;
132    
133          my $dn = delete( $row->{dn} ) || die "no dn in ",dump( $row );          my $dn = delete( $row->{dn} ) || die "no dn in ",dump( $row );
134    
# Line 202  sub search { Line 204  sub search {
204                  my $sql                  my $sql
205                          = $sql_select                          = $sql_select
206                          . $sql_where                          . $sql_where
207                          . ( $objectclass =~ m{person}i ? " LIMIT $max_results" : '' ) # add limit just for persons  #                       . ( $objectclass =~ m{person}i ? " LIMIT $max_results" : '' ) # add limit just for persons
208                          ;                          ;
209    
210                  warn "# SQL:\n$sql\n# DATA: ",dump( @values );                  warn "# SQL:\n$sql\n# DATA: ",dump( @values );

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.26