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