From: Dobrica Pavlinusic Date: Wed, 29 Apr 2009 12:22:40 +0000 (+0000) Subject: produce whole dn in SQL queries so we don't have to mungle it in code X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=commitdiff_plain;h=5bb14e63038006514db929f1469080d318f8b832 produce whole dn in SQL queries so we don't have to mungle it in code --- diff --git a/lib/LDAP/Koha.pm b/lib/LDAP/Koha.pm index 38e4428..e0b70bf 100644 --- a/lib/LDAP/Koha.pm +++ b/lib/LDAP/Koha.pm @@ -131,12 +131,12 @@ sub _dn_attributes { my $dn = delete( $row->{dn} ) || die "no dn in ",dump( $row ); # this does some sanity cleanup for our data - my $base_as_domain = $base; - $base_as_domain =~ s{dn=}{.}; - $base_as_domain =~ s{^\.}{@}; - $dn =~ s{$base_as_domain$}{}; - - $dn .= ',' . $base unless $dn =~ m{,}; # add base if none present +# my $base_as_domain = $base; +# $base_as_domain =~ s{dn=}{.}; +# $base_as_domain =~ s{^\.}{@}; +# $dn =~ s{$base_as_domain$}{}; +# +# $dn .= ',' . $base unless $dn =~ m{,}; # add base if none present return ($dn, $row); } diff --git a/sql/group.sql b/sql/group.sql index e98e8f4..47c28b8 100644 --- a/sql/group.sql +++ b/sql/group.sql @@ -1,7 +1,7 @@ select - concat('cn=',c.categorycode,',ou=',c.categorycode) as dn, + concat('cn=',c.categorycode,',ou=',c.categorycode,',dc=ffzg,dc=hr') as dn, 'group' as objectClass, - 'groups' as ou, + c.categorycode as ou, c.categorycode as cn, description as description, diff --git a/sql/hreduperson.sql b/sql/hreduperson.sql index b068bd7..cbf0811 100644 --- a/sql/hreduperson.sql +++ b/sql/hreduperson.sql @@ -1,6 +1,6 @@ select - concat('uid=',trim(userid)) as dn, + concat('uid=',trim(userid),',ou=',categorycode,',dc=ffzg,dc=hr') as dn, 'person organizationalPerson inetOrgPerson diff --git a/sql/organizationalunit.sql b/sql/organizationalunit.sql index 21d4912..8c07ff9 100644 --- a/sql/organizationalunit.sql +++ b/sql/organizationalunit.sql @@ -1,6 +1,6 @@ select - concat('ou=',c.categorycode,'dc=ffzg,dc=hr') as dn, + concat('ou=',c.categorycode,',dc=ffzg,dc=hr') as dn, 'organizationalunit' as objectClass, c.categorycode as ou, c.description as description