Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         string strUserName = MatrimonialMemberShip.GetUserName(TB_MatrimonialID.Text, true);
         if (strUserName != null)
         {
             //Is password Valid
             SimpleUser objUser = MatrimonialMemberShip.Authentication(strUserName, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5"));
             // YES
             if (objUser.AuthenticationStatus == true)
             {
                 string SeqtKey = RandomString.GenerateStirng(6, false);
                 Session.Add(SeqtKey, TB_MatrimonialID.Text);
                 Response.Redirect("EditProfile1.aspx?id=0&seqtkey=" + Server.UrlEncode(SeqtKey));
             }
             else
             {
                 L_Wron_Pass.Visible = true;
             }
         }
         else
         {
             PN_NoRecords.Visible = true;
             this.Title           = "No Profiles Matching";
         }
     }
 }
Esempio n. 2
0
 public static void ActivateMember(string ID, bool ISMatID)
 {
     if (ISMatID)
     {
         ID = MatrimonialMemberShip.GetUserName(ID, true);
     }
     SimpleUser temp = MatrimonialMemberShip.Authentication(ID, "Test");
 }
Esempio n. 3
0
    protected void B_Search_Click(object sender, EventArgs e)
    {
        //Searching

        // Setting Alurt invisile MatID
        PN_ID_NotFound.Visible = false;
        L_Wron_Pass.Visible    = false;

        // Is the Matrimonial ID valid
        string strUserName = MatrimonialMemberShip.GetUserName(TB_MatrimonialID.Text, true);

        if (strUserName != null)
        {
            //Is password Valid
            SimpleUser objUser = MatrimonialMemberShip.Authentication(strUserName, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5"));
            // YES
            if (objUser.AuthenticationStatus == true)
            {
                // make alnum visible
                PN_ID_Album.Visible = true;
                //Make ControlsInvisible
                L_Password.Visible              = false;
                TB_Password.Visible             = false;
                B_Search.Visible                = false;
                PN_ID_NotFound.Visible          = false;
                RequiredFieldValidator2.Visible = false;
                TB_MatrimonialID.ReadOnly       = true;


                //Does image is in Album
                if (MatrimonialAlbumManager.IsAlbumExists(objUser.ApplicationID))
                {
                    //Setting Photo

                    if (MatrimonialAlbumManager.IsImageExists(objUser.ApplicationID, MatrimonialAlbumManager.ImageType.Horoscope))
                    {
                        HL_Horo.ImageUrl = "~/Extras/imagecon.aspx?matid=" + TB_MatrimonialID.Text + "&id=5&type=124";
                    }
                    else
                    {
                        HL_Horo.ImageUrl = "~/Resources/horonotFound.gif";
                    }
                }
            }
            else// Password incorrect
            {
                L_Wron_Pass.Visible = true;
            }
        }
        else// Wrong User Name
        {
            PN_ID_NotFound.Visible = true;
        }
    }
Esempio n. 4
0
 protected void B_LogIN_Click(object sender, EventArgs e)
 {
     if (MatrimonialMemberShip.Authentication(MatrimonialMemberShip.GetUserName(TB_MatID.Text, true), FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5")).AuthenticationStatus)
     {
         PN_ID_Album.Visible    = true;
         PN_ID_NotFound.Visible = false;
         B_LogIN.Visible        = false;
         TB_Password.Visible    = false;
         TB_MatID.ReadOnly      = true;
         TB_MatID.BorderStyle   = BorderStyle.None;
         TB_MatID.BorderWidth   = 0;
         TB_MatID.Font.Bold     = true;
         L_Password.Visible     = false;
     }
     else
     {
         PN_ID_Album.Visible    = false;
         PN_ID_NotFound.Visible = true;
         B_LogIN.Visible        = true;
         TB_Password.Visible    = true;
         L_Password.Visible     = true;
     }
 }
Esempio n. 5
0
    //------------------------------------------------------------------------------------------------------------------------
    protected void Page_Load(object sender, EventArgs e)
    {
        //------------------------------------------------------------------------------------------------------------------------
        if (!IsPostBack)
        {
            //-------------------------------------------------------------------------------
            // Check whether bounsed form from Admin
            //-------------------------------------------------------------------------------
            strURL = FormsAuthentication.GetRedirectUrl("", false).ToLower();
            if (strURL.IndexOf("admin") > 0)
            {
                //user is accesing protected page
                Response.Redirect("../Extras/ErrorReport.aspx?id=403");
            }   //if
            //-------------------------------------------------------------------------------
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);
            //-------------------------------------------------------------------------------
            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);
            //-------------------------------------------------------------------------------
        }
        else
        {
            //-------------------------------------------------------------------------------
            strURL = FormsAuthentication.GetRedirectUrl("", false);
            //---------------------------------------------------------------------------------------------------------------------------------------------------
            SimpleUser objUser = MatrimonialMemberShip.Authentication(TB_ID.Text, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5"));
            //---------------------------------------------------------------------------------------------------------------------------------------------------
            // user authentication
            if (objUser.AuthenticationStatus == true)
            {
                //Create new cokkie for storing user informations
                HttpCookie objHttpCookie;
                //Redirection is Depending on the user
                switch (objUser.Membership)
                {
                //-------------------------------------------------------------------------------
                case SimpleUser.UserType.RegistrationStep1:    //-->>Registration Step1
                    //Setting Registration Cookie
                    FormsAuthentication.SetAuthCookie("Registar", false);
                    //Adding Information Into Cookie
                    objHttpCookie = new HttpCookie("MatRegInfo");
                    objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                    Response.Cookies.Add(objHttpCookie);
                    //Transfering control to step 2
                    Server.Transfer("~/Registration/RegistrationStep2.aspx");
                    break;

                //-------------------------------------------------------------------------------
                case SimpleUser.UserType.RegistrationStep2:    //-->>Registration Step3
                    FormsAuthentication.SetAuthCookie("Registar", false);
                    //Adding Information Into Cookie
                    objHttpCookie = new HttpCookie("MatRegInfo");
                    objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                    Response.Cookies.Add(objHttpCookie);
                    //Transfering control to step 3
                    Server.Transfer("~/Registration/RegistrationStep3.aspx");
                    break;

                //-------------------------------------------------------------------------------
                case SimpleUser.UserType.RegistrationStep3:    //-->>Registration Step4
                    FormsAuthentication.SetAuthCookie("Registar", false);
                    //Adding Information Into Cookie
                    objHttpCookie = new HttpCookie("MatRegInfo");
                    objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                    Response.Cookies.Add(objHttpCookie);
                    //Transfering control to step 4
                    Server.Transfer("~/Registration/RegistrationStep4.aspx");
                    break;

                //-------------------------------------------------------------------------------
                case SimpleUser.UserType.FreeMember:     // FreeMember
                    // setting Cookie
                    objHttpCookie = new HttpCookie("MatCookie5639sb");
                    objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                    objHttpCookie.Values["UserName"]      = Crypto.EnCrypto(objUser.UserName);
                    objHttpCookie.Values["MatrimonialID"] = Crypto.EnCrypto(objUser.MatrimonialID);
                    objHttpCookie.Values["UserType"]      = Crypto.EnCrypto(objUser.Membership.ToString());

                    // makking cookie Persistant
                    if (CB.Checked)
                    {
                        objHttpCookie.Expires = DateTime.MaxValue;
                    }
                    Response.Cookies.Add(objHttpCookie);

                    //Setting Form Authentication
                    FormsAuthentication.RedirectFromLoginPage("Members", CB.Checked);
                    break;

                //-------------------------------------------------------------------------------
                case SimpleUser.UserType.PaidMember:    // Paid User
                    // setting Cookie
                    objHttpCookie = new HttpCookie("MatCookie5639sb");
                    objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                    objHttpCookie.Values["UserName"]      = Crypto.EnCrypto(objUser.UserName);
                    objHttpCookie.Values["MatrimonialID"] = Crypto.EnCrypto(objUser.MatrimonialID);
                    objHttpCookie.Values["UserType"]      = Crypto.EnCrypto(objUser.Membership.ToString());

                    // makking cookie Persistant
                    if (CB.Checked)
                    {
                        objHttpCookie.Expires = DateTime.MaxValue;
                    }
                    Response.Cookies.Add(objHttpCookie);

                    //Setting Form Authentication
                    FormsAuthentication.RedirectFromLoginPage("Members", CB.Checked);
                    break;

                //-------------------------------------------------------------------------------
                default:
                    L_WPassword.Visible = true;
                    break;
                    //-------------------------------------------------------------------------------
                }
            }
            else
            {
                // InValid user Name
                //-------------------------------------------------------------------------------
                L_WPassword.Visible = true;
                //-------------------------------------------------------------------------------
            }
        }
    }
    protected void B_Search_Click(object sender, EventArgs e)
    {
        // Setting Alurt invisile MatID
        PN_ID_NotFound.Visible = false;
        L_Wron_Pass.Visible    = false;

        // Is the Matrimonial ID valid
        string strUserName = MatrimonialMemberShip.GetUserName(TB_MatrimonialID.Text, true);

        if (strUserName != null)
        {
            //Is password Valid
            SimpleUser objUser = MatrimonialMemberShip.Authentication(strUserName, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5"));
            // YES
            if (objUser.AuthenticationStatus == true)
            {
                // make alnum visible
                PN_ID_Album.Visible = true;
                //Make ControlsInvisible
                L_Password.Visible     = false;
                TB_Password.Visible    = false;
                B_Search.Visible       = false;
                PN_ID_NotFound.Visible = false;
                //Delete Or Uplaod

                //Does image is in Album
                if (MatrimonialAlbumManager.IsAlbumExists(objUser.ApplicationID))
                {
                    bool boolUpload = false;

                    switch (HF_Type.Value)
                    {
                    case "1":
                        boolUpload = true;
                        HL_UP_1.Attributes.Add("onclick", "window.open('UploadImage.aspx?image=1&matid=" + TB_MatrimonialID.Text + "','Upload','scrollbars=no,width=600,height=285')");
                        HL_UP_1.Visible  = true;
                        B_delete.Visible = false;
                        break;

                    case "2":
                        boolUpload       = false;
                        HL_UP_1.Visible  = false;
                        B_delete.Visible = true;
                        break;

                    case null:
                        Response.Redirect("~/Extras/Errorreport.aspx?id=405");
                        break;

                    default:
                        break;
                    }



                    //Setting Photo

                    if (MatrimonialAlbumManager.IsImageExists(objUser.ApplicationID, MatrimonialAlbumManager.ImageType.Photo))
                    {
                        HL_Photo_1.ImageUrl = "~/Extras/imagecon.aspx?matid=" + TB_MatrimonialID.Text + "&id=1";
                        if (boolUpload)
                        {
                            HL_UP_1.ImageUrl = "~/Resources/ChangePhoto.gif";
                        }
                        else
                        {
                            CB_P.Visible = true;
                        }
                    }

                    // setting Album images For Paid members

                    if (objUser.Membership == SimpleUser.UserType.PaidMember)
                    {
                        if (boolUpload)
                        {
                            HL_UP_2.Attributes.Add("onclick", "window.open('UploadImage.aspx?image=2&matid=" + TB_MatrimonialID.Text + "','Upload','scrollbars=no,width=600,height=285')");
                            HL_UP_3.Attributes.Add("onclick", "window.open('UploadImage.aspx?image=3&matid=" + TB_MatrimonialID.Text + "','Upload','scrollbars=no,width=600,height=285')");
                            HL_UP_4.Attributes.Add("onclick", "window.open('UploadImage.aspx?image=4&matid=" + TB_MatrimonialID.Text + "','Upload','scrollbars=no,width=600,height=285')");
                            HL_UP_1.Visible = true;
                            HL_UP_2.Visible = true;
                            HL_UP_3.Visible = true;
                            HL_UP_4.Visible = true;
                        }


                        //setting image

                        if (MatrimonialAlbumManager.IsImageExists(objUser.ApplicationID, MatrimonialAlbumManager.ImageType.Album1))
                        {
                            HL_Album_1.ImageUrl = "~/Extras/imagecon.aspx?matid=" + TB_MatrimonialID.Text + "&id=2&type=124";
                            HL_Album_1.Attributes.Add("onclick", "window.open('../../Extras/ViewLargeImage.aspx?matid=" + TB_MatrimonialID.Text + "&image=2','LargerImage','scrollbars=no,width=600,height=285')");
                            HL_Album_1.ToolTip     = "Click Here to View Larger Image";
                            HL_Album_1.NavigateUrl = "#";
                            if (!boolUpload)
                            {
                                CB_ALB_1.Visible = true;
                            }
                            else
                            {
                                HL_UP_2.ImageUrl = "~/Resources/ChangePhoto.gif";
                            }

                            //
                        }
                        else
                        {
                            HL_Album_1.ImageUrl = "~/Resources/nophoto.gif";
                        }

                        if (MatrimonialAlbumManager.IsImageExists(objUser.ApplicationID, MatrimonialAlbumManager.ImageType.Album2))
                        {
                            HL_Album_2.ImageUrl = "~/Extras/imagecon.aspx?matid=" + TB_MatrimonialID.Text + "&id=3&type=124";
                            HL_Album_2.Attributes.Add("onclick", "window.open('../../Extras/ViewLargeImage.aspx?matid=" + TB_MatrimonialID.Text + "&image=3','LargerImage','scrollbars=no,width=600,height=285')");
                            HL_Album_2.ToolTip     = "Click Here to View Larger Image";
                            HL_Album_2.NavigateUrl = "#";
                            if (!boolUpload)
                            {
                                CB_ALB_2.Visible = true;
                            }
                            else
                            {
                                HL_UP_3.ImageUrl = "~/Resources/ChangePhoto.gif";
                            }
                        }
                        else
                        {
                            HL_Album_2.ImageUrl = "~/Resources/nophoto.gif";
                        }
                        if (MatrimonialAlbumManager.IsImageExists(objUser.ApplicationID, MatrimonialAlbumManager.ImageType.Album3))
                        {
                            HL_Album_3.ImageUrl = "~/Extras/imagecon.aspx?matid=" + TB_MatrimonialID.Text + "&id=4&type=124";
                            HL_Album_3.Attributes.Add("onclick", "window.open('../../Extras/ViewLargeImage.aspx?matid=" + TB_MatrimonialID.Text + "&image=4','LargerImage','scrollbars=no,width=600,height=285')");
                            HL_Album_3.ToolTip     = "Click Here to View Larger Image";
                            HL_Album_3.NavigateUrl = "#";
                            if (!boolUpload)
                            {
                                CB_ALB_3.Visible = true;
                            }
                            else
                            {
                                HL_UP_4.ImageUrl = "~/Resources/ChangePhoto.gif";
                            }
                        }
                        else
                        {
                            HL_Album_3.ImageUrl = "~/Resources/nophoto.gif";
                        }

                        L_MatID.Text             = TB_MatrimonialID.Text.ToUpper();
                        TB_MatrimonialID.Visible = false;
                    }
                }
            }
            else    // Password incorrect
            {
                L_Wron_Pass.Visible = true;
            }
        }
        else    // Wrong User Name
        {
            PN_ID_NotFound.Visible = true;
        }
    }
Esempio n. 7
0
    }     // Page_load

    //  Login Button Click
    protected void IB_LogIn_Click(object sender, ImageClickEventArgs e)
    {
        //---------------------------------------------------------------------------------------------------------------
        strURL = FormsAuthentication.GetRedirectUrl("", false);
        //  Getting User Details
        SimpleUser objUser = MatrimonialMemberShip.Authentication(TB_ID.Text, FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password.Text, "MD5"));

        //---------------------------------------------------------------------------------------------------------------
        // user authentication
        if (objUser.AuthenticationStatus == true)
        {
            HttpCookie objHttpCookie;
            //Redirection Depending on the user
            switch (objUser.Membership)
            {
            //---------------------------------------------------------------------------------------------------------------
            case SimpleUser.UserType.RegistrationStep1:    //-->>Registration Step1
                //Setting Registration Cookie
                FormsAuthentication.SetAuthCookie("Registar", false);
                //Adding Information Into Cookie
                objHttpCookie = new HttpCookie("MatRegInfo");
                objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                Response.Cookies.Add(objHttpCookie);
                //Transfering control to step 2
                Server.Transfer("~/Registration/RegistrationStep2.aspx");
                break;

            //---------------------------------------------------------------------------------------------------------------
            case SimpleUser.UserType.RegistrationStep2:    //-->>Registration Step3
                FormsAuthentication.SetAuthCookie("Registar", false);
                //Adding Information Into Cookie
                objHttpCookie = new HttpCookie("MatRegInfo");
                objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                Response.Cookies.Add(objHttpCookie);
                //Transfering control to step 3
                Server.Transfer("~/Registration/RegistrationStep3.aspx");
                break;

            //---------------------------------------------------------------------------------------------------------------
            case SimpleUser.UserType.RegistrationStep3:    //-->>Registration Step4
                FormsAuthentication.SetAuthCookie("Registar", false);
                //Adding Information Into Cookie
                objHttpCookie = new HttpCookie("MatRegInfo");
                objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                Response.Cookies.Add(objHttpCookie);
                //Transfering control to step 4
                Server.Transfer("~/Registration/RegistrationStep4.aspx");
                break;

            //---------------------------------------------------------------------------------------------------------------
            case SimpleUser.UserType.FreeMember:     // FreeMember
                // setting Cookie
                objHttpCookie = new HttpCookie("MatCookie5639sb");
                objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                objHttpCookie.Values["UserName"]      = Crypto.EnCrypto(objUser.UserName);
                objHttpCookie.Values["MatrimonialID"] = Crypto.EnCrypto(objUser.MatrimonialID);
                objHttpCookie.Values["UserType"]      = Crypto.EnCrypto(objUser.Membership.ToString());
                Response.Cookies.Add(objHttpCookie);
                //Setting Form Authentication
                FormsAuthentication.RedirectFromLoginPage("Members", false);
                break;

            //---------------------------------------------------------------------------------------------------------------
            case SimpleUser.UserType.PaidMember:    // Paid User
                // setting Cookie
                objHttpCookie = new HttpCookie("MatCookie5639sb");
                objHttpCookie.Values["ApplicationID"] = Crypto.EnCrypto(objUser.ApplicationID);
                objHttpCookie.Values["UserName"]      = Crypto.EnCrypto(objUser.UserName);
                objHttpCookie.Values["MatrimonialID"] = Crypto.EnCrypto(objUser.MatrimonialID);
                objHttpCookie.Values["UserType"]      = Crypto.EnCrypto(objUser.Membership.ToString());
                Response.Cookies.Add(objHttpCookie);
                //Setting Form Authentication
                FormsAuthentication.RedirectFromLoginPage("Members", false);
                //---------------------------------------------------------------------------------------------------------------
                break;

            default:
                //This Will Never Happen
                ErrorLog.WriteLog("Guest_Home.IB_LogIn_Click -- > objUser.Membership > 6");
                Response.Redirect("Login.aspx");
                break;
                //---------------------------------------------------------------------------------------------------------------
            }
            //---------------------------------------------------------------------------------------------------------------
        }
        else
        {
            //---------------------------------------------------------------------------------------------------------------
            Response.Redirect("Login.aspx");
            //---------------------------------------------------------------------------------------------------------------
        }
    }