/[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 37 by dpavlin, Wed Mar 25 21:15:19 2009 UTC revision 38 by dpavlin, Wed Mar 25 22:06:00 2009 UTC
# Line 33  my $dbh = DBI->connect($dsn . $database, Line 33  my $dbh = DBI->connect($dsn . $database,
33  # attributes which won't pass through DBI  # attributes which won't pass through DBI
34  my $sql_select = q{  my $sql_select = q{
35          select          select
36                  userid                  as uid,                  trim(userid)                                    as uid,
37                  firstname               as givenName,                  firstname                                               as givenName,
38                  surname                 as sn,                  surname                                                 as sn,
39                  concat(                  concat(firstname,' ',surname)   as cn,
40                          firstname,  
41                          ' ',                  -- SAFEQ specific mappings from UMgr-LDAP.conf
42                          surname                  concat(firstname,' ',surname)   as displayName,
43                  )                               as cn,                  cardnumber                                              as otherPager,
44                  cardnumber              as otherPager,                  email                                                   as mail,
45                  email                   as mail                  categorycode                                    as organizationalUnit,
46                    borrowernumber                                  as objectGUID,
47                    concat('/home/',borrowernumber) as homeDirectory
48          from borrowers          from borrowers
49  };  };
50    
51  # needed for where clause  # needed for where clause
52  my $sql_ldap_mapping = {  my $sql_ldap_mapping = {
53          'userid'        => 'uid',          'userid'                        => 'uid',
54            'borrowernumber'        => 'objectGUID',
55  };  };
56    
57  # attributes which are same for whole set, but somehow  # attributes which are same for whole set, but somehow
# Line 137  sub search { Line 140  sub search {
140                                                          }                                                          }
141                                                  }                                                  }
142                                          } elsif ( $how eq 'present' ) {                                          } elsif ( $how eq 'present' ) {
143                                                  push @limits, __sql_column( $filter->{$how} ) . ' IS NOT NULL';                                                  my $name = __sql_column( $filter->{$how} );
144                                                  ## XXX add and length(foo) > 0 to avoid empty strings?                                                  push @limits, "$name IS NOT NULL and length($name) > 1";
145                                                    ## XXX length(foo) > 1 to avoid empty " " strings
146                                          } else {                                          } else {
147                                                  warn "UNSUPPORTED: how $how ",dump( $filter );                                                  warn "UNSUPPORTED: how $how ",dump( $filter );
148                                          }                                          }

Legend:
Removed from v.37  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.26