--- sql/hreduperson.sql	2009/04/17 21:39:45	47
+++ sql/hreduperson.sql	2009/11/13 12:43:47	60
@@ -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
@@ -12,12 +12,16 @@
 	concat(firstname,' ',surname)			as cn,
 
 	-- SAFEQ specific mappings from UMgr-LDAP.conf
-	borrowernumber					as objectGUID,
+	b.borrowernumber					as objectGUID,
 	surname						as displayName,
-	rfid_sid					as pager,
+	a.attribute					as pager,
 	email						as mail,
---	categorycode					as memberOf,
+	categorycode					as memberOf,
+	categorycode					as ou,
 	categorycode					as department,
-	concat('/home/',borrowernumber)			as homeDirectory
-from borrowers
+	concat('/home/',b.borrowernumber)			as homeDirectory
+from borrowers b
+left join borrower_attributes a on b.borrowernumber = a.borrowernumber and code='RFID_SID'
+
+
 
