C# Files: dh_users.cs  


<%@ Control %>
  <%@ Register TagPrefix="devHood" TagName="Caste" src="/ratings/caste.ascx" %>
  <%@ Import Namespace=DH_Users %>
<html> <head> <LINK rel="stylesheet" type="text/css" href="/iesite.css" /> <script language="c#" runat="server"> bool bAuthenticated; bool bLoginVisible = true; public bool LoginVisible { set { bLoginVisible = value; tblLogin.Visible = value; } } void Page_Load(Object o, EventArgs e) { hlViewSource.NavigateUrl += Request.Url.AbsolutePath; PassportIdentity id = (PassportIdentity) Page.User.Identity; if (id.IsAuthenticated) { lblPassportLogo.Text = id.LogoTag2("https://devhood.com/default.aspx"); caste1.GetProfile(Page.User.Identity.Name); tblAuthenticated.Visible = true; } else { lblPassportLogo.Text = id.LogoTag2("https://devhood.com/login.asp?orgurl=" + Request.Url.ToString()); } } void Page_PreRender(Object o, EventArgs e) { /* if (Page.User.Identity.IsAuthenticated) { DH_User dhUserInfo = DH_UserDB.GetUserFromID(Page.User.Identity.Name); lblFirstName.Text = dhUserInfo.FirstNames; lblLastName.Text = dhUserInfo.LastName; tblLogin.Visible = false; tblAuthenticated.Visible = true; lbLogOut.Visible = true; lblLogOut.Visible = true; lblBar.Visible = true; } else { tblLogin.Visible = bLoginVisible; tblAuthenticated.Visible = false; lbLogOut.Visible = false; lblLogOut.Visible = false; lblBar.Visible = false; } */ } void Login_Btn_Click(Object o, EventArgs e) { int user_id = DH_UserDB.AuthenticateUser(email.Text, password.Text); if (user_id == -1 || user_id == -2 || user_id == -3) { Page.Response.Redirect("/login.aspx?err=1"); } else { FormsAuthentication.SetAuthCookie(user_id.ToString(), false); Page.Response.Redirect(Page.Request.RawUrl); } } void lbLogOut_On_Click(Object o, EventArgs e) { FormsAuthentication.SignOut(); email.Text = ""; password.Text = ""; Page.Response.Redirect(Page.Request.RawUrl); } </script>
<!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-173240-2"; urchinTracker(); </script> <!-- end google analytics --> </head> <body bgcolor="white" background-color="white"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="1%"> <a href="/default.aspx"> <!--<img border="0" src="/images/DevHood.gif">--> <img border="0" src="/images/DH-banner-whitebg.gif"> </a> </td> <td valign="bottom" width="100%" align="right"> <asp:AdRotator ID="adBannerTop" target="_blank" AdvertisementFile="/Ads.xml" Runat="server" /> <!--<a href="http://www.kenlet.com"><img border="0" src="/images/kenlet-banner.jpg"></a> --> <asp:Label id="lblPassportLogo" Runat=server /> <!--
<table border="0" width="1%" cellpadding="0" cellspacing="0" id="tblLogin" runat="server"> <tr> <td align="right" class="loginControl"> Email: </td> <td> <asp:textbox id="email" columns="15" cssclass="loginControl" runat="Server" /> </td> </tr> <tr> <td align="right" class="loginControl"> Password: </td> <td nowrap> <asp:textbox textmode="Password" columns="15" cssclass="loginControl" id="password" runat="Server" /> <asp:button text="Login" cssclass="loginControl" id="btnLoginCtr" onclick="Login_Btn_Click" runat="Server" /> </td> </tr> </table> --></td><td> <table width="1%" align="right" border="0" cellpadding="0" cellspacing="0" visible="false" id="tblAuthenticated" runat="server"> <tr valign="bottom"> <td> <asp:label id="lblFirstName" class="username" runat="server" /> <br> <asp:label id="lblLastName" class="username" runat="server" /> </td> <td> <devHood:Caste id="caste1" runat="server" /> </td> </tr> </table> </td> </tr> <tr> <td height="1%" width="100%" colspan="3" align="right" class="tdTopBarBtns"> <asp:hyperlink text="Home" tooltip="DevHood Main Page" cssclass="menuLink" navigateurl="/default.aspx" runat="Server" />  |  <asp:hyperlink text="FAQ" cssclass="menuLink" tooltip="Answers to some of your frequently asked questions" navigateurl="/faq.aspx" runat="Server" />  |  <asp:hyperlink text="About" cssclass="menuLink" tooltip="Learn about the creators of DevHood" navigateurl="/aboutus.aspx" runat="Server" />  |  <asp:hyperlink text="Contact" cssclass="menuLink" tooltip="Contact us with feedback, questions or complaints" navigateurl="/contactus.aspx" runat="Server" />  |  <asp:HyperLink id="hlViewSource" target=_blank text="View Source" CssClass="menuLink" tooltip="View source of current page" NavigateUrl="/view_source.aspx?source=" Runat=server />  <asp:label text="|" runat="server" id="lblBar" visible="false" />  <asp:linkbutton text="Log-Out" cssclass="menuLink" visible="false" id="lbLogOut" onclick="lbLogOut_On_Click" runat="Server" /> <asp:label text="  " runat="server" id="lblLogOut" visible="false" /> </td> </tr> </table> </body> </html>