예제 #1
0
 public PrincipalInvestigator(WebService.LDAPuser piObj, string department, string tuid)
 {
     TUID       = tuid;
     FirstName  = piObj.givenName;
     LastName   = piObj.sn;
     Email      = piObj.mail;
     Department = department;
     LastUpdate = DateTime.Now;
 }
예제 #2
0
        /// <summary>
        /// Use employeeNumber (TUid) to retrieve infromation about the user
        /// from the web services.
        /// </summary>
        /// <param name="employeeNumber">TUid</param>
        protected void GetUserInformation(string employeeNumber)
        {
            if (!string.IsNullOrWhiteSpace(employeeNumber))
            {
                /*Security Session Variable*/
                Session["Authenticated"] = true;

                /* Requesting user's LDAP information via Web Service */
                WebService.LDAPuser Temple_Information = WebService.Webservice.getLDAPEntryByTUID(employeeNumber);

                /* Checking we received something from Web Services*/
                if (Temple_Information != null)
                {
                    /*Populating the Session Object with the user's information*/
                    Session["TU_ID"]                 = Temple_Information.templeEduID;
                    Session["First_Name"]            = Temple_Information.givenName;
                    Session["Last_Name"]             = Temple_Information.sn;
                    Session["Email"]                 = Temple_Information.mail;
                    Session["Title"]                 = Temple_Information.title;
                    Session["Affiliation_Primary"]   = Temple_Information.eduPersonPrimaryAffiliation;
                    Session["Affiliation_Secondary"] = Temple_Information.eduPersonAffiliation;
                    Session["Full_Name"]             = Temple_Information.cn;
                    Session["Access_Net"]            = Temple_Information.uID;


                    /* If the user is a student, we can request academic information via the Web Service */
                    WebService.StudentObj Student_Information = WebService.Webservice.getStudentInfo(Temple_Information.templeEduID);

                    /* Checking we received something from Web Service and then adding information to the Session Object*/
                    if (Student_Information != null)
                    {
                        Session["School"]  = Student_Information.school;
                        Session["Major_1"] = Student_Information.major1;
                        Session["Major_2"] = Student_Information.major2;
                    }
                }
                /*Successful Login - Allowed to be redirected to Home.aspx*/
                //  Response.Redirect("Checkout.aspx");

                if (AuthenticateUser(Temple_Information.uID) == true)
                {
                    Response.Redirect("Checkout.aspx");
                }
                else
                {
                    Server.Transfer("500http.aspx");
                }
            }
            else
            {
                //Error: Couldn't retrieve employeeNumber from request header
                Server.Transfer("500http.aspx");
            }
        }