1 <?php
2 3 4 5 6 7 8 9 10 11
12 abstract class LoginForm extends Form {
13 function __construct($controller, $name, $fields, $actions) {
14 parent::__construct($controller, $name, $fields, $actions);
15
16 $this->disableSecurityToken();
17 }
18
19 20 21 22 23 24 25
26
27 protected $authenticator_class;
28
29 30 31 32
33
34 public function getAuthenticator() {
35 if(!class_exists($this->authenticator_class) || !is_subclass_of($this->authenticator_class, 'Authenticator')) {
36 user_error("The form uses an invalid authenticator class! '{$this->authenticator_class}' is not a subclass of 'Authenticator'", E_USER_ERROR);
37 return;
38 }
39
40 return new $this->authenticator_class;
41 }
42 }
43
44 ?>
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-