Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Custom Login Form

Go to End

2 Posts   3035 Views


Community Member, 470 Posts

29 November 2013 at 9:10am

I extended MemberLoginForm similar to like the old SSbits tutorial for client redirection

But is it possible to have 2 login forms, instead of overriding? The reason being, I want 1 form for admin logins, and the custom form for the client redirection since they will never need CMS access. I realize the SSbits tutorial takes it into account, but I'd rather keep it simple since none of the client logins will need access and I"m curious for my own knowledge. If not, I can just do it similar to how SSBits handles it.

Ideally I want to create a client login page and put the custom form on it. Is there a way to attach the extended form to my pagetype and have a variable like $CustomLoginForm in my template? Something like that.


class CustomLoginForm extends MemberLoginForm {
   public function dologin($data) {
        if($this->performLogin($data)) {
        } else {
            if($badLoginURL = Session::get('BadLoginURL')) {
            } else {

    public function redirectByClient($data) {   
        $member = Member::currentUser();
        if ($member && $Page = $member->ClientPage()) {
            return Controller::curr()->redirect($Page->Link());

        return false;


Forum Moderator, 1899 Posts

5 December 2013 at 3:57am

Hi Liam,

I know this doesn't answer your question directly but maybe it helps - I noticed this new module that handles this for admin forms in SS3 -