Redirect Member after login

First extend MemberLoginForm like this...

class MyMemberLoginForm extends MemberLoginForm {
 
    public function performLogin($data) {

        if($member = parent::performLogin($data)){
            Config::inst()->update('Security','default_login_dest',"admin");

            if($member->Email == 'special@email.com')
                Config::inst()->update('Security','default_login_dest',"specialemailurl");
        }
 
        return $member;
    }
}

Clearly the logic of where to redirect people to needs to be updated to your logic and destitation.

Then use this to replace the current class... add this to _config.php ...

Object::useCustomClass('MemberLoginForm','MyMemberLoginForm',true);
Rate this post (1 ratings)

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments