projects
/
virtual-ldap
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace only CR
[virtual-ldap]
/
lib
/
LDAP
/
Koha.pm
diff --git
a/lib/LDAP/Koha.pm
b/lib/LDAP/Koha.pm
index
28d0868
..
563c968
100644
(file)
--- a/
lib/LDAP/Koha.pm
+++ b/
lib/LDAP/Koha.pm
@@
-39,16
+39,14
@@
$SIG{__DIE__} = sub {
require 'config.pl' if -e 'config.pl';
require 'config.pl' if -e 'config.pl';
-my $dbh = DBI->connect($dsn . $database, $user,$passwd, { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr;
-
# we need reverse LDAP -> SQL mapping for where clause
my $ldap_sql_mapping = {
'uid' => 'userid',
# we need reverse LDAP -> SQL mapping for where clause
my $ldap_sql_mapping = {
'uid' => 'userid',
- 'objectGUID' => 'borrowernumber',
+ 'objectGUID' => 'b
.b
orrowernumber',
'displayName' => 'surname',
'sn' => 'surname',
'displayName' => 'surname',
'sn' => 'surname',
- 'pager' =>
'a.attribute',
# was: rfid_sid
+ 'pager' =>
qq{replace(a.attribute, '\r','')},
# was: rfid_sid
};
sub __sql_column {
};
sub __sql_column {
@@
-208,6
+206,7
@@
sub search {
;
warn "# SQL:\n$sql\n# DATA: ",dump( @values );
;
warn "# SQL:\n$sql\n# DATA: ",dump( @values );
+ my $dbh = DBI->connect_cached($dsn . $database, $user,$passwd, { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr;
my $sth = $dbh->prepare( $sql );
$sth->execute( @values );
my $sth = $dbh->prepare( $sql );
$sth->execute( @values );
@@
-220,13
+219,13
@@
sub search {
my ( $dn, $attributes ) = _dn_attributes( $row, $base );
my ( $dn, $attributes ) = _dn_attributes( $row, $base );
- warn "#
dn $last_dn ... $dn\n"
;
+ warn "#
# dn $last_dn ... $dn\n" if $debug
;
if ( $dn ne $last_dn ) {
if ( $entry ) {
#$entry->changetype( 'modify' );
if ( $dn ne $last_dn ) {
if ( $entry ) {
#$entry->changetype( 'modify' );
- warn "### entry ",$entry->dump( \*STDERR );
+ warn "### entry ",$entry->dump( \*STDERR )
if $debug
;
push @entries, $entry;
undef $entry;
}
push @entries, $entry;
undef $entry;
}
@@
-241,7
+240,7
@@
sub search {
} else {
foreach my $n ( keys %$attributes ) {
my $v = $attributes->{$n};
} else {
foreach my $n ( keys %$attributes ) {
my $v = $attributes->{$n};
- warn "#
attr $n = $v\n"
;
+ warn "#
# attr $n = $v\n" if $debug
;
$entry->add( $n, $v ) if $entry->get_value( $n ) ne $v;
}
}
$entry->add( $n, $v ) if $entry->get_value( $n ) ne $v;
}
}
@@
-252,7
+251,7
@@
sub search {
}
if ( $entry ) {
}
if ( $entry ) {
- warn "### last entry ",$entry->dump( \*STDERR );
+ warn "### last entry ",$entry->dump( \*STDERR )
if $debug
;
push @entries, $entry;
}
push @entries, $entry;
}