Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Custom Login Form

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 8235 Views
  • moloko_man
    Avatar
    Community Member
    72 Posts

    Re: Custom Login Form Link to this post

    nice, I'll look into that module.

  • wifiman
    Avatar
    Community Member
    20 Posts

    Re: Custom Login Form Link to this post

    Did you guys ever get this to work? I'd be interested to see what you did...

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Custom Login Form Link to this post

    I just took the easy/lazy way and hard coded the login form in an html include .ss file.

    It worked good enough for what I needed, as there is a hidden input field which acts as the redirect after they login.

    I'm sure you could subclass if needed to do more complex stuff, but I didn't need it after all.

    Here was my code, though I modified the form a bit to display a link to the forgot password form, rather than have it a form field button. Just look at the html source output from $LoginForm if you want the original.

    <form action="Security/?executeForm=LoginForm" method="post" enctype="application/x-www-form-urlencoded">

    <div class="left">
    <input type="hidden" name="AuthenticationMethod" value="MemberAuthenticator" />
    <label for="memberEmail">Email</label>
    <br />
    <input type="text" id="memberEmail" name="Email" value="" />
    </div>

    <div class="left">
    <label for="memberPassword">Password</label>
    <br />
    <input type="password" id="memberPassword" name="Password" value="" />
    </div>

    <input type="hidden" id="backURL" name="BackURL" value="/your-url-here/" />

    <div id="login" class="left">   
       <input type="submit" id="memberLogin" name="action_dologin" value="Login" />
    </div>

    <br class="clearFix"/>

    <div class="left">
    <input type="checkbox" value="1" id="rememberMe" name="Remember" />
    <label for="rememberMe">Remember me?</label>
    | <a href="Security/lostpassword">Forgot Your Password?</a>
    </div>

    </form>

    8235 Views
Page: 1 2
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.