@@ -41,7 +41,7 @@ |
||
41 | 41 | if ($page = DataObject::get_one(self::class)) { |
42 | 42 | return $page; |
43 | 43 | } |
44 | - user_error(_t(__CLASS__ . '.NoPage', 'No UserRegistrationPage was found. |
|
44 | + user_error(_t(__CLASS__.'.NoPage', 'No UserRegistrationPage was found. |
|
45 | 45 | Please create one in the CMS!'), E_USER_ERROR); |
46 | 46 | return null; // just to keep static analysis happy |
47 | 47 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | protected $periodfield = '"Member"."Created"'; |
31 | 31 | |
32 | - // the name of the report |
|
32 | + // the name of the report |
|
33 | 33 | public function title() |
34 | 34 | { |
35 | 35 | return 'Customer List'; |
@@ -99,7 +99,7 @@ |
||
99 | 99 | $filter = "Member.Created <= '$end'"; |
100 | 100 | } |
101 | 101 | if ($firstName) { |
102 | - $filter = ($filter)? $filter . " AND FirstName Like '%$firstName%'" : "FirstName Like '%$firstName%'"; |
|
102 | + $filter = ($filter) ? $filter." AND FirstName Like '%$firstName%'" : "FirstName Like '%$firstName%'"; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | return $filter; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $signUpPersonal = Member::create(); |
48 | 48 | $form->saveInto($signUpPersonal); |
49 | 49 | if (isset($data['DOB']) && $data['DOB']) { |
50 | - $signUpPersonal->DOB = date('Y-m-d', strtotime($data['DOB'])); |
|
50 | + $signUpPersonal->DOB = date('Y-m-d', strtotime($data['DOB'])); |
|
51 | 51 | } |
52 | 52 | $signUpPersonal->write(); |
53 | 53 | $Member = Member::get()->byId($signUpPersonal->ID); |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | - /** |
|
67 | - * @param Controller $controller the controller instance that is being passed to the form |
|
68 | - * @return FieldList Fields for this form. |
|
69 | - */ |
|
66 | + /** |
|
67 | + * @param Controller $controller the controller instance that is being passed to the form |
|
68 | + * @return FieldList Fields for this form. |
|
69 | + */ |
|
70 | 70 | protected function getFormFields($controller = null) |
71 | 71 | { |
72 | 72 | $fields = FieldList::create( |
@@ -55,11 +55,11 @@ |
||
55 | 55 | try { |
56 | 56 | $form->saveInto($member); |
57 | 57 | $member->write(); |
58 | - $msg = $this->getCustomMessage('ProfileUpdateSuccess')!="" |
|
58 | + $msg = $this->getCustomMessage('ProfileUpdateSuccess') != "" |
|
59 | 59 | ? $this->getCustomMessage('ProfileUpdateSuccess') : "Profile updated!"; |
60 | 60 | $form->sessionMessage($msg, 'good'); |
61 | 61 | } catch (\Exception $e) { |
62 | - $msg = $this->getCustomMessage('ProfileUpdatError')!="" |
|
62 | + $msg = $this->getCustomMessage('ProfileUpdatError') != "" |
|
63 | 63 | ? $this->getCustomMessage('ProfileUpdatError') : "Technical issue, Profile not updated!"; |
64 | 64 | $form->sessionMessage($msg, 'bad'); |
65 | 65 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | public function testfindlink() |
19 | 19 | { |
20 | 20 | |
21 | - $page = $this->get("forgotten-password/"); // attempt to access the Lost Forgot Page |
|
21 | + $page = $this->get("forgotten-password/"); // attempt to access the Lost Forgot Page |
|
22 | 22 | $this->assertEquals(200, $page->getStatusCode(), "a page should load"); |
23 | 23 | } |
24 | 24 |
@@ -14,9 +14,9 @@ |
||
14 | 14 | */ |
15 | 15 | class LoginHandlerExtensionTest extends FunctionalTest |
16 | 16 | { |
17 | - /** |
|
18 | - * |
|
19 | - **/ |
|
17 | + /** |
|
18 | + * |
|
19 | + **/ |
|
20 | 20 | public function testRedirect() |
21 | 21 | { |
22 | 22 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'Root.UserManagement', |
43 | 43 | TreeDropdownField::create( |
44 | 44 | 'CustomerGroupID', |
45 | - _t(__CLASS__ . '.CustomerGroup', 'Group to add new customers to'), |
|
45 | + _t(__CLASS__.'.CustomerGroup', 'Group to add new customers to'), |
|
46 | 46 | Group::class |
47 | 47 | ) |
48 | 48 | ); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'Root.UserManagement', |
51 | 51 | TreeDropdownField::create( |
52 | 52 | 'LoginUrlID', |
53 | - _t(__CLASS__ . '.LoginUrl', 'Login Url'), |
|
53 | + _t(__CLASS__.'.LoginUrl', 'Login Url'), |
|
54 | 54 | SiteTree::class |
55 | 55 | ) |
56 | 56 | ); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'Root.UserManagement', |
59 | 59 | TreeDropdownField::create( |
60 | 60 | 'LoginCallBackUrlID', |
61 | - _t(__CLASS__ . '.LoginCallBackUrl', 'Login Call Back Url'), |
|
61 | + _t(__CLASS__.'.LoginCallBackUrl', 'Login Call Back Url'), |
|
62 | 62 | SiteTree::class |
63 | 63 | ) |
64 | 64 | ); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'Root.UserManagement', |
67 | 67 | TreeDropdownField::create( |
68 | 68 | 'LostPasswordUrlID', |
69 | - _t(__CLASS__ . '.LostPasswordUrl', 'Lost Password Url'), |
|
69 | + _t(__CLASS__.'.LostPasswordUrl', 'Lost Password Url'), |
|
70 | 70 | SiteTree::class |
71 | 71 | ) |
72 | 72 | ); |
@@ -74,21 +74,21 @@ discard block |
||
74 | 74 | 'Root.UserManagement', |
75 | 75 | TextareaField::create( |
76 | 76 | 'ProfileUpdateSuccess', |
77 | - _t(__CLASS__ . '.ProfileUpdateSuccess', 'Profile update Success Message') |
|
77 | + _t(__CLASS__.'.ProfileUpdateSuccess', 'Profile update Success Message') |
|
78 | 78 | ) |
79 | 79 | ); |
80 | 80 | $fields->addFieldToTab( |
81 | 81 | 'Root.UserManagement', |
82 | 82 | TextareaField::create( |
83 | 83 | 'ProfileUpdatError', |
84 | - _t(__CLASS__ . '.ProfileUpdatError', 'Profile update Error Message') |
|
84 | + _t(__CLASS__.'.ProfileUpdatError', 'Profile update Error Message') |
|
85 | 85 | ) |
86 | 86 | ); |
87 | 87 | $fields->addFieldToTab( |
88 | 88 | 'Root.UserManagement', |
89 | 89 | CheckboxField::create( |
90 | 90 | 'EnableSpamProtection', |
91 | - _t(__CLASS__ . '.EnableSpamProtection', 'Enable Spam Protection') |
|
91 | + _t(__CLASS__.'.EnableSpamProtection', 'Enable Spam Protection') |
|
92 | 92 | ) |
93 | 93 | ); |
94 | 94 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if (!$this->owner->LoginUrl()->ID && $this->getDBstatus()) { |
114 | 114 | $LoginUrl = SiteTree::get() |
115 | 115 | ->filter('ClassName', 'UserManagement\Page\UserLoginPage'); |
116 | - if($LoginUrl->count() > 0) |
|
116 | + if ($LoginUrl->count() > 0) |
|
117 | 117 | return $LoginUrl->first()->ID; |
118 | 118 | else |
119 | 119 | return; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | if (!$this->owner->LoginCallBackUrl()->ID && $this->getDBstatus()) { |
133 | 133 | $LoginCallBackUrl = SiteTree::get() |
134 | 134 | ->filter('ClassName', 'UserManagement\Page\UserProfilePage'); |
135 | - if($LoginCallBackUrl->count() > 0) |
|
135 | + if ($LoginCallBackUrl->count() > 0) |
|
136 | 136 | return $LoginCallBackUrl->first()->ID; |
137 | 137 | else |
138 | 138 | return; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | if (!$this->owner->LostPasswordUrl()->ID && $this->getDBstatus()) { |
152 | 152 | $LostPasswordUrl = SiteTree::get()->filter('ClassName', 'UserManagement\Page\LostPasswordPage'); |
153 | - if($LostPasswordUrl->count() > 0) |
|
153 | + if ($LostPasswordUrl->count() > 0) |
|
154 | 154 | return $LostPasswordUrl->first()->ID; |
155 | 155 | else |
156 | 156 | return; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | { |
170 | 170 | if (!$this->owner->CustomerGroup()->ID && $this->getDBstatus()) { |
171 | 171 | $group = Group::get()->filter('Title', 'General'); |
172 | - if($group->count() > 0) |
|
172 | + if ($group->count() > 0) |
|
173 | 173 | return $group->first()->ID; |
174 | 174 | else |
175 | 175 | return; |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | public function getExportFieldNames() |
182 | 182 | { |
183 | 183 | $memberFields = Member::create()->getFrontEndFields()->dataFieldNames(); |
184 | - $memberFields = array_diff($memberFields, ["FirstName", "Surname", "Email", "TempIDHash", "TempIDExpired", "AutoLoginHash", "AutoLoginExpired","PasswordEncryption","Salt","Locale", "FailedLoginCount", "LockedOutUntil", "Password", "PasswordExpiry"]); |
|
184 | + $memberFields = array_diff($memberFields, ["FirstName", "Surname", "Email", "TempIDHash", "TempIDExpired", "AutoLoginHash", "AutoLoginExpired", "PasswordEncryption", "Salt", "Locale", "FailedLoginCount", "LockedOutUntil", "Password", "PasswordExpiry"]); |
|
185 | 185 | return array_combine($memberFields, $memberFields); |
186 | 186 | } |
187 | 187 | |
188 | - public function getDBstatus(){ |
|
189 | - if(\SilverStripe\ORM\DB::is_active() && count(\SilverStripe\ORM\DB::table_list()) > 0){ |
|
188 | + public function getDBstatus() { |
|
189 | + if (\SilverStripe\ORM\DB::is_active() && count(\SilverStripe\ORM\DB::table_list()) > 0) { |
|
190 | 190 | return true; |
191 | 191 | } |
192 | 192 | return false; |
@@ -113,10 +113,11 @@ discard block |
||
113 | 113 | if (!$this->owner->LoginUrl()->ID && $this->getDBstatus()) { |
114 | 114 | $LoginUrl = SiteTree::get() |
115 | 115 | ->filter('ClassName', 'UserManagement\Page\UserLoginPage'); |
116 | - if($LoginUrl->count() > 0) |
|
117 | - return $LoginUrl->first()->ID; |
|
118 | - else |
|
119 | - return; |
|
116 | + if($LoginUrl->count() > 0) { |
|
117 | + return $LoginUrl->first()->ID; |
|
118 | + } else { |
|
119 | + return; |
|
120 | + } |
|
120 | 121 | } else { |
121 | 122 | return $this->owner->LoginUrl()->ID; |
122 | 123 | } |
@@ -132,10 +133,11 @@ discard block |
||
132 | 133 | if (!$this->owner->LoginCallBackUrl()->ID && $this->getDBstatus()) { |
133 | 134 | $LoginCallBackUrl = SiteTree::get() |
134 | 135 | ->filter('ClassName', 'UserManagement\Page\UserProfilePage'); |
135 | - if($LoginCallBackUrl->count() > 0) |
|
136 | - return $LoginCallBackUrl->first()->ID; |
|
137 | - else |
|
138 | - return; |
|
136 | + if($LoginCallBackUrl->count() > 0) { |
|
137 | + return $LoginCallBackUrl->first()->ID; |
|
138 | + } else { |
|
139 | + return; |
|
140 | + } |
|
139 | 141 | } else { |
140 | 142 | return $this->owner->LoginCallBackUrl()->ID; |
141 | 143 | } |
@@ -150,10 +152,11 @@ discard block |
||
150 | 152 | { |
151 | 153 | if (!$this->owner->LostPasswordUrl()->ID && $this->getDBstatus()) { |
152 | 154 | $LostPasswordUrl = SiteTree::get()->filter('ClassName', 'UserManagement\Page\LostPasswordPage'); |
153 | - if($LostPasswordUrl->count() > 0) |
|
154 | - return $LostPasswordUrl->first()->ID; |
|
155 | - else |
|
156 | - return; |
|
155 | + if($LostPasswordUrl->count() > 0) { |
|
156 | + return $LostPasswordUrl->first()->ID; |
|
157 | + } else { |
|
158 | + return; |
|
159 | + } |
|
157 | 160 | } else { |
158 | 161 | return $this->owner->LostPasswordUrl()->ID; |
159 | 162 | } |
@@ -169,10 +172,11 @@ discard block |
||
169 | 172 | { |
170 | 173 | if (!$this->owner->CustomerGroup()->ID && $this->getDBstatus()) { |
171 | 174 | $group = Group::get()->filter('Title', 'General'); |
172 | - if($group->count() > 0) |
|
173 | - return $group->first()->ID; |
|
174 | - else |
|
175 | - return; |
|
175 | + if($group->count() > 0) { |
|
176 | + return $group->first()->ID; |
|
177 | + } else { |
|
178 | + return; |
|
179 | + } |
|
176 | 180 | } else { |
177 | 181 | return $this->owner->CustomerGroup()->ID; |
178 | 182 | } |
@@ -74,8 +74,8 @@ |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * CMS fields test |
|
78 | - **/ |
|
77 | + * CMS fields test |
|
78 | + **/ |
|
79 | 79 | public function testgetCMSFields() |
80 | 80 | { |
81 | 81 |