projects
/
virtual-ldap
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
393f5f3
)
allow where which are specified in SQL files, so we add just
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 29 Apr 2009 09:03:47 +0000
(09:03 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 29 Apr 2009 09:03:47 +0000
(09:03 +0000)
our conditions with and
lib/LDAP/Koha.pm
patch
|
blob
|
history
diff --git
a/lib/LDAP/Koha.pm
b/lib/LDAP/Koha.pm
index
05532ea
..
2187bac
100644
(file)
--- a/
lib/LDAP/Koha.pm
+++ b/
lib/LDAP/Koha.pm
@@
-181,15
+181,19
@@
sub search {
__ldap_search_to_sql( $filter, $reqData->{'filter'}->{$filter} );
}
__ldap_search_to_sql( $filter, $reqData->{'filter'}->{$filter} );
}
- $sql_where .= ' ' . join( " $filter ", @limits );
+ $sql_where .= ' ' . join( " $filter ", @limits )
if @limits
;
}
}
+ my $sql_select = read_file( lc "sql/$objectclass.sql" );
if ( $sql_where ) {
if ( $sql_where ) {
- $sql_where = " where $sql_where";
+ if ( $sql_select !~ m{where}i ) {
+ $sql_where = " where $sql_where";
+ } else {
+ $sql_where = " and $sql_where";
+ }
}
}
- my $sql_select = read_file( lc "sql/$objectclass.sql" );
warn "# SQL:\n$sql_select\n", $sql_where ? $sql_where : '-- no where', "\n# DATA: ",dump( @values );
my $sth = $dbh->prepare( $sql_select . $sql_where . " LIMIT $max_results" ); # XXX remove limit?
warn "# SQL:\n$sql_select\n", $sql_where ? $sql_where : '-- no where', "\n# DATA: ",dump( @values );
my $sth = $dbh->prepare( $sql_select . $sql_where . " LIMIT $max_results" ); # XXX remove limit?