--- sql/hreduperson.sql	2009/04/29 12:22:40	55
+++ sql/hreduperson.sql	2009/11/13 12:43:47	60
@@ -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 ou,
-	concat('/home/',borrowernumber)			as homeDirectory
-from borrowers
+	categorycode					as department,
+	concat('/home/',b.borrowernumber)			as homeDirectory
+from borrowers b
+left join borrower_attributes a on b.borrowernumber = a.borrowernumber and code='RFID_SID'
+
+
 
