@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $member = Member::get()->filter("Email", "[email protected]")->first(); |
| 25 | 25 | Injector::inst()->get(IdentityStore::class)->logIn($member); |
| 26 | - $page = $this->get("my-profile/"); // attempt to access the profile Page |
|
| 26 | + $page = $this->get("my-profile/"); // attempt to access the profile Page |
|
| 27 | 27 | $this->assertEquals(200, $page->getStatusCode(), "a page should load"); |
| 28 | 28 | $this->assertEquals(UserProfilePage::find_link(false), "/my-profile/", "My profile page exists"); |
| 29 | 29 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $this->assertEquals( |
| 44 | 44 | 1, |
| 45 | - Member::get()->filter("Email", "[email protected]")->count()>0 ? 1 : 0, |
|
| 45 | + Member::get()->filter("Email", "[email protected]")->count() > 0 ? 1 : 0, |
|
| 46 | 46 | 'testMyForm() returns the email from profile page.' |
| 47 | 47 | ); |
| 48 | 48 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function testfindlink() |
| 20 | 20 | { |
| 21 | - $page = $this->get("user-login/"); // attempt to access the user login Page |
|
| 21 | + $page = $this->get("user-login/"); // attempt to access the user login Page |
|
| 22 | 22 | $this->assertEquals(200, $page->getStatusCode(), "a page should load"); |
| 23 | 23 | $this->assertEquals(UserLoginPage::find_link(false), "/user-login/", "User Login page exists"); |
| 24 | 24 | } |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | public function FilterByName($filter, $firstName) |
| 121 | 121 | { |
| 122 | 122 | if ($firstName) { |
| 123 | - $filter = ($filter)? $filter . " AND FirstName Like '%$firstName%'" : "FirstName Like '%$firstName%'"; |
|
| 123 | + $filter = ($filter) ? $filter." AND FirstName Like '%$firstName%'" : "FirstName Like '%$firstName%'"; |
|
| 124 | 124 | } |
| 125 | 125 | return $filter; |
| 126 | 126 | } |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * @param string $start |
|
| 98 | - * @param string $end |
|
| 99 | - * @param string $firstName |
|
| 100 | - * @return string | false |
|
| 101 | - */ |
|
| 97 | + * @param string $start |
|
| 98 | + * @param string $end |
|
| 99 | + * @param string $firstName |
|
| 100 | + * @return string | false |
|
| 101 | + */ |
|
| 102 | 102 | public function FilterByDate($start, $end) |
| 103 | 103 | { |
| 104 | 104 | $filter = false; |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * @param string $firstName |
|
| 117 | - * @param string $filter |
|
| 118 | - * @return string | false |
|
| 119 | - */ |
|
| 116 | + * @param string $firstName |
|
| 117 | + * @param string $filter |
|
| 118 | + * @return string | false |
|
| 119 | + */ |
|
| 120 | 120 | public function FilterByName($filter, $firstName) |
| 121 | 121 | { |
| 122 | 122 | if ($firstName) { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function testfindlink() |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - $page = $this->get("forgotten-password/"); // attempt to access the Lost Forgot Page |
|
| 22 | + $page = $this->get("forgotten-password/"); // attempt to access the Lost Forgot Page |
|
| 23 | 23 | $this->assertEquals(200, $page->getStatusCode(), "a page should load"); |
| 24 | 24 | $this->assertEquals( |
| 25 | 25 | LostPasswordPage::find_link(false), |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'Root.UserManagement', |
| 56 | 56 | TreeDropdownField::create( |
| 57 | 57 | 'CustomerGroupID', |
| 58 | - _t(__CLASS__ . '.CustomerGroup', 'Group to add new customers to'), |
|
| 58 | + _t(__CLASS__.'.CustomerGroup', 'Group to add new customers to'), |
|
| 59 | 59 | Group::class |
| 60 | 60 | ) |
| 61 | 61 | ); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | 'Root.UserManagement', |
| 64 | 64 | TreeDropdownField::create( |
| 65 | 65 | 'LoginUrlID', |
| 66 | - _t(__CLASS__ . '.LoginUrl', 'Login Url'), |
|
| 66 | + _t(__CLASS__.'.LoginUrl', 'Login Url'), |
|
| 67 | 67 | SiteTree::class |
| 68 | 68 | ) |
| 69 | 69 | ); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'Root.UserManagement', |
| 72 | 72 | TreeDropdownField::create( |
| 73 | 73 | 'LoginCallBackUrlID', |
| 74 | - _t(__CLASS__ . '.LoginCallBackUrl', 'Login Call Back Url'), |
|
| 74 | + _t(__CLASS__.'.LoginCallBackUrl', 'Login Call Back Url'), |
|
| 75 | 75 | SiteTree::class |
| 76 | 76 | ) |
| 77 | 77 | ); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 'Root.UserManagement', |
| 80 | 80 | TreeDropdownField::create( |
| 81 | 81 | 'LostPasswordUrlID', |
| 82 | - _t(__CLASS__ . '.LostPasswordUrl', 'Lost Password Url'), |
|
| 82 | + _t(__CLASS__.'.LostPasswordUrl', 'Lost Password Url'), |
|
| 83 | 83 | SiteTree::class |
| 84 | 84 | ) |
| 85 | 85 | ); |
@@ -87,21 +87,21 @@ discard block |
||
| 87 | 87 | 'Root.UserManagement', |
| 88 | 88 | TextareaField::create( |
| 89 | 89 | 'ProfileUpdateSuccess', |
| 90 | - _t(__CLASS__ . '.ProfileUpdateSuccess', 'Profile update Success Message') |
|
| 90 | + _t(__CLASS__.'.ProfileUpdateSuccess', 'Profile update Success Message') |
|
| 91 | 91 | ) |
| 92 | 92 | ); |
| 93 | 93 | $fields->addFieldToTab( |
| 94 | 94 | 'Root.UserManagement', |
| 95 | 95 | TextareaField::create( |
| 96 | 96 | 'ProfileUpdatError', |
| 97 | - _t(__CLASS__ . '.ProfileUpdatError', 'Profile update Error Message') |
|
| 97 | + _t(__CLASS__.'.ProfileUpdatError', 'Profile update Error Message') |
|
| 98 | 98 | ) |
| 99 | 99 | ); |
| 100 | 100 | $fields->addFieldToTab( |
| 101 | 101 | 'Root.UserManagement', |
| 102 | 102 | CheckboxField::create( |
| 103 | 103 | 'EnableSpamProtection', |
| 104 | - _t(__CLASS__ . '.EnableSpamProtection', 'Enable Spam Protection') |
|
| 104 | + _t(__CLASS__.'.EnableSpamProtection', 'Enable Spam Protection') |
|
| 105 | 105 | ) |
| 106 | 106 | ); |
| 107 | 107 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $memberFields = Member::create()->getFrontEndFields()->dataFieldNames(); |
| 206 | 206 | $memberFields = array_diff($memberFields, ["FirstName", "Surname", "Email", |
| 207 | 207 | "TempIDHash", "TempIDExpired", "AutoLoginHash", "AutoLoginExpired", |
| 208 | - "PasswordEncryption","Salt","Locale", "FailedLoginCount", |
|
| 208 | + "PasswordEncryption", "Salt", "Locale", "FailedLoginCount", |
|
| 209 | 209 | "LockedOutUntil", "Password", "PasswordExpiry"]); |
| 210 | 210 | return array_combine($memberFields, $memberFields); |
| 211 | 211 | } |
@@ -15,18 +15,18 @@ discard block |
||
| 15 | 15 | class UserProfilePageController extends PageController |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * @var string |
|
| 19 | - */ |
|
| 18 | + * @var string |
|
| 19 | + */ |
|
| 20 | 20 | private static $url_segment = 'my-profile'; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * @var array |
|
| 24 | - */ |
|
| 23 | + * @var array |
|
| 24 | + */ |
|
| 25 | 25 | private static $allowed_actions = array('ProfileForm'); |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @var mixed |
|
| 29 | - */ |
|
| 28 | + * @var mixed |
|
| 29 | + */ |
|
| 30 | 30 | private $member = false; |
| 31 | 31 | |
| 32 | 32 | public function init() |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Returns the profile form |
|
| 41 | - * @return \UserManagement\Forms\ProfileForm |
|
| 42 | - */ |
|
| 40 | + * Returns the profile form |
|
| 41 | + * @return \UserManagement\Forms\ProfileForm |
|
| 42 | + */ |
|
| 43 | 43 | public function ProfileForm() |
| 44 | 44 | { |
| 45 | 45 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | public function ProfileForm() |
| 44 | 44 | { |
| 45 | 45 | |
| 46 | - $form = new ProfileForm($this, 'ProfileForm'); |
|
| 46 | + $form = new ProfileForm($this, 'ProfileForm'); |
|
| 47 | 47 | $form->loadDataFrom($this->member); |
| 48 | 48 | return $form; |
| 49 | 49 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $signUpPersonal = Member::create(); |
| 52 | 52 | $form->saveInto($signUpPersonal); |
| 53 | 53 | if (isset($data['DOB']) && $data['DOB']) { |
| 54 | - $signUpPersonal->DOB = date('Y-m-d', strtotime($data['DOB'])); |
|
| 54 | + $signUpPersonal->DOB = date('Y-m-d', strtotime($data['DOB'])); |
|
| 55 | 55 | } |
| 56 | 56 | $signUpPersonal->write(); |
| 57 | 57 | $Member = Member::get()->byId($signUpPersonal->ID); |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * @param Controller $controller the controller instance that |
|
| 72 | - * is being passed to the form |
|
| 73 | - * @return FieldList Fields for this form. |
|
| 74 | - */ |
|
| 70 | + /** |
|
| 71 | + * @param Controller $controller the controller instance that |
|
| 72 | + * is being passed to the form |
|
| 73 | + * @return FieldList Fields for this form. |
|
| 74 | + */ |
|
| 75 | 75 | protected function getFormFields($controller = null) |
| 76 | 76 | { |
| 77 | 77 | $fields = FieldList::create( |