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) { MessageTemplateDataContext dbMessageTemplate = new MessageTemplateDataContext(SystemSetting.SageFrameConnectionString); var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.PASSWORD_RECOVERED_HELP, GetPortalID).SingleOrDefault(); if (template != null) { helpTemplate = template.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(); UserManagementDataContext dbUser = new UserManagementDataContext(SystemSetting.SageFrameConnectionString); var sageframeuser = dbUser.sp_GetUsernameByActivationOrRecoveryCode(hdnRecoveryCode.Value, GetPortalID).SingleOrDefault(); if (sageframeuser.CodeForUsername != null) { if ((bool)(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(SageMessageTitle.Notification.ToString(), GetSageMessage("PasswordRecovery", "InvalidRecoveringCode"), "", SageMessageType.Alert); divRecoverpwd.Visible = false; } } else { ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("PasswordRecovery", "RecoveringCodeIsNotAvailable"), "", SageMessageType.Error); divRecoverpwd.Visible = false; } SetValidatorErrorMessage(); } }
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) { 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); } } }
protected void Page_Load(object sender, EventArgs e) { SageFrameConfig pagebase = new SageFrameConfig(); IsUseFriendlyUrls = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls); hypGotoLogin.Text = GetSageMessage("UserRegistration", "GoToLogin"); if (IsUseFriendlyUrls) { if (GetPortalID > 1) { hypGotoLogin.NavigateUrl = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage) + ".aspx"); } else { hypGotoLogin.NavigateUrl = ResolveUrl("~/" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage) + ".aspx"); } } else { hypGotoLogin.NavigateUrl = ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage)); } if (!IsPostBack) { try { MessageTemplateDataContext dbMessageTemplate = new MessageTemplateDataContext(SystemSetting.SageFrameConnectionString); string ActivationCode = string.Empty; if (Request.QueryString["ActivationCode"] != null) { ActivationCode = Request.QueryString["ActivationCode"].ToString(); try { ActivationCode = EncryptionMD5.Decrypt(ActivationCode); } catch { ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("UserRegistration", "InvalidActivationCode"), "", SageMessageType.Alert); return; } UserManagementDataContext dbUser = new UserManagementDataContext(SystemSetting.SageFrameConnectionString); var sageframeuser = dbUser.sp_GetUsernameByActivationOrRecoveryCode(ActivationCode, GetPortalID).SingleOrDefault(); if (sageframeuser.CodeForUsername != null) { if (!(bool)(sageframeuser.IsAlreadyUsed)) { string UserName = _member.ActivateUser(ActivationCode, GetPortalID, GetStoreID); if (!String.IsNullOrEmpty(UserName)) { UserInfo user = _member.GetUserDetails(GetPortalID, UserName); if (user.UserExists) { var messageTemplates = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_SUCCESSFUL_EMAIL, GetPortalID); foreach (var messageTemplate in messageTemplates) { var linqActivationTokenValues = messageTokenDB.sp_GetActivationSuccessfulTokenValue(user.UserName, GetPortalID); CommonFunction comm = new CommonFunction(); DataTable dtActivationSuccessfulTokenValues = comm.LINQToDataTable(linqActivationTokenValues); 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; } } ACTIVATION_INFORMATION.Text = GetSageMessage("UserRegistration", "ActivationSuccessfulInfo"); //ShowMessage("", GetSageMessage("UserRegistration", "ActivationSuccessfulInfo"), "", SageMessageType.Alert); } else { ShowMessage("", GetSageMessage("UserManagement", "UserDoesNotExist"), "", SageMessageType.Alert); } } else { var template = dbMessageTemplate.sp_MessageTemplateByMessageTemplateTypeID(SystemSetting.ACTIVATION_FAIL_INFORMATION, GetPortalID).SingleOrDefault(); 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); } } }