custom forgotten password page
Currently on the site I am working on, I have one page which users need to login to see. So have set up a login page and user group for users with the permission to see this page. I am having trouble with the forgotten password link though. I would like to have the link take the user to a custom forgotten password page rather than to the sitefinity one. Has any one done this or have an example that I could use to help?
Thanks
James
Hi James,
In case we're talking about the public LoginControl that can be dropped on any frontend page, this is easily achieved. You can specify the link to a custom ForgotPassword by editing the LoginControl settings - there's a property PasswordRecoveryUrl which you can simply set to the location of your cistom page. If you want to mimic the looks of the default one, please find below the markup of our PasswordRecovery page.
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Security.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
meta
http-equiv
=
"content-type"
content
=
"text/html; charset=utf-8"
/>
<
meta
http-equiv
=
"X-UA-Compatible"
content
=
"IE=8"
/>
<
title
>Sitefinity 4.1 - Password Recovery</
title
>
</
head
>
<
body
class
=
"sfLogin"
>
<
form
id
=
"aspnetForm"
runat
=
"server"
>
<
sf:ResourceLinks
id
=
"resourceLinks"
runat
=
"server"
>
<
sf:ResourceFile
Name
=
"CSS/Reset.css"
/>
<
sf:ResourceFile
Name
=
"CSS/Layout.css"
/>
<
sf:ResourceFile
Name
=
"CSS/Colors.css"
/>
<
sf:ResourceFile
Name
=
"Styles/Login.css"
/>
</
sf:ResourceLinks
>
<
div
class
=
"sfWrapper"
>
<
fieldset
class
=
"sfLoginForm"
>
<
h1
class
=
"sfLogo"
>Sitefinity</
h1
>
<
div
class
=
"sfForm"
>
<
div
class
=
"sfFormIn"
>
<
div
class
=
"sfLoginShadowTopRight"
></
div
>
<
div
class
=
"sfLoginShadowBottomLeft"
></
div
>
<
h2
>
<%$ Resources:ErrorMessages, PasswordRecoveryDefaultUserNameTitleText %>
<%--<
asp:Literal
ID
=
"ProjectName"
runat
=
"server"
Text
=
""
/>--%>
</
h2
>
<
sf:PasswordRecoveryForm
runat
=
"server"
AllowSelectMembershipProvider
=
"true"
>
<
MailDefinition
From
=
"passwordRecovery@noreply.com"
Subject
=
"Password Recovery"
IsBodyHtml
=
"true"
/>
</
sf:PasswordRecoveryForm
>
</
div
>
</
div
>
</
fieldset
>
</
div
>
<
div
class
=
"sfFooter"
>
<
p
class
=
"sfCopy"
><
strong
>Sitefinity 4.1</
strong
> | Telerik Inc. All rights reserved</
p
>
<
ul
class
=
"sfSupportLinks"
>
<
li
class
=
"sfFirst"
><
a
href
=
"http://www.sitefinity.com/help/developer-manual/introduction.html"
>Documentation</
a
></
li
>
<
li
><
a
href
=
"http://www.sitefinity.com/support/forums.aspx"
>Forum</
a
></
li
>
<
li
><
a
href
=
"http://blogs.sitefinity.com/"
>Blog</
a
></
li
>
</
ul
>
</
div
>
</
form
>
</
body
>
</
html
>
Thanks for the reply. Now working.
James
This is helpful. Where can we get the default template used by <sf:PasswordRecoveryForm /> so that it's contents can be adjusted? We need to change the Username label to say Email since we're requiring all users to have their email address as their login name.
Nevermind, I found it. The ~/SFRes in the virtual paths were causing some confusion as to where the default templates were located.
Hi Seattle Web Group,
I'm glad to hear that the problem has been successfully resolved. If you need any further information, please do not hesitate to let us know.
Regards,
Boyan Barnev
the Telerik team
Hi Seattle...I don't find the forgot password template and change password.
Can you please make a copy paste in this ticket.
I really appreciate it.
Thank you!
Hi FIR,
The template is stored as a resource in the ~/bin/Telerik.Sitefinity.Resources.dll file. The name of the resource is available in the widget properties when editing an instance of the widget through the Sitefinity administration.