From: Drew Fisher <drew.m.fisher@gmail.com>
Date: Sun, 19 Jul 2009 05:27:59 +0000 (-0700)
Subject: Transparently convert UINs into NetIDs, for people who can't follow instructions... 
X-Git-Url: https://git.zarvox.org/shortlog/month?a=commitdiff_plain;h=05762a53f0505ba3dc9ffcef048995fd10ac2522;p=wp3.git

Transparently convert UINs into NetIDs, for people who can't follow instructions correctly. :P
---

diff --git a/ldapsearcher.py b/ldapsearcher.py
index 5a2bb91..9715a6b 100644
--- a/ldapsearcher.py
+++ b/ldapsearcher.py
@@ -12,8 +12,13 @@ class LDAPSearcher():
 	def lookup(self,username=""):
 		base = ""
 		scope = ldap.SCOPE_SUBTREE
-		filter = "tamuEduPersonNetID=" + username
-		retrieve_attributes = ["sn", "givenName", "mail", "major", "classification"]
+		filter = ""
+		try:
+			uin = int(username)
+			filter = "tamuEduPersonUIN=" + username
+		except:
+			filter = "tamuEduPersonNetID=" + username
+		retrieve_attributes = ["tamuEduPersonNetID", "sn", "givenName", "mail", "major", "classification"]
 		count = 0
 		result_set = []
 		all = 0
diff --git a/pagenewuserdata.py b/pagenewuserdata.py
index b2c7e5d..066a3a8 100644
--- a/pagenewuserdata.py
+++ b/pagenewuserdata.py
@@ -99,6 +99,8 @@ class PageNewUserData(QWizardPage):
 				self.email.setText(value)
 			elif(key == "major"):
 				self.major.setText(value)
+			elif(key == "tamuEduPersonNetID"):
+				self.setField("netid",QVariant(QString(value)))
 
 
 if __name__ == "__main__":