Passed
Push — master ( 3c190c...2857c2 )
by Robbie
03:26
created
src/Extensions/LDAPGroupExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             'Root.LDAP',
64 64
             ReadonlyField::create(
65 65
                 'LastSynced',
66
-                _t(__CLASS__ . '.LASTSYNCED', 'Last synced')
66
+                _t(__CLASS__.'.LASTSYNCED', 'Last synced')
67 67
             )
68 68
         );
69 69
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $fields->addFieldToTab('Root.Members', ReadonlyField::create('Code'), 'Members');
75 75
 
76 76
             $message = _t(
77
-                __CLASS__ . '.INFOIMPORTED',
77
+                __CLASS__.'.INFOIMPORTED',
78 78
                 'This group is automatically imported from LDAP.'
79 79
             );
80 80
             $fields->addFieldToTab(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
             $fields->addFieldToTab('Root.LDAP', ReadonlyField::create(
90 90
                 'LDAPGroupMappingsRO',
91
-                _t(__CLASS__ . '.AUTOMAPPEDGROUPS', 'Automatically mapped LDAP Groups'),
91
+                _t(__CLASS__.'.AUTOMAPPEDGROUPS', 'Automatically mapped LDAP Groups'),
92 92
                 implode('; ', $this->owner->LDAPGroupMappings()->column('DN'))
93 93
             ));
94 94
         } else {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             );
100 100
             $config = GridFieldConfig_RecordEditor::create();
101 101
             $config->getComponentByType('GridFieldAddNewButton')
102
-                ->setButtonName(_t(__CLASS__ . '.ADDMAPPEDGROUP', 'Add LDAP group mapping'));
102
+                ->setButtonName(_t(__CLASS__.'.ADDMAPPEDGROUP', 'Add LDAP group mapping'));
103 103
 
104 104
             $field->setConfig($config);
105 105
             $fields->addFieldToTab('Root.LDAP', $field);
Please login to merge, or discard this patch.
src/Extensions/LDAPMemberExtension.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
             'IsExpired',
107 107
             $ldapMetadata[] = ReadonlyField::create(
108 108
                 'IsExpired',
109
-                _t(__CLASS__ . '.ISEXPIRED', 'Has user\'s LDAP/AD login expired?')
109
+                _t(__CLASS__.'.ISEXPIRED', 'Has user\'s LDAP/AD login expired?')
110 110
             )
111 111
         );
112 112
         $fields->replaceField(
113 113
             'LastSynced',
114 114
             $ldapMetadata[] = ReadonlyField::create(
115 115
                 'LastSynced',
116
-                _t(__CLASS__ . '.LASTSYNCED', 'Last synced')
116
+                _t(__CLASS__.'.LASTSYNCED', 'Last synced')
117 117
             )
118 118
         );
119 119
         $fields->addFieldsToTab('Root.LDAP', $ldapMetadata);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $message = '';
122 122
         if ($this->owner->GUID && $this->owner->config()->update_ldap_from_local) {
123 123
             $message = _t(
124
-                __CLASS__ . '.CHANGEFIELDSUPDATELDAP',
124
+                __CLASS__.'.CHANGEFIELDSUPDATELDAP',
125 125
                 'Changing fields here will update them in LDAP.'
126 126
             );
127 127
         } elseif ($this->owner->GUID && !$this->owner->config()->update_ldap_from_local) {
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
                     // Set to readonly, but not disabled so that the data is still sent to the
134 134
                     // server and doesn't break Member_Validator
135 135
                     $field->setReadonly(true);
136
-                    $field->setTitle($field->Title()._t(__CLASS__ . '.IMPORTEDFIELD', ' (imported)'));
136
+                    $field->setTitle($field->Title()._t(__CLASS__.'.IMPORTEDFIELD', ' (imported)'));
137 137
                 }
138 138
             }
139 139
             $message = _t(
140
-                __CLASS__ . '.INFOIMPORTED',
140
+                __CLASS__.'.INFOIMPORTED',
141 141
                 'This user is automatically imported from LDAP. '.
142 142
                     'Manual changes to imported fields will be removed upon sync.'
143 143
             );
Please login to merge, or discard this patch.
src/Authenticators/LDAPAuthenticator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @param ValidationResult|null $result
81 81
      * @return null|Member
82 82
      */
83
-    public function authenticate(array $data, HTTPRequest $request, ValidationResult &$result = null)
83
+    public function authenticate(array $data, HTTPRequest $request, ValidationResult & $result = null)
84 84
     {
85 85
         $result = $result ?: ValidationResult::create();
86 86
         /** @var LDAPService $service */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             if (Config::inst()->get(self::class, 'allow_email_login') != 'yes') {
91 91
                 $result->addError(
92 92
                     _t(
93
-                        __CLASS__ . '.PLEASEUSEUSERNAME',
93
+                        __CLASS__.'.PLEASEUSEUSERNAME',
94 94
                         'Please enter your username instead of your email to log in.'
95 95
                     )
96 96
                 );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                     }
109 109
                 }
110 110
 
111
-                $result->addError(_t(__CLASS__ . '.INVALIDCREDENTIALS', 'Invalid credentials'));
111
+                $result->addError(_t(__CLASS__.'.INVALIDCREDENTIALS', 'Invalid credentials'));
112 112
                 return null;
113 113
             }
114 114
         } else {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         if (!$data) {
142 142
             $result->addError(
143 143
                 _t(
144
-                    __CLASS__ . '.PROBLEMFINDINGDATA',
144
+                    __CLASS__.'.PROBLEMFINDINGDATA',
145 145
                     'There was a problem retrieving your user data'
146 146
                 )
147 147
             );
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $result = Authenticator::LOGIN | Authenticator::LOGOUT | Authenticator::RESET_PASSWORD;
202 202
 
203
-        if ((bool)LDAPService::config()->get('allow_password_change')) {
203
+        if ((bool) LDAPService::config()->get('allow_password_change')) {
204 204
             $result |= Authenticator::CHANGE_PASSWORD;
205 205
         }
206 206
         return $result;
Please login to merge, or discard this patch.
src/Authenticators/LDAPChangePasswordHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 $form->clearMessage();
59 59
                 $form->sessionMessage(
60 60
                     _t(
61
-                        __CLASS__ . '.NOUSER',
61
+                        __CLASS__.'.NOUSER',
62 62
                         'Your account hasn\'t been setup properly, please contact an administrator.'
63 63
                     ),
64 64
                     'bad'
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             // Providing OldPassword to perform password _change_ operation. This will respect the
110 110
             // password history policy. Unfortunately we cannot support password history policy on password _reset_
111 111
             // at the moment, which means it will not be enforced on SilverStripe-driven email password reset.
112
-            $oldPassword = !empty($data['OldPassword']) ? $data['OldPassword']: null;
112
+            $oldPassword = !empty($data['OldPassword']) ? $data['OldPassword'] : null;
113 113
 
114 114
             /** @var ValidationResult $validationResult */
115 115
             $validationResult = $service->setPassword($member, $data['NewPassword1'], $oldPassword);
Please login to merge, or discard this patch.
src/Authenticators/LDAPLostPasswordHandler.php 1 patch
Spacing   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
                 ->setData(['PasswordResetLink' => Security::getPasswordResetLink($member, $token)]);
125 125
             $e->setTo($member->Email);
126 126
             $e->send();
127
-            return $controller->redirect($controller->Link('passwordsent/') . urlencode($data['Login']));
127
+            return $controller->redirect($controller->Link('passwordsent/').urlencode($data['Login']));
128 128
         } elseif ($data['Login']) {
129 129
             // Avoid information disclosure by displaying the same status,
130 130
             // regardless whether the email address actually exists
131
-            return $controller->redirect($controller->Link('passwordsent/') . urlencode($data['Login']));
131
+            return $controller->redirect($controller->Link('passwordsent/').urlencode($data['Login']));
132 132
         } else {
133 133
             if (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') {
134 134
                 $form->sessionMessage(
@@ -159,8 +159,7 @@  discard block
 block discarded – undo
159 159
     public function lostPasswordForm()
160 160
     {
161 161
         $loginFieldLabel = (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') ?
162
-            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') :
163
-            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'Username');
162
+            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') : _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'Username');
164 163
         $loginField = TextField::create('Login', $loginFieldLabel);
165 164
 
166 165
         $action = FormAction::create(
@@ -181,13 +180,13 @@  discard block
 block discarded – undo
181 180
     {
182 181
         if (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') {
183 182
             $message = _t(
184
-                __CLASS__ . '.NOTERESETPASSWORDUSERNAMEOREMAIL',
183
+                __CLASS__.'.NOTERESETPASSWORDUSERNAMEOREMAIL',
185 184
                 'Enter your username or your email address and we will send you a link with which '
186 185
                 . 'you can reset your password'
187 186
             );
188 187
         } else {
189 188
             $message = _t(
190
-                __CLASS__ . '.NOTERESETPASSWORDUSERNAME',
189
+                __CLASS__.'.NOTERESETPASSWORDUSERNAME',
191 190
                 'Enter your username and we will send you a link with which you can reset your password'
192 191
             );
193 192
         }
@@ -203,17 +202,17 @@  discard block
 block discarded – undo
203 202
         $username = Convert::raw2xml(
204 203
             rawurldecode($this->getRequest()->param('OtherID'))
205 204
         );
206
-        $username .= ($extension = $this->request->getExtension()) ? '.' . $extension : '';
205
+        $username .= ($extension = $this->request->getExtension()) ? '.'.$extension : '';
207 206
 
208 207
         return [
209 208
             'Title' => _t(
210
-                __CLASS__ . '.PASSWORDSENTHEADER',
209
+                __CLASS__.'.PASSWORDSENTHEADER',
211 210
                 "Password reset link sent to '{username}'",
212 211
                 ['username' => $username]
213 212
             ),
214 213
             'Content' =>
215 214
                 _t(
216
-                    __CLASS__ . '.PASSWORDSENTTEXT',
215
+                    __CLASS__.'.PASSWORDSENTTEXT',
217 216
                     "Thank you! A reset link has been sent to '{username}', provided an account exists.",
218 217
                     ['username' => $username]
219 218
                 ),
Please login to merge, or discard this patch.
src/Control/LDAPDebugController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      * @var array
33 33
      */
34 34
     private static $dependencies = [
35
-        'ldapService' => '%$' . LDAPService::class
35
+        'ldapService' => '%$'.LDAPService::class
36 36
     ];
37 37
 
38 38
     /**
Please login to merge, or discard this patch.
src/Tasks/LDAPMemberSyncTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @var array
29 29
      */
30 30
     private static $dependencies = [
31
-        'ldapService' => '%$' . LDAPService::class,
31
+        'ldapService' => '%$'.LDAPService::class,
32 32
     ];
33 33
 
34 34
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getTitle()
47 47
     {
48
-        return _t(__CLASS__ . '.SYNCTITLE', 'Sync all users from Active Directory');
48
+        return _t(__CLASS__.'.SYNCTITLE', 'Sync all users from Active Directory');
49 49
     }
50 50
 
51 51
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     protected function log($message)
148 148
     {
149
-        $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
150
-        echo Director::is_cli() ? ($message . PHP_EOL) : ($message . '<br>');
149
+        $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
150
+        echo Director::is_cli() ? ($message.PHP_EOL) : ($message.'<br>');
151 151
     }
152 152
 }
Please login to merge, or discard this patch.
src/Tasks/LDAPGroupSyncTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @var array
29 29
      */
30 30
     private static $dependencies = [
31
-        'ldapService' => '%$' . LDAPService::class,
31
+        'ldapService' => '%$'.LDAPService::class,
32 32
     ];
33 33
 
34 34
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getTitle()
47 47
     {
48
-        return _t(__CLASS__ . '.SYNCTITLE', 'Sync all groups from Active Directory');
48
+        return _t(__CLASS__.'.SYNCTITLE', 'Sync all groups from Active Directory');
49 49
     }
50 50
 
51 51
     /**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     protected function log($message)
152 152
     {
153
-        $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
154
-        echo Director::is_cli() ? ($message . PHP_EOL) : ($message . '<br>');
153
+        $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
154
+        echo Director::is_cli() ? ($message.PHP_EOL) : ($message.'<br>');
155 155
     }
156 156
 }
Please login to merge, or discard this patch.
src/Tasks/LDAPMigrateExistingMembersTask.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @var array
28 28
      */
29 29
     private static $dependencies = [
30
-        'ldapService' => '%$' . LDAPService::class,
30
+        'ldapService' => '%$'.LDAPService::class,
31 31
     ];
32 32
 
33 33
     /**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function log($message)
82 82
     {
83
-        $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
84
-        echo Director::is_cli() ? ($message . PHP_EOL) : ($message . '<br>');
83
+        $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
84
+        echo Director::is_cli() ? ($message.PHP_EOL) : ($message.'<br>');
85 85
     }
86 86
 }
Please login to merge, or discard this patch.