https://github.com/nicogis/recoverypasswordxaf
RecoveryPasswordXAF
https://github.com/nicogis/recoverypasswordxaf
devexpress recovery-password webforms xaf
Last synced: 2 months ago
JSON representation
RecoveryPasswordXAF
- Host: GitHub
- URL: https://github.com/nicogis/recoverypasswordxaf
- Owner: nicogis
- Created: 2022-09-05T12:18:46.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-07T06:34:38.000Z (over 2 years ago)
- Last Synced: 2025-02-06T21:31:33.695Z (4 months ago)
- Topics: devexpress, recovery-password, webforms, xaf
- Language: C#
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### This topic demonstrates how to extend your ASP.NET Web Forms application with recovery password
Users recovery password setting email.
If email exists, the system sends email with link to reset password.
This link expires after 10 minutes.#### Follow these steps:
In agnostic module:
- Copy in image RestorePassword.png and ***Set a build action*** embedded resource
- In ApplicationUser.cs add property Email
```csharp
private string email;
public string Email
{
get { return email; }
set { SetPropertyValue(nameof(Email), ref email, value); }
}```
- Add class ChangePassword. Here I pasted script SQL Server
```xml
USE [YourDB]
GOSET ANSI_NULLS ON
GOSET QUOTED_IDENTIFIER ON
GOCREATE TABLE [dbo].[ChangePassword](
[Token] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[DateRequest] [datetime] NOT NULL,
[User] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_ChangePassword] PRIMARY KEY CLUSTERED
(
[Token] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GOALTER TABLE [dbo].[ChangePassword] ADD CONSTRAINT [DF_ChangePassword_DateRequest] DEFAULT (getdate()) FOR [DateRequest]
GO
```- Add class ManageUsersOnLogonController.cs and RestorePasswordParameters.cs
****In RestorePasswordParameters you need set
- urlApp variable
- SendMail method
- body email (optional)****- In module.cs
```csharp
public override void Setup(XafApplication application) {
base.Setup(application);
// Manage various aspects of the application UI and behavior at the module level.
application.CreateCustomLogonWindowControllers += Application_CreateCustomLogonWindowControllers; ;
}private void Application_CreateCustomLogonWindowControllers(object sender, CreateCustomLogonWindowControllersEventArgs e)
{
XafApplication app = (XafApplication)sender;
e.Controllers.Add(app.CreateController());
}
```- Add ChangePassword.aspx in web project
****
- change x minutes expire (optional)****- Add web.config in configuration section:
```xml
```- Run application

