Exemplo n.º 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                // Put user code to initialize the page here
                Global.AuthenticateUser();

                lnkSignIn.Text = Global.SetLnkSignIn();
                lnkSignUp.Text = Global.SetLnkSignUp();

                CheckForPro();
                BindData();
                //ShowLinks();


                if (hdnACT.Value == Global.ACCT_BIZ)
                {
                    pnlQP.Visible = true;
                    if (!hasCoupons())
                    {
                        //hide footer settings & edit links
                        lnkManageQP.Visible = false;
                        lnkSettings.Visible = false;
                    }
                }
                else
                {
                    pnlQP.Visible = false;
                }
            }
            pnlQP.Visible = false;
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            imgGoBack.Attributes.Add("onClick", "javascript:history.go(-1); return false;");

            btnPostComment.Attributes.Add("OnClick", "if(CheckComment()==false){alert('Try typing something into the box.');event.returnValue=false;return false;}else{return true;}");

            if (Session["LoggedIn"].ToString() == "Yes")
            {
                pnlLogin.Visible = false;
            }

            if (!Page.IsPostBack)
            {
                //Check for cut and paste URL bug: check for NULL;
                if (Request.UrlReferrer != null)
                {
                    ViewState["ReferURL"] = Request.UrlReferrer.ToString();
                }
                BindData();
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (Session["LoggedIn"].ToString() == "Yes")
            {
                Response.Redirect("UserMenu.aspx", false);
            }

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn();
            lnkSignUp.Text = Global.SetLnkSignUp();

            hdnVal.Value = string.Empty;

            if (Request.QueryString["m"] != null)
            {
                string qStr = Request.QueryString["m"].ToString();

                if (qStr == "1")
                {
                    lblMessage.Text        = "&nbsp;Please login or <a class='alert' href='register_user.aspx'><u>sign up</u></a> first!&nbsp;";
                    lblMessage.BackColor   = Color.White;
                    lblMessage.BorderColor = Color.Red;
                    lblMessage.Visible     = true;
                    lblMessage.Height      = Unit.Pixel(16);
                }
            }
        }
Exemplo n.º 4
0
        //protected System.Web.UI.WebControls.LinkButton lnkBtnView;

        protected void Page_Load(object sender, System.EventArgs e)
        {
            //LinkButton lnkBtn = new LinkButton();
            //lnkBtn = (LinkButton)FindControl("lnkBtnAddNew");

            //if (lnkBtn == null)
            //{
            //    Response.Write("Not cool");
            //    return;
            //}

            // Put user code to initialize the page here
            if (!Page.IsPostBack)
            {
                Global.AuthenticateUser(Request.Url.ToString());
            }

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            // Call the ItemsGet method to populate control,
            ItemsGet();

            Page.DataBind();
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            classes.BoardItem tmpBoardItem = (classes.BoardItem)Session["Item"];

            //TODO: fix double load
            ErrorLog.ErrorRoutine(false, "preview_post:Page_Load:SID: " + Session.SessionID + " isPB: " + Page.IsPostBack);

            if (tmpBoardItem == null)
            {
                HandleError();
                return;
            }

            if (!Page.IsPostBack)
            {
                Global.AuthenticateUser();

                // Put user code to initialize the page here
                lnkSignIn.Text = Global.SetLnkSignIn( );
                lnkSignUp.Text = Global.SetLnkSignUp( );

                //Hide all sub-panels then enable accordingly
                pnlAll.Visible       = false;
                pnlWidth.Visible     = false;
                pnlSurfOnly.Visible  = false;
                pnlBoardType.Visible = false;

                //Load up display data and show a preview of the posting
                BindData(tmpBoardItem);
            }

            ErrorLog.ErrorRoutine(false, "preview_post:Page_Load:END:SID:" + Session.SessionID + " isPB: " + Page.IsPostBack);
        }
Exemplo n.º 6
0
        /*
         */
        protected void Page_Load(object sender, System.EventArgs e)
        {
            lnkSignIn.Text        = Global.SetLnkSignIn( );
            lnkSignUp.Text        = Global.SetLnkSignUp( );
            panelMailSent.Visible = false;

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
Exemplo n.º 7
0
        //protected System.Web.UI.WebControls.TextBox searchTextField;

        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser("post.aspx");

            string iUID = Session["userId"].ToString();
            string i;

            //check for ProUser
            BoardHunt.wsBH.BHService oWS = new BoardHunt.wsBH.BHService();
            i = oWS.isPro(Convert.ToInt32(iUID)).ToString();

            if (i != "1")             //if not Pro acct the check to see if they're maxed out of posts
            {
                if (oWS.GetActiveBoardCount(Convert.ToInt32(iUID), 1, 0) > 4)
                {
                    Response.Redirect("/UserMenu.aspx", true);                     //TODO: add message that they're out of posts
                }
            }

            BindData();             //unconditionally bind the data for the controls

            //if (!Page.IsPostBack)
            //{
            //	Session ["EditMode"] = "false"; //a check for edit mode ???
            //}

            //check first time arrival or edit mode
            string[] arString;
            arString = Request.QueryString.GetValues("em");
            if (arString != null)
            {
                if (HttpUtility.UrlDecode(arString [0].ToString()) == "1")
                {
                    //load object values
                    classes.BoardItem tmpBoardItem = (classes.BoardItem)Session["Item"];
                    if (tmpBoardItem != null)
                    {
                        txtTown.Text = tmpBoardItem.Town;
                        txtZip.Text  = tmpBoardItem.Zip;
                    }
                }
            }
            else
            {
                Session ["EditMode"] = "false";
            }

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            Session ["Item"] = null;
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
Exemplo n.º 9
0
        //FIXME: need to pass Cat id to item details
        //public static string iCategory;

        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser();

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            // Call the ItemsGet method to populate control,
            // passing in the sample data.
            ItemsGet();
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Put user code to initialize the page here
            if (!Page.IsPostBack)
            {
                lnkSignIn.Text = Global.SetLnkSignIn();
                lnkSignUp.Text = Global.SetLnkSignUp();
                BindData();
            }

            //ErrorLog.ErrorRoutine(false, "Ver: " + System.Environment.Version);
            //ErrorLog.ErrorRoutine(false, "SerVer: " + Request.ServerVariables["SERVER_SOFTWARE"]);
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser(Request.Url.ToString());

            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            if (!(Page.IsPostBack))
            {
                LoadControl();
                GetUserProfileData();
                SetControls();
                pnlChangePwd.Visible = false;
            }
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            lnkSignIn.Text = Global.SetLnkSignIn( );
            lnkSignUp.Text = Global.SetLnkSignUp( );

            //imgClear.CausesValidation = false;

            lblStatus.Text = string.Empty;

            if (!Page.IsPostBack)
            {
                //txtFullName.Attributes.Add("OnBlur", "CheckControl('txtFullName')");
                txtPassword1.Attributes.Add("OnBlur", "CheckControl('txtPassword1')");
                txtEmail.Attributes.Add("OnBlur", "CheckControl('txtEmail')");

                //chkShowPhone.Checked = true;

                //txtEmail.Attributes.Add("OnFocus", "ToggleText('txtEmail','" + txtEmail.Text + "')");
                //txtEmail.Attributes.Add("OnBlur", "ToggleText('txtEmail','" + txtEmail.Text + "')");
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            pnlShaperResults.Visible = false;


            lnkSignIn.Text = Global.SetLnkSignIn();
            lnkSignUp.Text = Global.SetLnkSignUp();

            btnSearch.OnClientClick = ("javascript:__doPostBack('btnSearch','');event.returnValue=false;return false;");

            InitHash();

            if (!Page.IsPostBack)
            {
                hdnServer.Value = System.Configuration.ConfigurationSettings.AppSettings["ServerURL"];
                SetDefaults();
                LoadFilter();
            }
            if (hdnBoardCode.Value.Length > 0)
            {
                ShowShapers(Convert.ToInt32(hdnBoardCode.Value));
            }
        }
Exemplo n.º 14
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     lnkSignIn.Text        = Global.SetLnkSignIn( );
     lnkSignUp.Text        = Global.SetLnkSignUp( );
     panelMailSent.Visible = false;
 }
Exemplo n.º 15
0
/*
 * Increment the PageViewCount for the entry.  The value returned will be the display value
 */
        //public string incPageViewCount(string cnt)
        //{

        //    string tmpURL = Request.Url.ToString();

        //    if (Session[tmpURL] != null)
        //    {
        //        return cnt;
        //    }

        //    string connStr, strSQL;
        //    int retval;

        //    retval = 0;

        //    //get conn string
        //    connStr = ConfigurationManager.ConnectionStrings["myConn"].ConnectionString;;

        //    //cnt and iPageViewCount should be equal - do we need to check?
        //    if (Convert.ToInt32(cnt) < (int)1)
        //    {
        //        strSQL = "UPDATE tblEntry SET iPageViewCount = 1 WHERE iD = '" + Request.QueryString["iD"] + "'";
        //    }
        //    else
        //    {
        //        strSQL = "UPDATE tblEntry SET iPageViewCount = iPageViewCount + 1 WHERE iD = '" + Request.QueryString["iD"] + "'";
        //    }

        //    SqlConnection myConnection = new SqlConnection(connStr);

        //    try
        //    {
        //        myConnection.Open();

        //        SqlCommand objCommand = new SqlCommand(strSQL, myConnection);
        //        objCommand.ExecuteNonQuery();

        //        Session.Add(Request.Url.ToString(), Request.Url.ToString());
        //        retval = Convert.ToInt32(cnt) + 1;
        //    }

        //    catch (Exception ex)
        //    {
        //        ErrorLog.ErrorRoutine(false, "Error in PageViewCount processing: " + ex.Message );
        //        lblStatus.Text = "Error!";
        //    }
        //    finally
        //    {
        //        //close
        //        myConnection.Close();
        //    }
        //    return (retval.ToString());
        //}

/*
 */
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            //Connect to DB
            String strSQL;
            String myConnectString;

            //Formulate connect string to DB
            myConnectString = ConfigurationManager.ConnectionStrings["myConn"].ConnectionString;;

            //3. Formulate SQL
            strSQL = "SELECT * FROM tblUser WHERE txtEmail='" + txtUsername.Text + "'";

            SqlConnection myConnection = new SqlConnection(myConnectString);

            try
            {
                SqlCommand objCommand = new SqlCommand(strSQL, myConnection);
                myConnection.Open();

                SqlDataReader objReader = null;
                objReader = objCommand.ExecuteReader();

                if (objReader.Read() == true)
                {
                    string txtPass       = objReader["txtPassword"].ToString();
                    bool   bLoginSuccess = false;

                    if (objReader["sashimi"].ToString() == "1")
                    {
                        //get hasher pointer
                        BoardHunt.classes.hasher pHash = new BoardHunt.classes.hasher();
                        //get salt from db
                        string saltVal = objReader["salt"].ToString();

                        //compute hash from user input
                        byte[] tmpByte;
                        tmpByte = pHash.getHash(saltVal, txtPassword.Text);
                        string pwdToMatch = Convert.ToBase64String(tmpByte);

                        //check for match
                        if (pwdToMatch == txtPass)
                        {
                            bLoginSuccess = true;
                        }
                    }

                    //old algorithm
                    else
                    {
                        if (objReader["txtPassword"].ToString() == txtPassword.Text)
                        {
                            bLoginSuccess = true;
                        }
                    }

                    //check password match
                    if (bLoginSuccess)
                    {
                        // Successful login, save iD for user events while logged in
                        Session["LoggedIn"] = "Yes";
                        Session["userId"]   = objReader["iD"].ToString();
                        Session["EmailId"]  = objReader["txtEmail"].ToString();
                        Session["acctType"] = objReader["iAcctType"].ToString();
                        pnlLoginMsg.Visible = false;
                        pnlLogin.Visible    = false;

                        BindComments();

                        dlCommentList.Visible = true;
                        pnlCommentBox.Visible = true;

                        //Get text for login links
                        lnkSignIn.Text = Global.SetLnkSignIn();
                        lnkSignUp.Text = Global.SetLnkSignUp();
                    }
                    //login failed
                    else
                    {
                        Response.Redirect("login.aspx");
                    }
                }

                else
                {
                    //lblStatus.Text = "Incorrect Username";
                }

                myConnection.Close();
            }

            catch (Exception ex)
            {
                ErrorLog.ErrorRoutine(false, "Failed Log-in from pnlLogin: " + ex.Message);
            }
        }
Exemplo n.º 16
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            String strSQL;
            String myConnectString;

            // Put user code to initialize the page here
            Global.AuthenticateUser();

            Session["LoggedIn"] = "No";

            lnkSignIn.Text = Global.SetLnkSignIn();
            lnkSignUp.Text = Global.SetLnkSignUp();

            if (!Page.IsPostBack)
            {
                // Put user code to initialize the page here
                ErrorLog.ErrorRoutine(false, "Registered EmailId: " + Session["EmailId"].ToString());

                //Get DB connect string
                myConnectString = ConfigurationManager.ConnectionStrings["myConn"].ConnectionString;;

                //***TODO: E-mail verfication & activation
                //***see contact us page

                strSQL = "Select * FROM tblUser WHERE txtEmail = '" + Session["EmailId"].ToString() + "'";
                SqlConnection myConnection = new SqlConnection(myConnectString);

                string usersId = "unknown";

                try
                {
                    myConnection.Open();
                    SqlCommand objCommand = new SqlCommand(strSQL, myConnection);

                    SqlDataReader objReader = null;
                    objReader = objCommand.ExecuteReader();

                    if (objReader.Read())
                    {
                        usersId = objReader["iD"].ToString();
                        //ErrorLog.ErrorRoutine(false, "userId:" + usersId);

                        //Create dirs
                        if (CreateUserDir(usersId))
                        {
                            //set userID
                            //Session["userId"] = usersId;
                            //Session["LoggedIn"] = "Yes";
                            //Session["BlogFlg"] = "N";
                            //Session["LoggedIn"] = "No";

                            lblMessage.Text = "Your account has been created.  An e-mail confirmation has been sent.";
                            SendCongratEmail();
                            NotifyBHEmail(usersId);

                            if (Session["ServiceId"] != null)
                            {
                                if (Session["ServiceId"].ToString() == "6" || Session["ServiceId"].ToString() == "7") //upgrade
                                {
                                    classes.Login clsLogin = new classes.Login();
                                    if (clsLogin.DoLogin(Session["EmailId"].ToString(), string.Empty, true, true))
                                    {
                                        Session["LoggedIn"] = "Yes";
                                        Response.Redirect("Pay/OrderForm.aspx", false);
                                    }
                                }
                            }
                            else
                            {
                                Session["LoggedIn"] = "No";
                                Session["EmailId"]  = null;
                                Session["acctType"] = null;
                                Session["pw"]       = null;
                            }
                        }
                        else
                        {
                            Session["LoggedIn"] = "No";
                            Session["EmailId"]  = null;
                            Session["acctType"] = null;
                            Session["pw"]       = null;
                            ErrorLog.ErrorRoutine(false, "Error creating user dirs");
                            lblMessage.Text = "Registration Failed.  Please close this browser and try again.";
                        }
                    }
                    else
                    {
                        ErrorLog.ErrorRoutine(false, "RegisterFinish:PageLoad:Couldn't locate user.");
                        classes.Email.SendErrorEmail("RegisterFinish:PageLoad:Couldn't locate user.");
                    }
                }

                catch (Exception ex)
                {
                    ErrorLog.ErrorRoutine(false, "RegisterFinish:PageLoad: " + ex.Message);
                    lblMessage.Text     = "Registration Failed.  Please close this browser and try again.";
                    Session["LoggedIn"] = "No";
                    Session["EmailId"]  = null;
                    Session["pw"]       = null;
                    Session["acctType"] = null;
                }

                finally
                {
                    myConnection.Close();
                }
            }
        }
Exemplo n.º 17
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     // Put user code to initialize the page here
     lnkSignIn.Text = Global.SetLnkSignIn( );
     lnkSignUp.Text = Global.SetLnkSignUp( );
 }
Exemplo n.º 18
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            Global.AuthenticateUser();

            lnkSignIn.Text = Global.SetLnkSignIn();
            lnkSignUp.Text = Global.SetLnkSignUp();

            if (!Page.IsPostBack)
            {
                classes.BoardItem tmpBoardItem = (classes.BoardItem)Session["Item"];

                string serverURL = System.Configuration.ConfigurationSettings.AppSettings["ServerURL"];

                string entryId = GetNewEntryId();   //this should be moved closer to INSERT in p_preview
                hdnEntryVal.Value = entryId;

                BoardHunt.wsBH.BHService oWS = new BoardHunt.wsBH.BHService();
                oWS.InsertBoardForRatings(Convert.ToInt32(entryId.ToString()));

                string eLink;

                //reg posts
                if (tmpBoardItem.AdType != 4)
                {
                    pnlBoost.Visible        = true;
                    eLink                   = serverURL + "/surfboard.aspx?iD=" + entryId;
                    hypLnkPost.Visible      = true;
                    hypLnkPostModel.Visible = false;
                }
                else //AdType: 4 = Shaperhouse Model
                {
                    pnlBoost.Visible        = false;
                    eLink                   = serverURL + "/Shaper/ModelDetails.aspx?iD=" + entryId;
                    hypLnkPost.Visible      = false;
                    hypLnkPostModel.Visible = true;
                }

                //FB
                lnkFBShare.Attributes.Add("href", "javascript:void(window.open('http://www.facebook.com/sharer.php?u=" + eLink + "&t=Boardhunt.com|Surfboards+For+Sale'))");

                lnkLivePost.NavigateUrl = eLink;

                txtEntryLink.Text     = eLink;
                txtEntryLink.ReadOnly = true;

                switch (tmpBoardItem.AdType)
                {
                case 1:
                    break;

                case 2:
                    break;

                case 3:
                    lnkPostItem.Text        = serverURL + "/ShowcaseDetails.aspx?iD=" + entryId + "&uId=" + tmpBoardItem.IUser + "&iCat=" + tmpBoardItem.Category;
                    lnkPostItem.NavigateUrl = "ShowcaseDetails.aspx?iD=" + entryId + "&uId=" + tmpBoardItem.IUser + "&iCat=" + tmpBoardItem.Category;
                    break;

                case 4:
                    break;

                default:
                    break;
                }

                //hide upgrade for non-surf items
                if (tmpBoardItem.Category != (int)1)
                {
                    //btnUpgrade.Visible = false;
                }

                string[] eLinkArr = new string[4];
                eLinkArr[0] = eLink;
                eLinkArr[1] = tmpBoardItem.ActivateCode;
                eLinkArr[2] = entryId;

                //TODO: refine for categories and ad types
                if (tmpBoardItem.BoardType > 0)//surf or accessory?
                {
                    if (tmpBoardItem.AdType == 4)
                    {
                        eLinkArr[3] = tmpBoardItem.Model; //SH
                    }
                    else
                    {
                        eLinkArr[3] = tmpBoardItem.HtFt + "'" + " " + tmpBoardItem.HtIn + "\"" + " " + tmpBoardItem.Brand;
                    }
                }
                else
                {
                    eLinkArr[3] = tmpBoardItem.Brand + " " + tmpBoardItem.GearItem;
                }

                if (tmpBoardItem.AdType != 4)
                {
                    classes.Email.SendEmail("Thanks", Session["EmailId"].ToString(), classes.Email.MSG_THX_FOR_POST, eLinkArr);
                }
                else
                {
                    classes.Email.SendEmail("Thanks", Session["EmailId"].ToString(), classes.Email.MSG_THX_FOR_MODEL, eLinkArr);
                }


                //check for pro and..
                //BoardHunt.wsBH.BHService
                oWS = new BoardHunt.wsBH.BHService();
                string i = oWS.isPro(Convert.ToInt32(Session["userId"].ToString())).ToString();

                //set style accordingly
                if (i == "1")
                {
                    oWS.boost(Convert.ToInt32(Session["userId"].ToString()), Convert.ToInt32(entryId));
                    btnUpgradePro.Visible = false;
                    ImageButton1.Visible  = false;
                    hypLnkPost.Visible    = true;
                }
                else
                {
                    btnUpgradePro.Visible = true;
                    ImageButton1.Visible  = false;

                    if (classes.User.NeedsUpgrade(Convert.ToInt32(Session["userId"].ToString())))
                    {
                        hypLnkPost.Text        = "All free posts have been used.  Please UPGRADE your account to Pro in UserMenu";
                        hypLnkPost.NavigateUrl = "/UserMenu.aspx";
                    }
                }

                //All done - clean up Session variable
                Session["Item"] = null;
            }
        }