protected void Page_Load(object sender, EventArgs e) { Extension = SageFrameSettingKeys.PageExtension; IncludeJs("loginanimation", "/Modules/Admin/LoginControl/js/login.js"); IncludeJs("UserRegistration", "/js/jquery.pstrength-min.1.2.js"); IncludeJs("UserRegistrationValidation", "/js/jquery.validate.js"); try { if (!IsParent) { defpage = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + Extension); } else { defpage = ResolveUrl("~/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + Extension); } int UserRegistrationType = pagebase.GetSettingIntValueByIndividualKey(SageFrameSettingKeys.PortalUserRegistration); if (UserRegistrationType == 0) { Response.Redirect(defpage); } IncludeCss("UserRegistration", "/Administrator/Templates/Default/css/login.css"); ForgotPasswordInfo template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.USER_REGISTRATION_HELP, GetPortalID); if (template != null) { headerTemplate = "<div>" + template.Body + "</div>"; } if (!IsPostBack) { if (_member.EnableCaptcha) { InitializeCaptcha(); GenerateCaptchaImage(); } else { HideCaptcha(); } SetValidatorErrorMessage(); CheckDivVisibility(true, false); this.divRegister.Visible = true; this.divRegistration.Visible = false; this.divRegConfirm.Visible = false; } if (!IsParent) { LoginPath = ResolveUrl("~/portal/" + GetPortalSEOName + pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalLoginpage) + Extension); } else { LoginPath = ResolveUrl("~/" + pagebase.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalLoginpage) + Extension); } } catch (Exception ex) { ProcessException(ex); } }
protected void btnForgetPassword_Click(object sender, EventArgs e) { if (ValidateCaptcha()) { MembershipController member = new MembershipController(); if (txtEmail.Text != "") { UserInfo user = member.GerUserByEmail(txtEmail.Text, GetPortalID); if (!string.IsNullOrEmpty(user.UserName)) { if (user.Email.ToLower().Equals(txtEmail.Text.ToLower())) { ForgotPasswordInfo objInfo = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_FORGOT_USERNAME_PASSWORD_MATCH, GetPortalID); List <ForgotPasswordInfo> objList = UserManagementController.GetMessageTemplateListByMessageTemplateTypeID(SystemSetting.PASSWORD_CHANGE_REQUEST_EMAIL, GetPortalID); foreach (ForgotPasswordInfo objPwd in objList) { DataTable dtTokenValues = UserManagementController.GetPasswordRecoveryTokenValue(user.UserName, GetPortalID); CommonFunction comm = new CommonFunction(); string replaceMessageSubject = MessageToken.ReplaceAllMessageToken(objPwd.Subject, dtTokenValues); string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(objPwd.Body, dtTokenValues); try { divForgotPasswordFrom.Visible = false; divSuccessReq.Visible = true; divSuccessReq.InnerHtml = "<h3>Password recover request is success and recover link is send to " + user.Email + " <h3>"; MailHelper.SendMailNoAttachment(objPwd.MailFrom, txtEmail.Text, replaceMessageSubject, replacedMessageTemplate, string.Empty, string.Empty); } catch (Exception) { FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("PasswordRecovery", "SecureConnectionFPError")); } } } else { InitializeCaptcha(); FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("PasswordRecovery", "UsernameOrEmailAddressDoesnotMatched")); } } else { InitializeCaptcha(); FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserManagement", "UserDoesnotExist")); } } else { InitializeCaptcha(); FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("PasswordRecovery", "PleaseEnterAllTheRequiredFields")); } } else { CaptchaValue.Text = string.Empty; } }
public void HandlePostRegistration(int UserRegistrationType) { switch (UserRegistrationType) { case 0: ForgotPasswordInfo template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.USER_RESISTER_SUCESSFUL_INFORMATION_NONE, GetPortalID); if (template != null) { USER_RESISTER_SUCESSFUL_INFORMATION.Text = template.Body; } break; case 1: template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.USER_RESISTER_SUCESSFUL_INFORMATION_PRIVATE, GetPortalID); if (template != null) { USER_RESISTER_SUCESSFUL_INFORMATION.Text = template.Body; } this.divRegistration.Visible = true; this.divRegConfirm.Visible = true; this.divRegister.Visible = false; break; case 3: template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.USER_RESISTER_SUCESSFUL_INFORMATION_VERIFIED, GetPortalID); if (template != null) { USER_RESISTER_SUCESSFUL_INFORMATION.Text = template.Body; } List <ForgotPasswordInfo> objFpwd = UserManagementController.GetMessageTemplateListByMessageTemplateTypeID(SystemSetting.ACCOUNT_ACTIVATION_EMAIL, GetPortalID); foreach (ForgotPasswordInfo messageTemplate in objFpwd) { CommonFunction comm = new CommonFunction(); DataTable dtActivationTokenValues = UserManagementController.GetActivationTokenValue(UserName.Text, GetPortalID); string replaceMessageSubject = MessageToken.ReplaceAllMessageToken(messageTemplate.Subject, dtActivationTokenValues); string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(messageTemplate.Body, UserName.Text, GetPortalID); // string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(messageTemplate.Body, dtActivationTokenValues); MailHelper.SendMailNoAttachment(messageTemplate.MailFrom, Email.Text, replaceMessageSubject, replacedMessageTemplate, string.Empty, string.Empty); } // CheckDivVisibility(false, true); this.divRegistration.Visible = true; this.divRegConfirm.Visible = true; this.divRegister.Visible = false; break; case 2: template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.USER_RESISTER_SUCESSFUL_INFORMATION_PUBLIC, GetPortalID); if (template != null) { USER_RESISTER_SUCESSFUL_INFORMATION.Text = template.Body; } LogInPublicModeRegistration(); break; } }
protected void Page_Load(object sender, EventArgs e) { IncludeJs("LoginEncrytDecryt", "/Modules/Admin/LoginControl/js/AESEncrytDecryt.js"); IncludeCss("PasswordRecovery", "/Modules/WebbuilderHelper/css/login.css"); ForgotPasswordInfo objInfo = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_HELP, GetPortalID); if (objInfo != null) { helpTemplate = objInfo.Body; } if (!IsPostBack) { if (Request.QueryString["RecoveringCode"] != null) { QueryValue = Request.QueryString["RecoveringCode"].ToString(); try { rfvConfirmPass.Visible = true; rfvPassword.Visible = true; cmpPassword.Visible = true; QueryValue = EncryptionMD5.Decrypt(QueryValue); sageframeuser = UserManagementController.GetUsernameByActivationOrRecoveryCode(QueryValue, GetPortalID); if (sageframeuser.CodeForUsername != null) { if (sageframeuser.IsAlreadyUsed) { FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("PasswordRecovery", "RecoveryCodeAlreadyActivated")); divRecoverPasswordFrom.Visible = false; } else { hdnUserName.Value = sageframeuser.CodeForUsername; divRecoverPasswordFrom.Visible = true; } } else { divRecoverPasswordFrom.Visible = false; FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("UserManagement", "UserDoesNotExist")); } } catch (Exception ex) { divRecoverPasswordFrom.Visible = false; FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("PasswordRecovery", "InvalidRecoveringCode")); } } else { divRecoverPasswordFrom.Visible = false; FailureText.Text = string.Format("<p class='sfError'>{0}</p>", GetSageMessage("PasswordRecovery", "RecoveringCodeIsNotAvailable")); } } }
protected void Page_Load(object sender, EventArgs e) { ForgotPasswordInfo objInfo = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_HELP, GetPortalID); if (objInfo != null) { helpTemplate = objInfo.Body; } if (!IsPostBack) { string RecoveringCode = string.Empty; if (Request.QueryString["RecoveringCode"] != null) { RecoveringCode = Request.QueryString["RecoveringCode"].ToString(); try { RecoveringCode = EncryptionMD5.Decrypt(RecoveringCode); hdnRecoveryCode.Value = RecoveringCode; AddImageUrls(); sageframeuser = UserManagementController.GetUsernameByActivationOrRecoveryCode(hdnRecoveryCode.Value, GetPortalID); if (sageframeuser.CodeForUsername != null) { if (sageframeuser.IsAlreadyUsed) { ShowMessage("", GetSageMessage("PasswordRecovery", "RecoveryCodeAlreadyActivated"), "", SageMessageType.Alert); divRecoverpwd.Visible = false; } else { divRecoverpwd.Visible = true; } } else { divRecoverpwd.Visible = false; ShowMessage("", GetSageMessage("UserManagement", "UserDoesNotExist"), "", SageMessageType.Alert); } } catch { ShowMessage("", GetSageMessage("PasswordRecovery", "InvalidRecoveringCode"), "", SageMessageType.Alert); divRecoverpwd.Visible = false; } } else { ShowMessage("", GetSageMessage("PasswordRecovery", "RecoveringCodeIsNotAvailable"), "", SageMessageType.Error); divRecoverpwd.Visible = false; } SetValidatorErrorMessage(); } }
protected void Page_Load(object sender, EventArgs e) { IncludeLanguageJS(); ForgotPasswordInfo objInfo = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_FORGOT_HELP, GetPortalID); if (objInfo != null) { helpTemplate = "<b>" + objInfo.Body + "</b>"; } if (!IsPostBack) { InitializeCaptcha(); GenerateCaptchaImage(); //SetValidatorErrorMessage(); } }
protected void Page_Load(object sender, EventArgs e) { //var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_FORGET_HELP, GetPortalID).SingleOrDefault(); ForgetPasswordInfo objInfo = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_FORGET_HELP, GetPortalID); //if (template != null) //{ // helpTemplate = "<b>" + template.Body+ "</b>"; //} if (objInfo != null) { helpTemplate = "<b>" + objInfo.Body + "</b>"; } IsUseFriendlyUrls = pb.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); if (!IsPostBack) { SetValidatorErrorMessage(); } }
protected void wzdPasswordRecover_NextButtonClick(object sender, WizardNavigationEventArgs e) { try { if (txtPassword.Text != null && txtRetypePassword.Text != "" && txtRetypePassword.Text == txtPassword.Text) { if (txtPassword.Text.Length < 4) { ShowMessage("", GetSageMessage("PasswordRecovery", "PasswordLength"), "", SageMessageType.Alert); e.Cancel = true; } else { if (hdnRecoveryCode.Value != "") { sageframeuser = UserManagementController.GetUsernameByActivationOrRecoveryCode(hdnRecoveryCode.Value, GetPortalID); if (sageframeuser.CodeForUsername != null) { UserInfo userOld = m.GetUserDetails(GetPortalID, sageframeuser.CodeForUsername); string Password, PasswordSalt; PasswordHelper.EnforcePasswordSecurity(m.PasswordFormat, txtPassword.Text, out Password, out PasswordSalt); UserInfo user = new UserInfo(userOld.UserID, Password, PasswordSalt, m.PasswordFormat); m.ChangePassword(user); List <ForgotPasswordInfo> messageTemplates = UserManagementController.GetMessageTemplateListByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_SUCCESSFUL_EMAIL, GetPortalID); foreach (ForgotPasswordInfo messageTemplate in messageTemplates) { DataTable dtTokenValues = UserManagementController.GetPasswordRecoverySuccessfulTokenValue(userOld.UserName, GetPortalID); string replacedMessageSubject = MessageToken.ReplaceAllMessageToken(messageTemplate.Subject, dtTokenValues); string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(messageTemplate.Body, dtTokenValues); try { MailHelper.SendMailNoAttachment(messageTemplate.MailFrom, userOld.Email, replacedMessageSubject, replacedMessageTemplate, string.Empty, string.Empty); } catch (Exception) { ShowMessage("", GetSageMessage("PasswordRecovery", "SecureConnectionFPRError"), "", SageMessageType.Alert); e.Cancel = true; divRecoverpwd.Visible = false; } } UserManagementController.DeactivateRecoveryCode(userOld.UserName, GetPortalID); ForgotPasswordInfo template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_SUCESSFUL_INFORMATION, GetPortalID); if (template != null) { ((Literal)WizardStep2.FindControl("litPasswordChangedSuccessful")).Text = template.Body; } } else { e.Cancel = true; ShowMessage("", GetSageMessage("PasswordRecovery", "UnknownErrorPleaseTryAgaing"), "", SageMessageType.Alert); } } else { e.Cancel = true; ShowMessage("", GetSageMessage("PasswordRecovery", "UnknownError"), "", SageMessageType.Alert); } } } else { ShowMessage("", GetSageMessage("PasswordRecovery", "PleaseEnterAllRequiredFields"), "", SageMessageType.Alert); e.Cancel = true; } } catch (Exception ex) { ProcessException(ex); } }
protected void wzdForgetPassword_NextButtonClick(object sender, WizardNavigationEventArgs e) { try { MembershipController member = new MembershipController(); if (txtEmail.Text != "" && txtUsername.Text != "") { UserInfo user = member.GetUserDetails(GetPortalID, txtUsername.Text); if (user.UserExists) { if (user.IsApproved == true) { if (user.Email.ToLower().Equals(txtEmail.Text.ToLower())) { ForgetPasswordInfo objInfo = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_FORGET_USERNAME_PASSWORD_MATCH, GetPortalID); if (objInfo != null) { ((Literal)WizardStep2.FindControl("litInfoEmailFinish")).Text = objInfo.Body; } List <ForgetPasswordInfo> objList = UserManagementController.GetMessageTemplateListByMessageTemplateTypeID(SystemSetting.PASSWORD_CHANGE_REQUEST_EMAIL, GetPortalID); foreach (ForgetPasswordInfo objPwd in objList) { DataTable dtTokenValues = UserManagementController.GetPasswordRecoveryTokenValue(txtUsername.Text, GetPortalID); CommonFunction comm = new CommonFunction(); string replaceMessageSubject = MessageToken.ReplaceAllMessageToken(objPwd.Subject, dtTokenValues); string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(objPwd.Body, dtTokenValues); try { MailHelper.SendMailNoAttachment(objPwd.MailFrom, txtEmail.Text, replaceMessageSubject, replacedMessageTemplate, string.Empty, string.Empty); } catch (Exception) { divForgotPwd.Visible = false; ShowMessage("", GetSageMessage("PasswordRecovery", "SecureConnectionFPError"), "", SageMessageType.Alert); e.Cancel = true; } } } else { ShowMessage("", GetSageMessage("PasswordRecovery", "UsernameOrEmailAddressDoesnotMatched"), "", SageMessageType.Alert); e.Cancel = true; } } else { ShowMessage("", GetSageMessage("PasswordRecovery", "UsernameNotActivated"), "", SageMessageType.Alert); e.Cancel = true; } } else { ShowMessage("", GetSageMessage("UserManagement", "UserDoesNotExist"), "", SageMessageType.Alert); e.Cancel = true; } } else { e.Cancel = true; ShowMessage("", GetSageMessage("PasswordRecovery", "PleaseEnterAllTheRequiredFields"), "", SageMessageType.Alert); } } catch (Exception ex) { ProcessException(ex); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { SageFrameConfig pb = new SageFrameConfig(); string ActivationCode = string.Empty; if (Request.QueryString["ActivationCode"] != null) { ActivationCode = Request.QueryString["ActivationCode"].ToString(); try { ActivationCode = EncryptionMD5.Decrypt(ActivationCode); } catch { ShowMessage("", GetSageMessage("UserRegistration", "InvalidActivationCode"), "", SageMessageType.Alert); return; } ForgotPasswordInfo sageframeuser = new ForgotPasswordInfo(); sageframeuser = UserManagementController.GetUsernameByActivationOrRecoveryCode(ActivationCode, GetPortalID); if (sageframeuser.CodeForUsername != null) { if (!sageframeuser.IsAlreadyUsed) { string UserName = _member.ActivateUser(ActivationCode, GetPortalID); if (!String.IsNullOrEmpty(UserName)) { UserInfo user = _member.GetUserDetails(GetPortalID, UserName); if (user.UserExists) { List <ForgotPasswordInfo> messageTemplates = UserManagementController.GetMessageTemplateListByMessageTemplateTypeID(SystemSetting.ACTIVATION_SUCCESSFUL_EMAIL, GetPortalID); foreach (ForgotPasswordInfo messageTemplate in messageTemplates) { DataTable dtActivationSuccessfulTokenValues = UserManagementController.GetActivationSuccessfulTokenValue(user.UserName, GetPortalID); string replaceMessageSubject = MessageToken.ReplaceAllMessageToken(messageTemplate.Subject, dtActivationSuccessfulTokenValues); string replacedMessageTemplate = MessageToken.ReplaceAllMessageToken(messageTemplate.Body, dtActivationSuccessfulTokenValues); try { MailHelper.SendMailNoAttachment(messageTemplate.MailFrom, user.Email, replaceMessageSubject, replacedMessageTemplate, string.Empty, string.Empty); } catch (Exception) { ShowMessage("", GetSageMessage("UserRegistration", "SecureConnectionUAEmailError"), "", SageMessageType.Alert); return; } } ForgotPasswordInfo template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_SUCCESSFUL_INFORMATION, GetPortalID); if (template != null) { ACTIVATION_INFORMATION.Text = template.Body; } ; LogInPublicModeRegistration(user); } else { ShowMessage("", GetSageMessage("UserManagement", "UserDoesNotExist"), "", SageMessageType.Alert); } } else { ForgotPasswordInfo template = UserManagementController.GetMessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_FAIL_INFORMATION, GetPortalID); if (template != null) { ACTIVATION_INFORMATION.Text = template.Body; } ; } } else { ShowMessage("", GetSageMessage("UserRegistration", "ActivationCodeAlreadyUsed"), "", SageMessageType.Alert); } } else { ShowMessage("", GetSageMessage("UserManagement", "UserDoesNotExist"), "", SageMessageType.Alert); } } } catch (Exception ex) { ProcessException(ex); } } }