Completed
Push — master ( b84faa...74b68c )
by
unknown
13s
created
src/Tasks/LDAPMigrateExistingMembersTask.php 1 patch
Spacing   +4 added lines, -4 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
     /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getTitle()
37 37
     {
38
-        return _t(__CLASS__ . '.TITLE', 'Migrate existing members in SilverStripe into LDAP members');
38
+        return _t(__CLASS__.'.TITLE', 'Migrate existing members in SilverStripe into LDAP members');
39 39
     }
40 40
 
41 41
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     protected function log($message)
90 90
     {
91
-        $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
92
-        echo Director::is_cli() ? ($message . PHP_EOL) : ($message . '<br>');
91
+        $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
92
+        echo Director::is_cli() ? ($message.PHP_EOL) : ($message.'<br>');
93 93
     }
94 94
 }
Please login to merge, or discard this patch.
src/Model/LDAPGroupMapping.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @var array
48 48
      */
49 49
     private static $dependencies = [
50
-        'ldapService' => '%$' . LDAPService::class,
50
+        'ldapService' => '%$'.LDAPService::class,
51 51
     ];
52 52
 
53 53
     private static $singular_name = 'LDAP Group Mapping';
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
         $fields = parent::getCMSFields();
64 64
         $fields->removeByName('DN');
65 65
 
66
-        $field = DropdownField::create('DN', _t(__CLASS__ . '.LDAPGROUP', 'LDAP Group'));
67
-        $field->setEmptyString(_t(__CLASS__ . '.SELECTONE', 'Select one'));
66
+        $field = DropdownField::create('DN', _t(__CLASS__.'.LDAPGROUP', 'LDAP Group'));
67
+        $field->setEmptyString(_t(__CLASS__.'.SELECTONE', 'Select one'));
68 68
         $groups = $this->ldapService->getGroups(true, ['dn', 'name']);
69 69
         $source = [];
70 70
         if ($groups) {
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
         $fields->removeByName('Scope');
80 80
         $fields->addFieldToTab(
81 81
             'Root.Main',
82
-            DropdownField::create('Scope', _t(__CLASS__ . '.SCOPE', 'Scope'), [
82
+            DropdownField::create('Scope', _t(__CLASS__.'.SCOPE', 'Scope'), [
83 83
                 'Subtree' => _t(
84
-                    __CLASS__ . '.SUBTREE_DESCRIPTION',
84
+                    __CLASS__.'.SUBTREE_DESCRIPTION',
85 85
                     'Users within this group and all nested groups within'
86 86
                 ),
87
-                'OneLevel' => _t(__CLASS__ . '.ONELEVEL_DESCRIPTION', 'Only users within this group'),
87
+                'OneLevel' => _t(__CLASS__.'.ONELEVEL_DESCRIPTION', 'Only users within this group'),
88 88
             ])
89 89
         );
90 90
 
Please login to merge, or discard this patch.
src/Extensions/LDAPGroupExtension.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             'Root.LDAP',
65 65
             ReadonlyField::create(
66 66
                 'LastSynced',
67
-                _t(__CLASS__ . '.LASTSYNCED', 'Last synced')
67
+                _t(__CLASS__.'.LASTSYNCED', 'Last synced')
68 68
             )
69 69
         );
70 70
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             $fields->addFieldToTab('Root.Members', ReadonlyField::create('Code'), 'Members');
76 76
 
77 77
             $message = _t(
78
-                __CLASS__ . '.INFOIMPORTED',
78
+                __CLASS__.'.INFOIMPORTED',
79 79
                 'This group is automatically imported from LDAP.'
80 80
             );
81 81
             $fields->addFieldToTab(
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
 
90 90
             $fields->addFieldToTab('Root.LDAP', ReadonlyField::create(
91 91
                 'LDAPGroupMappingsRO',
92
-                _t(__CLASS__ . '.AUTOMAPPEDGROUPS', 'Automatically mapped LDAP Groups'),
92
+                _t(__CLASS__.'.AUTOMAPPEDGROUPS', 'Automatically mapped LDAP Groups'),
93 93
                 implode('; ', $this->owner->LDAPGroupMappings()->column('DN'))
94 94
             ));
95 95
         } else {
96 96
             $field = GridField::create(
97 97
                 'LDAPGroupMappings',
98
-                _t(__CLASS__ . '.MAPPEDGROUPS', 'Mapped LDAP Groups'),
98
+                _t(__CLASS__.'.MAPPEDGROUPS', 'Mapped LDAP Groups'),
99 99
                 $this->owner->LDAPGroupMappings()
100 100
             );
101 101
             $config = GridFieldConfig_RecordEditor::create();
102 102
             $config->getComponentByType(GridFieldAddNewButton::class)
103
-                ->setButtonName(_t(__CLASS__ . '.ADDMAPPEDGROUP', 'Add LDAP group mapping'));
103
+                ->setButtonName(_t(__CLASS__.'.ADDMAPPEDGROUP', 'Add LDAP group mapping'));
104 104
 
105 105
             $field->setConfig($config);
106 106
             $fields->addFieldToTab('Root.LDAP', $field);
Please login to merge, or discard this patch.
src/Authenticators/LDAPAuthenticator.php 1 patch
Spacing   +7 added lines, -7 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,8 +200,8 @@  discard block
 block discarded – undo
200 200
     {
201 201
         $result = Authenticator::LOGIN | Authenticator::LOGOUT | Authenticator::CHECK_PASSWORD;
202 202
 
203
-        if ((bool)LDAPService::config()->get('allow_password_change')) {
204
-            $result |=  Authenticator::RESET_PASSWORD | Authenticator::CHANGE_PASSWORD;
203
+        if ((bool) LDAPService::config()->get('allow_password_change')) {
204
+            $result |= Authenticator::RESET_PASSWORD | Authenticator::CHANGE_PASSWORD;
205 205
         }
206 206
         return $result;
207 207
     }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         return LDAPChangePasswordHandler::create($link, $this);
221 221
     }
222 222
 
223
-    public function checkPassword(Member $member, $password, ValidationResult &$result = null)
223
+    public function checkPassword(Member $member, $password, ValidationResult & $result = null)
224 224
     {
225 225
         $result = $result ?: ValidationResult::create();
226 226
 
Please login to merge, or discard this patch.
src/Authenticators/LDAPLostPasswordHandler.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     ];
38 38
 
39 39
     private static $dependencies = [
40
-        'service' => '%$' . LDAPService::class,
40
+        'service' => '%$'.LDAPService::class,
41 41
     ];
42 42
 
43 43
     /**
@@ -136,8 +136,7 @@  discard block
 block discarded – undo
136 136
     public function lostPasswordForm()
137 137
     {
138 138
         $loginFieldLabel = (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') ?
139
-            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') :
140
-            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'Username');
139
+            _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAMEOREMAIL', 'Username or email') : _t('SilverStripe\\LDAP\\Forms\\LDAPLoginForm.USERNAME', 'Username');
141 140
         $loginField = TextField::create('Login', $loginFieldLabel);
142 141
 
143 142
         $action = FormAction::create(
@@ -158,13 +157,13 @@  discard block
 block discarded – undo
158 157
     {
159 158
         if (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') {
160 159
             $message = _t(
161
-                __CLASS__ . '.NOTERESETPASSWORDUSERNAMEOREMAIL',
160
+                __CLASS__.'.NOTERESETPASSWORDUSERNAMEOREMAIL',
162 161
                 'Enter your username or your email address and we will send you a link with which '
163 162
                 . 'you can reset your password'
164 163
             );
165 164
         } else {
166 165
             $message = _t(
167
-                __CLASS__ . '.NOTERESETPASSWORDUSERNAME',
166
+                __CLASS__.'.NOTERESETPASSWORDUSERNAME',
168 167
                 'Enter your username and we will send you a link with which you can reset your password'
169 168
             );
170 169
         }
@@ -180,17 +179,17 @@  discard block
 block discarded – undo
180 179
         $username = Convert::raw2xml(
181 180
             rawurldecode($this->getRequest()->param('OtherID'))
182 181
         );
183
-        $username .= ($extension = $this->getRequest()->getExtension()) ? '.' . $extension : '';
182
+        $username .= ($extension = $this->getRequest()->getExtension()) ? '.'.$extension : '';
184 183
 
185 184
         return [
186 185
             'Title' => _t(
187
-                __CLASS__ . '.PASSWORDSENTHEADER',
186
+                __CLASS__.'.PASSWORDSENTHEADER',
188 187
                 "Password reset link sent to '{username}'",
189 188
                 ['username' => $username]
190 189
             ),
191 190
             'Content' =>
192 191
                 _t(
193
-                    __CLASS__ . '.PASSWORDSENTTEXT',
192
+                    __CLASS__.'.PASSWORDSENTTEXT',
194 193
                     "Thank you! A reset link has been sent to '{username}', provided an account exists.",
195 194
                     ['username' => $username]
196 195
                 ),
Please login to merge, or discard this patch.