| 1 | <?php |
||
| 8 | class ChangePassword extends ProvidesEventsForm |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var AuthenticationOptionsInterface |
||
| 12 | */ |
||
| 13 | protected $authOptions; |
||
| 14 | |||
| 15 | public function __construct($name, AuthenticationOptionsInterface $options) |
||
| 16 | { |
||
| 17 | $this->setAuthenticationOptions($options); |
||
| 18 | parent::__construct($name); |
||
| 19 | |||
| 20 | $this->add(array( |
||
| 21 | 'name' => 'identity', |
||
| 22 | 'options' => array( |
||
| 23 | 'label' => '', |
||
| 24 | ), |
||
| 25 | 'attributes' => array( |
||
| 26 | 'type' => 'hidden' |
||
| 27 | ), |
||
| 28 | )); |
||
| 29 | |||
| 30 | $this->add(array( |
||
| 31 | 'name' => 'credential', |
||
| 32 | 'type' => 'password', |
||
| 33 | 'options' => array( |
||
| 34 | 'label' => 'Current Password', |
||
| 35 | ), |
||
| 36 | 'attributes' => array( |
||
| 37 | 'type' => 'password', |
||
| 38 | ), |
||
| 39 | )); |
||
| 40 | |||
| 41 | $this->add(array( |
||
| 42 | 'name' => 'newCredential', |
||
| 43 | 'options' => array( |
||
| 44 | 'label' => 'New Password', |
||
| 45 | ), |
||
| 46 | 'attributes' => array( |
||
| 47 | 'type' => 'password', |
||
| 48 | ), |
||
| 49 | )); |
||
| 50 | |||
| 51 | $this->add(array( |
||
| 52 | 'name' => 'newCredentialVerify', |
||
| 53 | 'type' => 'password', |
||
| 54 | 'options' => array( |
||
| 55 | 'label' => 'Verify New Password', |
||
| 56 | ), |
||
| 57 | 'attributes' => array( |
||
| 58 | 'type' => 'password', |
||
| 59 | ), |
||
| 60 | )); |
||
| 61 | |||
| 62 | $this->add(array( |
||
| 63 | 'name' => 'submit', |
||
| 64 | 'attributes' => array( |
||
| 65 | 'value' => 'Submit', |
||
| 66 | 'type' => 'submit' |
||
| 67 | ), |
||
| 68 | )); |
||
| 69 | |||
| 70 | $this->getEventManager()->trigger('init', $this); |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Set Authentication-related Options |
||
| 75 | * |
||
| 76 | * @param AuthenticationOptionsInterface $authOptions |
||
| 77 | * @return Login |
||
| 78 | */ |
||
| 79 | public function setAuthenticationOptions(AuthenticationOptionsInterface $authOptions) |
||
| 80 | { |
||
| 81 | $this->authOptions = $authOptions; |
||
| 82 | return $this; |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * Get Authentication-related Options |
||
| 87 | * |
||
| 88 | * @return AuthenticationOptionsInterface |
||
| 89 | */ |
||
| 90 | public function getAuthenticationOptions() |
||
| 94 | } |
||
| 95 |