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.

Customising the CMS /

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

login form

Go to End

4 Posts   1683 Views


Community Member, 2 Posts

24 June 2011 at 6:06pm

hi, im new to SilverStripe... im glad to know this cms.
its still hard to me to customize this cms. i would like add new field to user login form (for example captcha). i do not know where to go...


Community Member, 247 Posts

25 June 2011 at 4:06am

Hi trustnoone!

Welcome to SS.

The most simple way to do this is to extend MemberAuthenticator, create a new class such as MyMemberAuthenticator and create a static function called get_login_form that accepts 1 parameter ($controller). then return a new form with the fields you want. They will need to have the same names for the username and password.

You then have to register that authenticator in your _config and unregister the existing one. So in the end you want something like this:


class MyMemberAuthentcator extends MemberAuthenticator {
public static function get_login_form(Controller $controller) {
				$fields = new FieldSet(
					new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this),
					//Regardless of what the unique identifer field is (usually 'Email'), it will be held in the 'Email' value, below:
					new TextField("Email", $label, Session::get('SessionForms.MemberLoginForm.Email'), null, $this),
					new PasswordField("Password", _t('Member.PASSWORD', 'Password'))
				if(Security::$autologin_enabled) {
					$fields->push(new CheckboxField(
						_t('Member.REMEMBERME', "Remember me next time?")
//push your custom fields in here
$fields->push( ... )
return new MemberLoginForm($controller, 'MemberLoginForm',$fields);



And that should be the ground work done. Validation may be the only problem here, but you can just extend the authenticate method if you need to.



Community Member, 2 Posts

27 June 2011 at 1:29pm

thanks for the reply...

sorry for the late respond. i didn't tried your method yet, yesterday i tried extend MemberLoginForm class. and the functionality is running as i want. when the user tried to login 3 times (wrong login), the MathSpamProtection will show. and the validation i did in dologin function.

i still trying to notice, what is the different with your method...


Community Member, 93 Posts

2 June 2012 at 2:19am

I found this

If you need only to change the template, you need to put in your templates/Layout folder under your theme