Actions
2 years ago
Concerns
2 years ago
Contracts
3 years ago
Exceptions
2 years ago
Facades
4 years ago
LegacyNodes
3 years ago
Properties
2 years ago
ValueObjects
2 years ago
Amount.php
2 years ago
Authentication.php
2 years ago
BillingAddress.php
2 years ago
Checkbox.php
2 years ago
Consent.php
2 years ago
Date.php
2 years ago
DonationAmount.php
2 years ago
DonationForm.php
2 years ago
DonationSummary.php
2 years ago
Element.php
3 years ago
Email.php
2 years ago
Factory.php
4 years ago
Field.php
2 years ago
File.php
2 years ago
Form.php
3 years ago
Group.php
3 years ago
Hidden.php
3 years ago
Html.php
3 years ago
MultiSelect.php
2 years ago
Name.php
2 years ago
Option.php
3 years ago
Paragraph.php
2 years ago
Password.php
2 years ago
PaymentGateways.php
2 years ago
Phone.php
2 years ago
Radio.php
2 years ago
Section.php
2 years ago
Select.php
2 years ago
Text.php
2 years ago
Textarea.php
2 years ago
Types.php
2 years ago
Url.php
2 years ago
Authentication.php
75 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Give\Framework\FieldsAPI; |
| 6 | |
| 7 | class Authentication extends Group |
| 8 | { |
| 9 | const TYPE = 'authentication'; |
| 10 | |
| 11 | protected $required = false; |
| 12 | protected $isAuthenticated = false; |
| 13 | protected $loginRedirect = false; |
| 14 | protected $loginRedirectUrl; |
| 15 | protected $loginNotice; |
| 16 | protected $loginConfirmation; |
| 17 | protected $lostPasswordUrl; |
| 18 | |
| 19 | public static function make($name) |
| 20 | { |
| 21 | return parent::make($name) |
| 22 | ->append( |
| 23 | Text::make('login') |
| 24 | ->label(__('Username or Email Address', 'give')) |
| 25 | ) |
| 26 | ->append( |
| 27 | Password::make('password') |
| 28 | ->label(__('Password', 'give')) |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | public function required($value = true): self |
| 33 | { |
| 34 | $this->required = $value; |
| 35 | return $this; |
| 36 | } |
| 37 | |
| 38 | public function isAuthenticated($value = true): self |
| 39 | { |
| 40 | $this->isAuthenticated = $value; |
| 41 | return $this; |
| 42 | } |
| 43 | |
| 44 | public function loginRedirect($value = true): self |
| 45 | { |
| 46 | $this->loginRedirect = $value; |
| 47 | return $this; |
| 48 | } |
| 49 | |
| 50 | public function loginRedirectUrl($value): self |
| 51 | { |
| 52 | $this->loginRedirectUrl = $value; |
| 53 | return $this; |
| 54 | } |
| 55 | |
| 56 | public function loginNotice($value): self |
| 57 | { |
| 58 | $this->loginNotice = $value; |
| 59 | return $this; |
| 60 | } |
| 61 | |
| 62 | public function loginConfirmation($value): self |
| 63 | { |
| 64 | $this->loginConfirmation = $value; |
| 65 | return $this; |
| 66 | } |
| 67 | |
| 68 | |
| 69 | public function lostPasswordUrl($value): self |
| 70 | { |
| 71 | $this->lostPasswordUrl = $value; |
| 72 | return $this; |
| 73 | } |
| 74 | } |
| 75 |