Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » login form change lostpass url

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 468 Views
  • WaaaghNL
    Avatar
    Community Member
    4 Posts

    login form change lostpass url Link to this post

    Hello,

    is there someone who knows where i can change the url for a lostpassword? i found on line 80 from /sapphire/security/MemberLoginForm.php a URL but when i change it nothing happens (i flusht and run a /dev/build)

    Ronald

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: login form change lostpass url Link to this post

    The url is fixed as it is the name of the method (function lost password()) you could implement your own lost password form then you have control over the url or have redirection setup so site.com/resetpassword redirects to site.com/Security/lostpassword

  • WaaaghNL
    Avatar
    Community Member
    4 Posts

    Re: login form change lostpass url Link to this post

    Thanks i have changed
    /sapphire/security/Security.php (rule 449 to 467)

       public function LostPasswordForm() {
          return new MemberLoginForm(
             $this,
             'LostPasswordForm',
             new FieldSet(
                new EmailField('Email', _t('Member.EMAIL', 'Email'))
             ),
             new FieldSet(
                new FormAction(
                   'forgotPassword',
                   _t('Security.BUTTONSEND', 'Send me the password reset link')
                )
             ),
             false
          );
       }

    TO
       public function LostPasswordForm() {
          Director::redirect('wachtwoord-vergeten');
          /*
          return new MemberLoginForm(
             $this,
             'LostPasswordForm',
             new FieldSet(
                new EmailField('Email', _t('Member.EMAIL', 'Email'))
             ),
             new FieldSet(
                new FormAction(
                   'forgotPassword',
                   _t('Security.BUTTONSEND', 'Send me the password reset link')
                )
             ),
             false
          );
          */
       }

    468 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.