]> git.zarvox.org Git - wp3.git/commitdiff
Transparently convert UINs into NetIDs, for people who can't follow instructions...
authorDrew Fisher <drew.m.fisher@gmail.com>
Sun, 19 Jul 2009 05:27:59 +0000 (22:27 -0700)
committerDrew Fisher <drew.m.fisher@gmail.com>
Sun, 19 Jul 2009 05:27:59 +0000 (22:27 -0700)
ldapsearcher.py
pagenewuserdata.py

index 5a2bb91b54f133d78ef203c527596e1b176e2d9b..9715a6b20be7c9d633f7d84cb5af04c185885a6b 100644 (file)
@@ -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
index b2c7e5decacade8ac3f04e6338c96be9bd7313b1..066a3a8517a3fa23920f04885e3e87e74df5cd8a 100644 (file)
@@ -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__":