+1-888-365-2779
Try Now
More in this section

Forums / Security / PasswordRecovery Control

PasswordRecovery Control

7 posts, 0 answered
  1. Daniel Svensson
    Daniel Svensson avatar
    12 posts
    Registered:
    31 Aug 2009
    16 Sep 2009
    Link to this post
    Hi,

    What are the basic steps to setup the PasswordRecovery control found in SiteFinity/UserControls folder?
    Im using the default Sitefinity Role & Membership providers and can log in and everything works!

    I want to let my end-users be able to retrieve their passwords. My end-users username are the same as their email setup from within SiteFinity Admin.

    What are the basic things i need to do to send an email? From scratch, cause i can't seem to work this basic thing out. Probably it's mere settings for the control but which ones?

    When i tried to retrieve a password i got this failure-message back:

    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 208.87.33.151:25

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 208.87.33.151:25

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 208.87.33.151:25]
    System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
    System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
    System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

    [WebException: Unable to connect to the remote server]
    System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5482743
    System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
    System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
    System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
    System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
    System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
    System.Net.Mail.SmtpClient.GetConnection() +35
    System.Net.Mail.SmtpClient.Send(MailMessage message) +1213

    [SmtpException: Failure sending mail.]
    System.Net.Mail.SmtpClient.Send(MailMessage message) +1531
    System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +367
    System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordUserNameView() +537
    System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword() +55
    System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object source, EventArgs e) +103
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    Thankful for suggestions!

    /Daniel S


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Sep 2009
    Link to this post
    Hi Daniel Svensson,

    As I see it SendMailError event is raised when the SMTP mail server throws an exception when trying to send an e-mail message. Have you set correct smpt server, username, password and port in project's web.config. You can also take a look at the following article - passwordrecovery.sendingmail

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Daniel Svensson
    Daniel Svensson avatar
    12 posts
    Registered:
    31 Aug 2009
    16 Sep 2009
    Link to this post
    Hi,

    No i haven't configured anything in the web.config file.
    The related section i could find was:

     <system.net>
        <mailSettings>
          <smtp from="mailmaster@yourdomain.com">
            <network host="smtp.yourdomain.com" userName="YourUsername" password="YourPassword" port="25" />
          </smtp>
        </mailSettings>
      </system.net>

    How should i proceed from this?

    /Daniel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Sep 2009
    Link to this post
    Hi Daniel Svensson,

    You should use your SMTP details as suggested in the previous post.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    05 Nov 2009
    Link to this post
    I am using the Password Recovery control, which I put on a page. The user can enter their username and the temporary password is emailed. However, how do I get the <QuestionTemplate> in the PasswordRecoveryControl.ascx to come up before sending the password?  It does not show up.  And how to I create a question/answer for those users who were manually entered into the system and did not go through the public registration route where you create the question and answer?

    Thank you, and as always, great product!
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Nov 2009
    Link to this post
    Hello Laura,

    1. Check whether you have set requiresQuestionAndAnswer property to true in Membership configuration settings. When the property is set to true question view will be required for the user's password to be retrieved or reset. When set to false the question view is not displayed to the user.
    More information about question template can be fount at  PasswordRecovery.QuestionTemplate Property.

    2 "how to I create a question/answer for those users who were manually entered into the system and did not go through the public registration route where you create the question and answer?"

    In ~/Sitefinity/Admin/CmsAdmin/Users.aspx control template you can create a two new TextBox controls - one for the password, one for the answer. You need to do this inside ManageUsers control

    Sample:

    <fieldset class="userinfo set">
        <ol class="setIn">
            <li>
                <cc2:FieldLabel ID="lblUserName" runat="server" Text="<%$ Resources:Username %>"
                    TargetID="UserName">
                </cc2:FieldLabel>
                <asp:TextBox ID="UserName" runat="server" ValidationGroup="CreateUser"></asp:TextBox>
                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                    ErrorMessage="Username is required." ToolTip="Username is required." ValidationGroup="CreateUser"
                    Display="Dynamic" SetFocusOnError="true" CssClass="validMessage">
                    <strong>
                        <asp:Literal ID="Literal9" runat="server" Text="<%$ Resources:UsernameRequired %>" /></strong></asp:RequiredFieldValidator>
            </li>
            <li>
                <cc2:FieldLabel ID="lblPassword" runat="server" Text="<%$ Resources:Password %>"
                    TargetID="Password">
                </cc2:FieldLabel>
                <asp:TextBox ID="Password" runat="server" TextMode="Password" ValidationGroup="CreateUser"></asp:TextBox>
                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                    ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUser"
                    Display="Dynamic" CssClass="validMessage">
                    <strong>
                        <asp:Literal ID="Literal10" runat="server" Text="<%$ Resources:PasswordRequired %>" /></strong></asp:RequiredFieldValidator>
            </li>
            <li>
                <cc2:FieldLabel ID="lblConfirmPassword" runat="server" Text="<%$ Resources:ConfirmPassword %>"
                    TargetID="ConfirmPassword">
                </cc2:FieldLabel>
                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" ValidationGroup="CreateUser"></asp:TextBox>
                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                    ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                    ValidationGroup="CreateUser" Display="Dynamic" CssClass="validMessage">
                    <strong>
                        <asp:Literal ID="Literal11" runat="server" Text="<%$ Resources:ConfirmPassRequired %>" /></strong></asp:RequiredFieldValidator>
                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                    ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                    ValidationGroup="CreateUser" CssClass="validMessage">
                    <strong>
                        <asp:Literal ID="Literal12" runat="server" Text="<%$ Resources:PasswordMatch %>" /></strong></asp:CompareValidator>
            </li>
            <li>
                <cc2:FieldLabel ID="lblEmail" runat="server" Text="<%$ Resources:Email %>" TargetID="Email">
                </cc2:FieldLabel>
                <asp:TextBox ID="Email" runat="server" ValidationGroup="CreateUser"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Email"
                    ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUser"
                    Display="Dynamic" CssClass="validMessage">
                    <strong>
                        <asp:Literal ID="Literal13" runat="server" Text="<%$ Resources:EmailRequired %>" /></strong></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="Email"
                    Display="Dynamic" ErrorMessage="The email format is invalid." ValidationExpression="\S+@\S+\.\S+"
                    ValidationGroup="CreateUser" CssClass="validMessage">
                    <strong>
                        <asp:Literal ID="Literal14" runat="server" Text="<%$ Resources:EmailNotValid %>" /></strong></asp:RegularExpressionValidator>
            </li>
             
                    <li>
                        <cc2:FieldLabel ID="lblQuestion" runat="server" Text="Question" TargetID="Question">
                        </cc2:FieldLabel>
                        <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                    </li
                    <li>
                        <cc2:FieldLabel ID="lblAnswer" runat="server" Text="Answer" TargetID="Answer">
                        </cc2:FieldLabel>
                        <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                    </li>   
        </ol>
    </fieldset>


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    06 Nov 2009
    Link to this post
    As always, thank you for your quick and informative response!
Register for webinar
7 posts, 0 answered