@@ -39,27 +39,27 @@ |
||
39 | 39 | */ |
40 | 40 | class RemoveRefreshTime implements IRepairStep { |
41 | 41 | |
42 | - /** @var IDBConnection */ |
|
43 | - private $dbc; |
|
44 | - /** @var IConfig */ |
|
45 | - private $config; |
|
42 | + /** @var IDBConnection */ |
|
43 | + private $dbc; |
|
44 | + /** @var IConfig */ |
|
45 | + private $config; |
|
46 | 46 | |
47 | - public function __construct(IDBConnection $dbc, IConfig $config) { |
|
48 | - $this->dbc = $dbc; |
|
49 | - $this->config = $config; |
|
50 | - } |
|
47 | + public function __construct(IDBConnection $dbc, IConfig $config) { |
|
48 | + $this->dbc = $dbc; |
|
49 | + $this->config = $config; |
|
50 | + } |
|
51 | 51 | |
52 | - public function getName() { |
|
53 | - return 'Remove deprecated refresh time markers for LDAP user records'; |
|
54 | - } |
|
52 | + public function getName() { |
|
53 | + return 'Remove deprecated refresh time markers for LDAP user records'; |
|
54 | + } |
|
55 | 55 | |
56 | - public function run(IOutput $output) { |
|
57 | - $this->config->deleteAppValue('user_ldap', 'updateAttributesInterval'); |
|
56 | + public function run(IOutput $output) { |
|
57 | + $this->config->deleteAppValue('user_ldap', 'updateAttributesInterval'); |
|
58 | 58 | |
59 | - $qb = $this->dbc->getQueryBuilder(); |
|
60 | - $qb->delete('preferences') |
|
61 | - ->where($qb->expr()->eq('appid', $qb->createNamedParameter('user_ldap'))) |
|
62 | - ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lastFeatureRefresh'))) |
|
63 | - ->execute(); |
|
64 | - } |
|
59 | + $qb = $this->dbc->getQueryBuilder(); |
|
60 | + $qb->delete('preferences') |
|
61 | + ->where($qb->expr()->eq('appid', $qb->createNamedParameter('user_ldap'))) |
|
62 | + ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lastFeatureRefresh'))) |
|
63 | + ->execute(); |
|
64 | + } |
|
65 | 65 | } |
@@ -51,690 +51,690 @@ |
||
51 | 51 | * represents an LDAP user, gets and holds user-specific information from LDAP |
52 | 52 | */ |
53 | 53 | class User { |
54 | - /** |
|
55 | - * @var Access |
|
56 | - */ |
|
57 | - protected $access; |
|
58 | - /** |
|
59 | - * @var Connection |
|
60 | - */ |
|
61 | - protected $connection; |
|
62 | - /** |
|
63 | - * @var IConfig |
|
64 | - */ |
|
65 | - protected $config; |
|
66 | - /** |
|
67 | - * @var FilesystemHelper |
|
68 | - */ |
|
69 | - protected $fs; |
|
70 | - /** |
|
71 | - * @var Image |
|
72 | - */ |
|
73 | - protected $image; |
|
74 | - /** |
|
75 | - * @var LogWrapper |
|
76 | - */ |
|
77 | - protected $log; |
|
78 | - /** |
|
79 | - * @var IAvatarManager |
|
80 | - */ |
|
81 | - protected $avatarManager; |
|
82 | - /** |
|
83 | - * @var IUserManager |
|
84 | - */ |
|
85 | - protected $userManager; |
|
86 | - /** |
|
87 | - * @var INotificationManager |
|
88 | - */ |
|
89 | - protected $notificationManager; |
|
90 | - /** |
|
91 | - * @var string |
|
92 | - */ |
|
93 | - protected $dn; |
|
94 | - /** |
|
95 | - * @var string |
|
96 | - */ |
|
97 | - protected $uid; |
|
98 | - /** |
|
99 | - * @var string[] |
|
100 | - */ |
|
101 | - protected $refreshedFeatures = []; |
|
102 | - /** |
|
103 | - * @var string |
|
104 | - */ |
|
105 | - protected $avatarImage; |
|
106 | - |
|
107 | - /** |
|
108 | - * DB config keys for user preferences |
|
109 | - */ |
|
110 | - public const USER_PREFKEY_FIRSTLOGIN = 'firstLoginAccomplished'; |
|
111 | - |
|
112 | - /** |
|
113 | - * @brief constructor, make sure the subclasses call this one! |
|
114 | - * @param string $username the internal username |
|
115 | - * @param string $dn the LDAP DN |
|
116 | - * @param Access $access |
|
117 | - * @param IConfig $config |
|
118 | - * @param FilesystemHelper $fs |
|
119 | - * @param Image $image any empty instance |
|
120 | - * @param LogWrapper $log |
|
121 | - * @param IAvatarManager $avatarManager |
|
122 | - * @param IUserManager $userManager |
|
123 | - * @param INotificationManager $notificationManager |
|
124 | - */ |
|
125 | - public function __construct($username, $dn, Access $access, |
|
126 | - IConfig $config, FilesystemHelper $fs, Image $image, |
|
127 | - LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager, |
|
128 | - INotificationManager $notificationManager) { |
|
129 | - if ($username === null) { |
|
130 | - $log->log("uid for '$dn' must not be null!", ILogger::ERROR); |
|
131 | - throw new \InvalidArgumentException('uid must not be null!'); |
|
132 | - } elseif ($username === '') { |
|
133 | - $log->log("uid for '$dn' must not be an empty string", ILogger::ERROR); |
|
134 | - throw new \InvalidArgumentException('uid must not be an empty string!'); |
|
135 | - } |
|
136 | - |
|
137 | - $this->access = $access; |
|
138 | - $this->connection = $access->getConnection(); |
|
139 | - $this->config = $config; |
|
140 | - $this->fs = $fs; |
|
141 | - $this->dn = $dn; |
|
142 | - $this->uid = $username; |
|
143 | - $this->image = $image; |
|
144 | - $this->log = $log; |
|
145 | - $this->avatarManager = $avatarManager; |
|
146 | - $this->userManager = $userManager; |
|
147 | - $this->notificationManager = $notificationManager; |
|
148 | - |
|
149 | - \OCP\Util::connectHook('OC_User', 'post_login', $this, 'handlePasswordExpiry'); |
|
150 | - } |
|
151 | - |
|
152 | - /** |
|
153 | - * marks a user as deleted |
|
154 | - * |
|
155 | - * @throws \OCP\PreConditionNotMetException |
|
156 | - */ |
|
157 | - public function markUser() { |
|
158 | - $curValue = $this->config->getUserValue($this->getUsername(), 'user_ldap', 'isDeleted', '0'); |
|
159 | - if ($curValue === '1') { |
|
160 | - // the user is already marked, do not write to DB again |
|
161 | - return; |
|
162 | - } |
|
163 | - $this->config->setUserValue($this->getUsername(), 'user_ldap', 'isDeleted', '1'); |
|
164 | - $this->config->setUserValue($this->getUsername(), 'user_ldap', 'foundDeleted', (string)time()); |
|
165 | - } |
|
166 | - |
|
167 | - /** |
|
168 | - * processes results from LDAP for attributes as returned by getAttributesToRead() |
|
169 | - * @param array $ldapEntry the user entry as retrieved from LDAP |
|
170 | - */ |
|
171 | - public function processAttributes($ldapEntry) { |
|
172 | - //Quota |
|
173 | - $attr = strtolower($this->connection->ldapQuotaAttribute); |
|
174 | - if (isset($ldapEntry[$attr])) { |
|
175 | - $this->updateQuota($ldapEntry[$attr][0]); |
|
176 | - } else { |
|
177 | - if ($this->connection->ldapQuotaDefault !== '') { |
|
178 | - $this->updateQuota(); |
|
179 | - } |
|
180 | - } |
|
181 | - unset($attr); |
|
182 | - |
|
183 | - //displayName |
|
184 | - $displayName = $displayName2 = ''; |
|
185 | - $attr = strtolower($this->connection->ldapUserDisplayName); |
|
186 | - if (isset($ldapEntry[$attr])) { |
|
187 | - $displayName = (string)$ldapEntry[$attr][0]; |
|
188 | - } |
|
189 | - $attr = strtolower($this->connection->ldapUserDisplayName2); |
|
190 | - if (isset($ldapEntry[$attr])) { |
|
191 | - $displayName2 = (string)$ldapEntry[$attr][0]; |
|
192 | - } |
|
193 | - if ($displayName !== '') { |
|
194 | - $this->composeAndStoreDisplayName($displayName, $displayName2); |
|
195 | - $this->access->cacheUserDisplayName( |
|
196 | - $this->getUsername(), |
|
197 | - $displayName, |
|
198 | - $displayName2 |
|
199 | - ); |
|
200 | - } |
|
201 | - unset($attr); |
|
202 | - |
|
203 | ||
204 | - //email must be stored after displayname, because it would cause a user |
|
205 | - //change event that will trigger fetching the display name again |
|
206 | - $attr = strtolower($this->connection->ldapEmailAttribute); |
|
207 | - if (isset($ldapEntry[$attr])) { |
|
208 | - $this->updateEmail($ldapEntry[$attr][0]); |
|
209 | - } |
|
210 | - unset($attr); |
|
211 | - |
|
212 | - // LDAP Username, needed for s2s sharing |
|
213 | - if (isset($ldapEntry['uid'])) { |
|
214 | - $this->storeLDAPUserName($ldapEntry['uid'][0]); |
|
215 | - } elseif (isset($ldapEntry['samaccountname'])) { |
|
216 | - $this->storeLDAPUserName($ldapEntry['samaccountname'][0]); |
|
217 | - } |
|
218 | - |
|
219 | - //homePath |
|
220 | - if (strpos($this->connection->homeFolderNamingRule, 'attr:') === 0) { |
|
221 | - $attr = strtolower(substr($this->connection->homeFolderNamingRule, strlen('attr:'))); |
|
222 | - if (isset($ldapEntry[$attr])) { |
|
223 | - $this->access->cacheUserHome( |
|
224 | - $this->getUsername(), $this->getHomePath($ldapEntry[$attr][0])); |
|
225 | - } |
|
226 | - } |
|
227 | - |
|
228 | - //memberOf groups |
|
229 | - $cacheKey = 'getMemberOf'.$this->getUsername(); |
|
230 | - $groups = false; |
|
231 | - if (isset($ldapEntry['memberof'])) { |
|
232 | - $groups = $ldapEntry['memberof']; |
|
233 | - } |
|
234 | - $this->connection->writeToCache($cacheKey, $groups); |
|
235 | - |
|
236 | - //external storage var |
|
237 | - $attr = strtolower($this->connection->ldapExtStorageHomeAttribute); |
|
238 | - if (isset($ldapEntry[$attr])) { |
|
239 | - $this->updateExtStorageHome($ldapEntry[$attr][0]); |
|
240 | - } |
|
241 | - unset($attr); |
|
242 | - |
|
243 | - //Avatar |
|
244 | - /** @var Connection $connection */ |
|
245 | - $connection = $this->access->getConnection(); |
|
246 | - $attributes = $connection->resolveRule('avatar'); |
|
247 | - foreach ($attributes as $attribute) { |
|
248 | - if (isset($ldapEntry[$attribute])) { |
|
249 | - $this->avatarImage = $ldapEntry[$attribute][0]; |
|
250 | - // the call to the method that saves the avatar in the file |
|
251 | - // system must be postponed after the login. It is to ensure |
|
252 | - // external mounts are mounted properly (e.g. with login |
|
253 | - // credentials from the session). |
|
254 | - \OCP\Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin'); |
|
255 | - break; |
|
256 | - } |
|
257 | - } |
|
258 | - } |
|
259 | - |
|
260 | - /** |
|
261 | - * @brief returns the LDAP DN of the user |
|
262 | - * @return string |
|
263 | - */ |
|
264 | - public function getDN() { |
|
265 | - return $this->dn; |
|
266 | - } |
|
267 | - |
|
268 | - /** |
|
269 | - * @brief returns the Nextcloud internal username of the user |
|
270 | - * @return string |
|
271 | - */ |
|
272 | - public function getUsername() { |
|
273 | - return $this->uid; |
|
274 | - } |
|
275 | - |
|
276 | - /** |
|
277 | - * returns the home directory of the user if specified by LDAP settings |
|
278 | - * @param string $valueFromLDAP |
|
279 | - * @return bool|string |
|
280 | - * @throws \Exception |
|
281 | - */ |
|
282 | - public function getHomePath($valueFromLDAP = null) { |
|
283 | - $path = (string)$valueFromLDAP; |
|
284 | - $attr = null; |
|
285 | - |
|
286 | - if (is_null($valueFromLDAP) |
|
287 | - && strpos($this->access->connection->homeFolderNamingRule, 'attr:') === 0 |
|
288 | - && $this->access->connection->homeFolderNamingRule !== 'attr:') { |
|
289 | - $attr = substr($this->access->connection->homeFolderNamingRule, strlen('attr:')); |
|
290 | - $homedir = $this->access->readAttribute( |
|
291 | - $this->access->username2dn($this->getUsername()), $attr); |
|
292 | - if ($homedir && isset($homedir[0])) { |
|
293 | - $path = $homedir[0]; |
|
294 | - } |
|
295 | - } |
|
296 | - |
|
297 | - if ($path !== '') { |
|
298 | - //if attribute's value is an absolute path take this, otherwise append it to data dir |
|
299 | - //check for / at the beginning or pattern c:\ resp. c:/ |
|
300 | - if ('/' !== $path[0] |
|
301 | - && !(3 < strlen($path) && ctype_alpha($path[0]) |
|
302 | - && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) |
|
303 | - ) { |
|
304 | - $path = $this->config->getSystemValue('datadirectory', |
|
305 | - \OC::$SERVERROOT.'/data') . '/' . $path; |
|
306 | - } |
|
307 | - //we need it to store it in the DB as well in case a user gets |
|
308 | - //deleted so we can clean up afterwards |
|
309 | - $this->config->setUserValue( |
|
310 | - $this->getUsername(), 'user_ldap', 'homePath', $path |
|
311 | - ); |
|
312 | - return $path; |
|
313 | - } |
|
314 | - |
|
315 | - if (!is_null($attr) |
|
316 | - && $this->config->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true) |
|
317 | - ) { |
|
318 | - // a naming rule attribute is defined, but it doesn't exist for that LDAP user |
|
319 | - throw new \Exception('Home dir attribute can\'t be read from LDAP for uid: ' . $this->getUsername()); |
|
320 | - } |
|
321 | - |
|
322 | - //false will apply default behaviour as defined and done by OC_User |
|
323 | - $this->config->setUserValue($this->getUsername(), 'user_ldap', 'homePath', ''); |
|
324 | - return false; |
|
325 | - } |
|
326 | - |
|
327 | - public function getMemberOfGroups() { |
|
328 | - $cacheKey = 'getMemberOf'.$this->getUsername(); |
|
329 | - $memberOfGroups = $this->connection->getFromCache($cacheKey); |
|
330 | - if (!is_null($memberOfGroups)) { |
|
331 | - return $memberOfGroups; |
|
332 | - } |
|
333 | - $groupDNs = $this->access->readAttribute($this->getDN(), 'memberOf'); |
|
334 | - $this->connection->writeToCache($cacheKey, $groupDNs); |
|
335 | - return $groupDNs; |
|
336 | - } |
|
337 | - |
|
338 | - /** |
|
339 | - * @brief reads the image from LDAP that shall be used as Avatar |
|
340 | - * @return string data (provided by LDAP) | false |
|
341 | - */ |
|
342 | - public function getAvatarImage() { |
|
343 | - if (!is_null($this->avatarImage)) { |
|
344 | - return $this->avatarImage; |
|
345 | - } |
|
346 | - |
|
347 | - $this->avatarImage = false; |
|
348 | - /** @var Connection $connection */ |
|
349 | - $connection = $this->access->getConnection(); |
|
350 | - $attributes = $connection->resolveRule('avatar'); |
|
351 | - foreach ($attributes as $attribute) { |
|
352 | - $result = $this->access->readAttribute($this->dn, $attribute); |
|
353 | - if ($result !== false && is_array($result) && isset($result[0])) { |
|
354 | - $this->avatarImage = $result[0]; |
|
355 | - break; |
|
356 | - } |
|
357 | - } |
|
358 | - |
|
359 | - return $this->avatarImage; |
|
360 | - } |
|
361 | - |
|
362 | - /** |
|
363 | - * @brief marks the user as having logged in at least once |
|
364 | - * @return null |
|
365 | - */ |
|
366 | - public function markLogin() { |
|
367 | - $this->config->setUserValue( |
|
368 | - $this->uid, 'user_ldap', self::USER_PREFKEY_FIRSTLOGIN, 1); |
|
369 | - } |
|
370 | - |
|
371 | - /** |
|
372 | - * Stores a key-value pair in relation to this user |
|
373 | - * |
|
374 | - * @param string $key |
|
375 | - * @param string $value |
|
376 | - */ |
|
377 | - private function store($key, $value) { |
|
378 | - $this->config->setUserValue($this->uid, 'user_ldap', $key, $value); |
|
379 | - } |
|
380 | - |
|
381 | - /** |
|
382 | - * Composes the display name and stores it in the database. The final |
|
383 | - * display name is returned. |
|
384 | - * |
|
385 | - * @param string $displayName |
|
386 | - * @param string $displayName2 |
|
387 | - * @return string the effective display name |
|
388 | - */ |
|
389 | - public function composeAndStoreDisplayName($displayName, $displayName2 = '') { |
|
390 | - $displayName2 = (string)$displayName2; |
|
391 | - if ($displayName2 !== '') { |
|
392 | - $displayName .= ' (' . $displayName2 . ')'; |
|
393 | - } |
|
394 | - $oldName = $this->config->getUserValue($this->uid, 'user_ldap', 'displayName', null); |
|
395 | - if ($oldName !== $displayName) { |
|
396 | - $this->store('displayName', $displayName); |
|
397 | - $user = $this->userManager->get($this->getUsername()); |
|
398 | - if (!empty($oldName) && $user instanceof \OC\User\User) { |
|
399 | - // if it was empty, it would be a new record, not a change emitting the trigger could |
|
400 | - // potentially cause a UniqueConstraintViolationException, depending on some factors. |
|
401 | - $user->triggerChange('displayName', $displayName, $oldName); |
|
402 | - } |
|
403 | - } |
|
404 | - return $displayName; |
|
405 | - } |
|
406 | - |
|
407 | - /** |
|
408 | - * Stores the LDAP Username in the Database |
|
409 | - * @param string $userName |
|
410 | - */ |
|
411 | - public function storeLDAPUserName($userName) { |
|
412 | - $this->store('uid', $userName); |
|
413 | - } |
|
414 | - |
|
415 | - /** |
|
416 | - * @brief checks whether an update method specified by feature was run |
|
417 | - * already. If not, it will marked like this, because it is expected that |
|
418 | - * the method will be run, when false is returned. |
|
419 | - * @param string $feature email | quota | avatar (can be extended) |
|
420 | - * @return bool |
|
421 | - */ |
|
422 | - private function wasRefreshed($feature) { |
|
423 | - if (isset($this->refreshedFeatures[$feature])) { |
|
424 | - return true; |
|
425 | - } |
|
426 | - $this->refreshedFeatures[$feature] = 1; |
|
427 | - return false; |
|
428 | - } |
|
429 | - |
|
430 | - /** |
|
431 | - * fetches the email from LDAP and stores it as Nextcloud user value |
|
432 | - * @param string $valueFromLDAP if known, to save an LDAP read request |
|
433 | - * @return null |
|
434 | - */ |
|
435 | - public function updateEmail($valueFromLDAP = null) { |
|
436 | - if ($this->wasRefreshed('email')) { |
|
437 | - return; |
|
438 | - } |
|
439 | - $email = (string)$valueFromLDAP; |
|
440 | - if (is_null($valueFromLDAP)) { |
|
441 | - $emailAttribute = $this->connection->ldapEmailAttribute; |
|
442 | - if ($emailAttribute !== '') { |
|
443 | - $aEmail = $this->access->readAttribute($this->dn, $emailAttribute); |
|
444 | - if (is_array($aEmail) && (count($aEmail) > 0)) { |
|
445 | - $email = (string)$aEmail[0]; |
|
446 | - } |
|
447 | - } |
|
448 | - } |
|
449 | - if ($email !== '') { |
|
450 | - $user = $this->userManager->get($this->uid); |
|
451 | - if (!is_null($user)) { |
|
452 | - $currentEmail = (string)$user->getEMailAddress(); |
|
453 | - if ($currentEmail !== $email) { |
|
454 | - $user->setEMailAddress($email); |
|
455 | - } |
|
456 | - } |
|
457 | - } |
|
458 | - } |
|
459 | - |
|
460 | - /** |
|
461 | - * Overall process goes as follow: |
|
462 | - * 1. fetch the quota from LDAP and check if it's parseable with the "verifyQuotaValue" function |
|
463 | - * 2. if the value can't be fetched, is empty or not parseable, use the default LDAP quota |
|
464 | - * 3. if the default LDAP quota can't be parsed, use the Nextcloud's default quota (use 'default') |
|
465 | - * 4. check if the target user exists and set the quota for the user. |
|
466 | - * |
|
467 | - * In order to improve performance and prevent an unwanted extra LDAP call, the $valueFromLDAP |
|
468 | - * parameter can be passed with the value of the attribute. This value will be considered as the |
|
469 | - * quota for the user coming from the LDAP server (step 1 of the process) It can be useful to |
|
470 | - * fetch all the user's attributes in one call and use the fetched values in this function. |
|
471 | - * The expected value for that parameter is a string describing the quota for the user. Valid |
|
472 | - * values are 'none' (unlimited), 'default' (the Nextcloud's default quota), '1234' (quota in |
|
473 | - * bytes), '1234 MB' (quota in MB - check the \OC_Helper::computerFileSize method for more info) |
|
474 | - * |
|
475 | - * fetches the quota from LDAP and stores it as Nextcloud user value |
|
476 | - * @param string $valueFromLDAP the quota attribute's value can be passed, |
|
477 | - * to save the readAttribute request |
|
478 | - * @return null |
|
479 | - */ |
|
480 | - public function updateQuota($valueFromLDAP = null) { |
|
481 | - if ($this->wasRefreshed('quota')) { |
|
482 | - return; |
|
483 | - } |
|
484 | - |
|
485 | - $quotaAttribute = $this->connection->ldapQuotaAttribute; |
|
486 | - $defaultQuota = $this->connection->ldapQuotaDefault; |
|
487 | - if ($quotaAttribute === '' && $defaultQuota === '') { |
|
488 | - return; |
|
489 | - } |
|
490 | - |
|
491 | - $quota = false; |
|
492 | - if (is_null($valueFromLDAP) && $quotaAttribute !== '') { |
|
493 | - $aQuota = $this->access->readAttribute($this->dn, $quotaAttribute); |
|
494 | - if ($aQuota && (count($aQuota) > 0) && $this->verifyQuotaValue($aQuota[0])) { |
|
495 | - $quota = $aQuota[0]; |
|
496 | - } elseif (is_array($aQuota) && isset($aQuota[0])) { |
|
497 | - $this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', ILogger::DEBUG); |
|
498 | - } |
|
499 | - } elseif ($this->verifyQuotaValue($valueFromLDAP)) { |
|
500 | - $quota = $valueFromLDAP; |
|
501 | - } else { |
|
502 | - $this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', ILogger::DEBUG); |
|
503 | - } |
|
504 | - |
|
505 | - if ($quota === false && $this->verifyQuotaValue($defaultQuota)) { |
|
506 | - // quota not found using the LDAP attribute (or not parseable). Try the default quota |
|
507 | - $quota = $defaultQuota; |
|
508 | - } elseif ($quota === false) { |
|
509 | - $this->log->log('no suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', ILogger::DEBUG); |
|
510 | - return; |
|
511 | - } |
|
512 | - |
|
513 | - $targetUser = $this->userManager->get($this->uid); |
|
514 | - if ($targetUser instanceof IUser) { |
|
515 | - $targetUser->setQuota($quota); |
|
516 | - } else { |
|
517 | - $this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', ILogger::INFO); |
|
518 | - } |
|
519 | - } |
|
520 | - |
|
521 | - private function verifyQuotaValue($quotaValue) { |
|
522 | - return $quotaValue === 'none' || $quotaValue === 'default' || \OC_Helper::computerFileSize($quotaValue) !== false; |
|
523 | - } |
|
524 | - |
|
525 | - /** |
|
526 | - * called by a post_login hook to save the avatar picture |
|
527 | - * |
|
528 | - * @param array $params |
|
529 | - */ |
|
530 | - public function updateAvatarPostLogin($params) { |
|
531 | - if (isset($params['uid']) && $params['uid'] === $this->getUsername()) { |
|
532 | - $this->updateAvatar(); |
|
533 | - } |
|
534 | - } |
|
535 | - |
|
536 | - /** |
|
537 | - * @brief attempts to get an image from LDAP and sets it as Nextcloud avatar |
|
538 | - * @return bool |
|
539 | - */ |
|
540 | - public function updateAvatar($force = false) { |
|
541 | - if (!$force && $this->wasRefreshed('avatar')) { |
|
542 | - return false; |
|
543 | - } |
|
544 | - $avatarImage = $this->getAvatarImage(); |
|
545 | - if ($avatarImage === false) { |
|
546 | - //not set, nothing left to do; |
|
547 | - return false; |
|
548 | - } |
|
549 | - |
|
550 | - if (!$this->image->loadFromBase64(base64_encode($avatarImage))) { |
|
551 | - return false; |
|
552 | - } |
|
553 | - |
|
554 | - // use the checksum before modifications |
|
555 | - $checksum = md5($this->image->data()); |
|
556 | - |
|
557 | - if ($checksum === $this->config->getUserValue($this->uid, 'user_ldap', 'lastAvatarChecksum', '')) { |
|
558 | - return true; |
|
559 | - } |
|
560 | - |
|
561 | - $isSet = $this->setOwnCloudAvatar(); |
|
562 | - |
|
563 | - if ($isSet) { |
|
564 | - // save checksum only after successful setting |
|
565 | - $this->config->setUserValue($this->uid, 'user_ldap', 'lastAvatarChecksum', $checksum); |
|
566 | - } |
|
567 | - |
|
568 | - return $isSet; |
|
569 | - } |
|
570 | - |
|
571 | - /** |
|
572 | - * @brief sets an image as Nextcloud avatar |
|
573 | - * @return bool |
|
574 | - */ |
|
575 | - private function setOwnCloudAvatar() { |
|
576 | - if (!$this->image->valid()) { |
|
577 | - $this->log->log('avatar image data from LDAP invalid for '.$this->dn, ILogger::ERROR); |
|
578 | - return false; |
|
579 | - } |
|
580 | - |
|
581 | - |
|
582 | - //make sure it is a square and not bigger than 128x128 |
|
583 | - $size = min([$this->image->width(), $this->image->height(), 128]); |
|
584 | - if (!$this->image->centerCrop($size)) { |
|
585 | - $this->log->log('croping image for avatar failed for '.$this->dn, ILogger::ERROR); |
|
586 | - return false; |
|
587 | - } |
|
588 | - |
|
589 | - if (!$this->fs->isLoaded()) { |
|
590 | - $this->fs->setup($this->uid); |
|
591 | - } |
|
592 | - |
|
593 | - try { |
|
594 | - $avatar = $this->avatarManager->getAvatar($this->uid); |
|
595 | - $avatar->set($this->image); |
|
596 | - return true; |
|
597 | - } catch (\Exception $e) { |
|
598 | - \OC::$server->getLogger()->logException($e, [ |
|
599 | - 'message' => 'Could not set avatar for ' . $this->dn, |
|
600 | - 'level' => ILogger::INFO, |
|
601 | - 'app' => 'user_ldap', |
|
602 | - ]); |
|
603 | - } |
|
604 | - return false; |
|
605 | - } |
|
606 | - |
|
607 | - /** |
|
608 | - * @throws AttributeNotSet |
|
609 | - * @throws \OC\ServerNotAvailableException |
|
610 | - * @throws \OCP\PreConditionNotMetException |
|
611 | - */ |
|
612 | - public function getExtStorageHome():string { |
|
613 | - $value = $this->config->getUserValue($this->getUsername(), 'user_ldap', 'extStorageHome', ''); |
|
614 | - if ($value !== '') { |
|
615 | - return $value; |
|
616 | - } |
|
617 | - |
|
618 | - $value = $this->updateExtStorageHome(); |
|
619 | - if ($value !== '') { |
|
620 | - return $value; |
|
621 | - } |
|
622 | - |
|
623 | - throw new AttributeNotSet(sprintf( |
|
624 | - 'external home storage attribute yield no value for %s', $this->getUsername() |
|
625 | - )); |
|
626 | - } |
|
627 | - |
|
628 | - /** |
|
629 | - * @throws \OCP\PreConditionNotMetException |
|
630 | - * @throws \OC\ServerNotAvailableException |
|
631 | - */ |
|
632 | - public function updateExtStorageHome(string $valueFromLDAP = null):string { |
|
633 | - if ($valueFromLDAP === null) { |
|
634 | - $extHomeValues = $this->access->readAttribute($this->getDN(), $this->connection->ldapExtStorageHomeAttribute); |
|
635 | - } else { |
|
636 | - $extHomeValues = [$valueFromLDAP]; |
|
637 | - } |
|
638 | - if ($extHomeValues && isset($extHomeValues[0])) { |
|
639 | - $extHome = $extHomeValues[0]; |
|
640 | - $this->config->setUserValue($this->getUsername(), 'user_ldap', 'extStorageHome', $extHome); |
|
641 | - return $extHome; |
|
642 | - } else { |
|
643 | - $this->config->deleteUserValue($this->getUsername(), 'user_ldap', 'extStorageHome'); |
|
644 | - return ''; |
|
645 | - } |
|
646 | - } |
|
647 | - |
|
648 | - /** |
|
649 | - * called by a post_login hook to handle password expiry |
|
650 | - * |
|
651 | - * @param array $params |
|
652 | - */ |
|
653 | - public function handlePasswordExpiry($params) { |
|
654 | - $ppolicyDN = $this->connection->ldapDefaultPPolicyDN; |
|
655 | - if (empty($ppolicyDN) || ((int)$this->connection->turnOnPasswordChange !== 1)) { |
|
656 | - return;//password expiry handling disabled |
|
657 | - } |
|
658 | - $uid = $params['uid']; |
|
659 | - if (isset($uid) && $uid === $this->getUsername()) { |
|
660 | - //retrieve relevant user attributes |
|
661 | - $result = $this->access->search('objectclass=*', $this->dn, ['pwdpolicysubentry', 'pwdgraceusetime', 'pwdreset', 'pwdchangedtime']); |
|
662 | - |
|
663 | - if (array_key_exists('pwdpolicysubentry', $result[0])) { |
|
664 | - $pwdPolicySubentry = $result[0]['pwdpolicysubentry']; |
|
665 | - if ($pwdPolicySubentry && (count($pwdPolicySubentry) > 0)) { |
|
666 | - $ppolicyDN = $pwdPolicySubentry[0];//custom ppolicy DN |
|
667 | - } |
|
668 | - } |
|
669 | - |
|
670 | - $pwdGraceUseTime = array_key_exists('pwdgraceusetime', $result[0]) ? $result[0]['pwdgraceusetime'] : []; |
|
671 | - $pwdReset = array_key_exists('pwdreset', $result[0]) ? $result[0]['pwdreset'] : []; |
|
672 | - $pwdChangedTime = array_key_exists('pwdchangedtime', $result[0]) ? $result[0]['pwdchangedtime'] : []; |
|
673 | - |
|
674 | - //retrieve relevant password policy attributes |
|
675 | - $cacheKey = 'ppolicyAttributes' . $ppolicyDN; |
|
676 | - $result = $this->connection->getFromCache($cacheKey); |
|
677 | - if (is_null($result)) { |
|
678 | - $result = $this->access->search('objectclass=*', $ppolicyDN, ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']); |
|
679 | - $this->connection->writeToCache($cacheKey, $result); |
|
680 | - } |
|
681 | - |
|
682 | - $pwdGraceAuthNLimit = array_key_exists('pwdgraceauthnlimit', $result[0]) ? $result[0]['pwdgraceauthnlimit'] : []; |
|
683 | - $pwdMaxAge = array_key_exists('pwdmaxage', $result[0]) ? $result[0]['pwdmaxage'] : []; |
|
684 | - $pwdExpireWarning = array_key_exists('pwdexpirewarning', $result[0]) ? $result[0]['pwdexpirewarning'] : []; |
|
685 | - |
|
686 | - //handle grace login |
|
687 | - if (!empty($pwdGraceUseTime)) { //was this a grace login? |
|
688 | - if (!empty($pwdGraceAuthNLimit) |
|
689 | - && count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available? |
|
690 | - $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); |
|
691 | - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
|
692 | - 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); |
|
693 | - } else { //no more grace login available |
|
694 | - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
|
695 | - 'user_ldap.renewPassword.showLoginFormInvalidPassword', ['user' => $uid])); |
|
696 | - } |
|
697 | - exit(); |
|
698 | - } |
|
699 | - //handle pwdReset attribute |
|
700 | - if (!empty($pwdReset) && $pwdReset[0] === 'TRUE') { //user must change his password |
|
701 | - $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); |
|
702 | - header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
|
703 | - 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); |
|
704 | - exit(); |
|
705 | - } |
|
706 | - //handle password expiry warning |
|
707 | - if (!empty($pwdChangedTime)) { |
|
708 | - if (!empty($pwdMaxAge) |
|
709 | - && !empty($pwdExpireWarning)) { |
|
710 | - $pwdMaxAgeInt = (int)$pwdMaxAge[0]; |
|
711 | - $pwdExpireWarningInt = (int)$pwdExpireWarning[0]; |
|
712 | - if ($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0) { |
|
713 | - $pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]); |
|
714 | - $pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S')); |
|
715 | - $currentDateTime = new \DateTime(); |
|
716 | - $secondsToExpiry = $pwdChangedTimeDt->getTimestamp() - $currentDateTime->getTimestamp(); |
|
717 | - if ($secondsToExpiry <= $pwdExpireWarningInt) { |
|
718 | - //remove last password expiry warning if any |
|
719 | - $notification = $this->notificationManager->createNotification(); |
|
720 | - $notification->setApp('user_ldap') |
|
721 | - ->setUser($uid) |
|
722 | - ->setObject('pwd_exp_warn', $uid) |
|
723 | - ; |
|
724 | - $this->notificationManager->markProcessed($notification); |
|
725 | - //create new password expiry warning |
|
726 | - $notification = $this->notificationManager->createNotification(); |
|
727 | - $notification->setApp('user_ldap') |
|
728 | - ->setUser($uid) |
|
729 | - ->setDateTime($currentDateTime) |
|
730 | - ->setObject('pwd_exp_warn', $uid) |
|
731 | - ->setSubject('pwd_exp_warn_days', [(int) ceil($secondsToExpiry / 60 / 60 / 24)]) |
|
732 | - ; |
|
733 | - $this->notificationManager->notify($notification); |
|
734 | - } |
|
735 | - } |
|
736 | - } |
|
737 | - } |
|
738 | - } |
|
739 | - } |
|
54 | + /** |
|
55 | + * @var Access |
|
56 | + */ |
|
57 | + protected $access; |
|
58 | + /** |
|
59 | + * @var Connection |
|
60 | + */ |
|
61 | + protected $connection; |
|
62 | + /** |
|
63 | + * @var IConfig |
|
64 | + */ |
|
65 | + protected $config; |
|
66 | + /** |
|
67 | + * @var FilesystemHelper |
|
68 | + */ |
|
69 | + protected $fs; |
|
70 | + /** |
|
71 | + * @var Image |
|
72 | + */ |
|
73 | + protected $image; |
|
74 | + /** |
|
75 | + * @var LogWrapper |
|
76 | + */ |
|
77 | + protected $log; |
|
78 | + /** |
|
79 | + * @var IAvatarManager |
|
80 | + */ |
|
81 | + protected $avatarManager; |
|
82 | + /** |
|
83 | + * @var IUserManager |
|
84 | + */ |
|
85 | + protected $userManager; |
|
86 | + /** |
|
87 | + * @var INotificationManager |
|
88 | + */ |
|
89 | + protected $notificationManager; |
|
90 | + /** |
|
91 | + * @var string |
|
92 | + */ |
|
93 | + protected $dn; |
|
94 | + /** |
|
95 | + * @var string |
|
96 | + */ |
|
97 | + protected $uid; |
|
98 | + /** |
|
99 | + * @var string[] |
|
100 | + */ |
|
101 | + protected $refreshedFeatures = []; |
|
102 | + /** |
|
103 | + * @var string |
|
104 | + */ |
|
105 | + protected $avatarImage; |
|
106 | + |
|
107 | + /** |
|
108 | + * DB config keys for user preferences |
|
109 | + */ |
|
110 | + public const USER_PREFKEY_FIRSTLOGIN = 'firstLoginAccomplished'; |
|
111 | + |
|
112 | + /** |
|
113 | + * @brief constructor, make sure the subclasses call this one! |
|
114 | + * @param string $username the internal username |
|
115 | + * @param string $dn the LDAP DN |
|
116 | + * @param Access $access |
|
117 | + * @param IConfig $config |
|
118 | + * @param FilesystemHelper $fs |
|
119 | + * @param Image $image any empty instance |
|
120 | + * @param LogWrapper $log |
|
121 | + * @param IAvatarManager $avatarManager |
|
122 | + * @param IUserManager $userManager |
|
123 | + * @param INotificationManager $notificationManager |
|
124 | + */ |
|
125 | + public function __construct($username, $dn, Access $access, |
|
126 | + IConfig $config, FilesystemHelper $fs, Image $image, |
|
127 | + LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager, |
|
128 | + INotificationManager $notificationManager) { |
|
129 | + if ($username === null) { |
|
130 | + $log->log("uid for '$dn' must not be null!", ILogger::ERROR); |
|
131 | + throw new \InvalidArgumentException('uid must not be null!'); |
|
132 | + } elseif ($username === '') { |
|
133 | + $log->log("uid for '$dn' must not be an empty string", ILogger::ERROR); |
|
134 | + throw new \InvalidArgumentException('uid must not be an empty string!'); |
|
135 | + } |
|
136 | + |
|
137 | + $this->access = $access; |
|
138 | + $this->connection = $access->getConnection(); |
|
139 | + $this->config = $config; |
|
140 | + $this->fs = $fs; |
|
141 | + $this->dn = $dn; |
|
142 | + $this->uid = $username; |
|
143 | + $this->image = $image; |
|
144 | + $this->log = $log; |
|
145 | + $this->avatarManager = $avatarManager; |
|
146 | + $this->userManager = $userManager; |
|
147 | + $this->notificationManager = $notificationManager; |
|
148 | + |
|
149 | + \OCP\Util::connectHook('OC_User', 'post_login', $this, 'handlePasswordExpiry'); |
|
150 | + } |
|
151 | + |
|
152 | + /** |
|
153 | + * marks a user as deleted |
|
154 | + * |
|
155 | + * @throws \OCP\PreConditionNotMetException |
|
156 | + */ |
|
157 | + public function markUser() { |
|
158 | + $curValue = $this->config->getUserValue($this->getUsername(), 'user_ldap', 'isDeleted', '0'); |
|
159 | + if ($curValue === '1') { |
|
160 | + // the user is already marked, do not write to DB again |
|
161 | + return; |
|
162 | + } |
|
163 | + $this->config->setUserValue($this->getUsername(), 'user_ldap', 'isDeleted', '1'); |
|
164 | + $this->config->setUserValue($this->getUsername(), 'user_ldap', 'foundDeleted', (string)time()); |
|
165 | + } |
|
166 | + |
|
167 | + /** |
|
168 | + * processes results from LDAP for attributes as returned by getAttributesToRead() |
|
169 | + * @param array $ldapEntry the user entry as retrieved from LDAP |
|
170 | + */ |
|
171 | + public function processAttributes($ldapEntry) { |
|
172 | + //Quota |
|
173 | + $attr = strtolower($this->connection->ldapQuotaAttribute); |
|
174 | + if (isset($ldapEntry[$attr])) { |
|
175 | + $this->updateQuota($ldapEntry[$attr][0]); |
|
176 | + } else { |
|
177 | + if ($this->connection->ldapQuotaDefault !== '') { |
|
178 | + $this->updateQuota(); |
|
179 | + } |
|
180 | + } |
|
181 | + unset($attr); |
|
182 | + |
|
183 | + //displayName |
|
184 | + $displayName = $displayName2 = ''; |
|
185 | + $attr = strtolower($this->connection->ldapUserDisplayName); |
|
186 | + if (isset($ldapEntry[$attr])) { |
|
187 | + $displayName = (string)$ldapEntry[$attr][0]; |
|
188 | + } |
|
189 | + $attr = strtolower($this->connection->ldapUserDisplayName2); |
|
190 | + if (isset($ldapEntry[$attr])) { |
|
191 | + $displayName2 = (string)$ldapEntry[$attr][0]; |
|
192 | + } |
|
193 | + if ($displayName !== '') { |
|
194 | + $this->composeAndStoreDisplayName($displayName, $displayName2); |
|
195 | + $this->access->cacheUserDisplayName( |
|
196 | + $this->getUsername(), |
|
197 | + $displayName, |
|
198 | + $displayName2 |
|
199 | + ); |
|
200 | + } |
|
201 | + unset($attr); |
|
202 | + |
|
203 | ||
204 | + //email must be stored after displayname, because it would cause a user |
|
205 | + //change event that will trigger fetching the display name again |
|
206 | + $attr = strtolower($this->connection->ldapEmailAttribute); |
|
207 | + if (isset($ldapEntry[$attr])) { |
|
208 | + $this->updateEmail($ldapEntry[$attr][0]); |
|
209 | + } |
|
210 | + unset($attr); |
|
211 | + |
|
212 | + // LDAP Username, needed for s2s sharing |
|
213 | + if (isset($ldapEntry['uid'])) { |
|
214 | + $this->storeLDAPUserName($ldapEntry['uid'][0]); |
|
215 | + } elseif (isset($ldapEntry['samaccountname'])) { |
|
216 | + $this->storeLDAPUserName($ldapEntry['samaccountname'][0]); |
|
217 | + } |
|
218 | + |
|
219 | + //homePath |
|
220 | + if (strpos($this->connection->homeFolderNamingRule, 'attr:') === 0) { |
|
221 | + $attr = strtolower(substr($this->connection->homeFolderNamingRule, strlen('attr:'))); |
|
222 | + if (isset($ldapEntry[$attr])) { |
|
223 | + $this->access->cacheUserHome( |
|
224 | + $this->getUsername(), $this->getHomePath($ldapEntry[$attr][0])); |
|
225 | + } |
|
226 | + } |
|
227 | + |
|
228 | + //memberOf groups |
|
229 | + $cacheKey = 'getMemberOf'.$this->getUsername(); |
|
230 | + $groups = false; |
|
231 | + if (isset($ldapEntry['memberof'])) { |
|
232 | + $groups = $ldapEntry['memberof']; |
|
233 | + } |
|
234 | + $this->connection->writeToCache($cacheKey, $groups); |
|
235 | + |
|
236 | + //external storage var |
|
237 | + $attr = strtolower($this->connection->ldapExtStorageHomeAttribute); |
|
238 | + if (isset($ldapEntry[$attr])) { |
|
239 | + $this->updateExtStorageHome($ldapEntry[$attr][0]); |
|
240 | + } |
|
241 | + unset($attr); |
|
242 | + |
|
243 | + //Avatar |
|
244 | + /** @var Connection $connection */ |
|
245 | + $connection = $this->access->getConnection(); |
|
246 | + $attributes = $connection->resolveRule('avatar'); |
|
247 | + foreach ($attributes as $attribute) { |
|
248 | + if (isset($ldapEntry[$attribute])) { |
|
249 | + $this->avatarImage = $ldapEntry[$attribute][0]; |
|
250 | + // the call to the method that saves the avatar in the file |
|
251 | + // system must be postponed after the login. It is to ensure |
|
252 | + // external mounts are mounted properly (e.g. with login |
|
253 | + // credentials from the session). |
|
254 | + \OCP\Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin'); |
|
255 | + break; |
|
256 | + } |
|
257 | + } |
|
258 | + } |
|
259 | + |
|
260 | + /** |
|
261 | + * @brief returns the LDAP DN of the user |
|
262 | + * @return string |
|
263 | + */ |
|
264 | + public function getDN() { |
|
265 | + return $this->dn; |
|
266 | + } |
|
267 | + |
|
268 | + /** |
|
269 | + * @brief returns the Nextcloud internal username of the user |
|
270 | + * @return string |
|
271 | + */ |
|
272 | + public function getUsername() { |
|
273 | + return $this->uid; |
|
274 | + } |
|
275 | + |
|
276 | + /** |
|
277 | + * returns the home directory of the user if specified by LDAP settings |
|
278 | + * @param string $valueFromLDAP |
|
279 | + * @return bool|string |
|
280 | + * @throws \Exception |
|
281 | + */ |
|
282 | + public function getHomePath($valueFromLDAP = null) { |
|
283 | + $path = (string)$valueFromLDAP; |
|
284 | + $attr = null; |
|
285 | + |
|
286 | + if (is_null($valueFromLDAP) |
|
287 | + && strpos($this->access->connection->homeFolderNamingRule, 'attr:') === 0 |
|
288 | + && $this->access->connection->homeFolderNamingRule !== 'attr:') { |
|
289 | + $attr = substr($this->access->connection->homeFolderNamingRule, strlen('attr:')); |
|
290 | + $homedir = $this->access->readAttribute( |
|
291 | + $this->access->username2dn($this->getUsername()), $attr); |
|
292 | + if ($homedir && isset($homedir[0])) { |
|
293 | + $path = $homedir[0]; |
|
294 | + } |
|
295 | + } |
|
296 | + |
|
297 | + if ($path !== '') { |
|
298 | + //if attribute's value is an absolute path take this, otherwise append it to data dir |
|
299 | + //check for / at the beginning or pattern c:\ resp. c:/ |
|
300 | + if ('/' !== $path[0] |
|
301 | + && !(3 < strlen($path) && ctype_alpha($path[0]) |
|
302 | + && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) |
|
303 | + ) { |
|
304 | + $path = $this->config->getSystemValue('datadirectory', |
|
305 | + \OC::$SERVERROOT.'/data') . '/' . $path; |
|
306 | + } |
|
307 | + //we need it to store it in the DB as well in case a user gets |
|
308 | + //deleted so we can clean up afterwards |
|
309 | + $this->config->setUserValue( |
|
310 | + $this->getUsername(), 'user_ldap', 'homePath', $path |
|
311 | + ); |
|
312 | + return $path; |
|
313 | + } |
|
314 | + |
|
315 | + if (!is_null($attr) |
|
316 | + && $this->config->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true) |
|
317 | + ) { |
|
318 | + // a naming rule attribute is defined, but it doesn't exist for that LDAP user |
|
319 | + throw new \Exception('Home dir attribute can\'t be read from LDAP for uid: ' . $this->getUsername()); |
|
320 | + } |
|
321 | + |
|
322 | + //false will apply default behaviour as defined and done by OC_User |
|
323 | + $this->config->setUserValue($this->getUsername(), 'user_ldap', 'homePath', ''); |
|
324 | + return false; |
|
325 | + } |
|
326 | + |
|
327 | + public function getMemberOfGroups() { |
|
328 | + $cacheKey = 'getMemberOf'.$this->getUsername(); |
|
329 | + $memberOfGroups = $this->connection->getFromCache($cacheKey); |
|
330 | + if (!is_null($memberOfGroups)) { |
|
331 | + return $memberOfGroups; |
|
332 | + } |
|
333 | + $groupDNs = $this->access->readAttribute($this->getDN(), 'memberOf'); |
|
334 | + $this->connection->writeToCache($cacheKey, $groupDNs); |
|
335 | + return $groupDNs; |
|
336 | + } |
|
337 | + |
|
338 | + /** |
|
339 | + * @brief reads the image from LDAP that shall be used as Avatar |
|
340 | + * @return string data (provided by LDAP) | false |
|
341 | + */ |
|
342 | + public function getAvatarImage() { |
|
343 | + if (!is_null($this->avatarImage)) { |
|
344 | + return $this->avatarImage; |
|
345 | + } |
|
346 | + |
|
347 | + $this->avatarImage = false; |
|
348 | + /** @var Connection $connection */ |
|
349 | + $connection = $this->access->getConnection(); |
|
350 | + $attributes = $connection->resolveRule('avatar'); |
|
351 | + foreach ($attributes as $attribute) { |
|
352 | + $result = $this->access->readAttribute($this->dn, $attribute); |
|
353 | + if ($result !== false && is_array($result) && isset($result[0])) { |
|
354 | + $this->avatarImage = $result[0]; |
|
355 | + break; |
|
356 | + } |
|
357 | + } |
|
358 | + |
|
359 | + return $this->avatarImage; |
|
360 | + } |
|
361 | + |
|
362 | + /** |
|
363 | + * @brief marks the user as having logged in at least once |
|
364 | + * @return null |
|
365 | + */ |
|
366 | + public function markLogin() { |
|
367 | + $this->config->setUserValue( |
|
368 | + $this->uid, 'user_ldap', self::USER_PREFKEY_FIRSTLOGIN, 1); |
|
369 | + } |
|
370 | + |
|
371 | + /** |
|
372 | + * Stores a key-value pair in relation to this user |
|
373 | + * |
|
374 | + * @param string $key |
|
375 | + * @param string $value |
|
376 | + */ |
|
377 | + private function store($key, $value) { |
|
378 | + $this->config->setUserValue($this->uid, 'user_ldap', $key, $value); |
|
379 | + } |
|
380 | + |
|
381 | + /** |
|
382 | + * Composes the display name and stores it in the database. The final |
|
383 | + * display name is returned. |
|
384 | + * |
|
385 | + * @param string $displayName |
|
386 | + * @param string $displayName2 |
|
387 | + * @return string the effective display name |
|
388 | + */ |
|
389 | + public function composeAndStoreDisplayName($displayName, $displayName2 = '') { |
|
390 | + $displayName2 = (string)$displayName2; |
|
391 | + if ($displayName2 !== '') { |
|
392 | + $displayName .= ' (' . $displayName2 . ')'; |
|
393 | + } |
|
394 | + $oldName = $this->config->getUserValue($this->uid, 'user_ldap', 'displayName', null); |
|
395 | + if ($oldName !== $displayName) { |
|
396 | + $this->store('displayName', $displayName); |
|
397 | + $user = $this->userManager->get($this->getUsername()); |
|
398 | + if (!empty($oldName) && $user instanceof \OC\User\User) { |
|
399 | + // if it was empty, it would be a new record, not a change emitting the trigger could |
|
400 | + // potentially cause a UniqueConstraintViolationException, depending on some factors. |
|
401 | + $user->triggerChange('displayName', $displayName, $oldName); |
|
402 | + } |
|
403 | + } |
|
404 | + return $displayName; |
|
405 | + } |
|
406 | + |
|
407 | + /** |
|
408 | + * Stores the LDAP Username in the Database |
|
409 | + * @param string $userName |
|
410 | + */ |
|
411 | + public function storeLDAPUserName($userName) { |
|
412 | + $this->store('uid', $userName); |
|
413 | + } |
|
414 | + |
|
415 | + /** |
|
416 | + * @brief checks whether an update method specified by feature was run |
|
417 | + * already. If not, it will marked like this, because it is expected that |
|
418 | + * the method will be run, when false is returned. |
|
419 | + * @param string $feature email | quota | avatar (can be extended) |
|
420 | + * @return bool |
|
421 | + */ |
|
422 | + private function wasRefreshed($feature) { |
|
423 | + if (isset($this->refreshedFeatures[$feature])) { |
|
424 | + return true; |
|
425 | + } |
|
426 | + $this->refreshedFeatures[$feature] = 1; |
|
427 | + return false; |
|
428 | + } |
|
429 | + |
|
430 | + /** |
|
431 | + * fetches the email from LDAP and stores it as Nextcloud user value |
|
432 | + * @param string $valueFromLDAP if known, to save an LDAP read request |
|
433 | + * @return null |
|
434 | + */ |
|
435 | + public function updateEmail($valueFromLDAP = null) { |
|
436 | + if ($this->wasRefreshed('email')) { |
|
437 | + return; |
|
438 | + } |
|
439 | + $email = (string)$valueFromLDAP; |
|
440 | + if (is_null($valueFromLDAP)) { |
|
441 | + $emailAttribute = $this->connection->ldapEmailAttribute; |
|
442 | + if ($emailAttribute !== '') { |
|
443 | + $aEmail = $this->access->readAttribute($this->dn, $emailAttribute); |
|
444 | + if (is_array($aEmail) && (count($aEmail) > 0)) { |
|
445 | + $email = (string)$aEmail[0]; |
|
446 | + } |
|
447 | + } |
|
448 | + } |
|
449 | + if ($email !== '') { |
|
450 | + $user = $this->userManager->get($this->uid); |
|
451 | + if (!is_null($user)) { |
|
452 | + $currentEmail = (string)$user->getEMailAddress(); |
|
453 | + if ($currentEmail !== $email) { |
|
454 | + $user->setEMailAddress($email); |
|
455 | + } |
|
456 | + } |
|
457 | + } |
|
458 | + } |
|
459 | + |
|
460 | + /** |
|
461 | + * Overall process goes as follow: |
|
462 | + * 1. fetch the quota from LDAP and check if it's parseable with the "verifyQuotaValue" function |
|
463 | + * 2. if the value can't be fetched, is empty or not parseable, use the default LDAP quota |
|
464 | + * 3. if the default LDAP quota can't be parsed, use the Nextcloud's default quota (use 'default') |
|
465 | + * 4. check if the target user exists and set the quota for the user. |
|
466 | + * |
|
467 | + * In order to improve performance and prevent an unwanted extra LDAP call, the $valueFromLDAP |
|
468 | + * parameter can be passed with the value of the attribute. This value will be considered as the |
|
469 | + * quota for the user coming from the LDAP server (step 1 of the process) It can be useful to |
|
470 | + * fetch all the user's attributes in one call and use the fetched values in this function. |
|
471 | + * The expected value for that parameter is a string describing the quota for the user. Valid |
|
472 | + * values are 'none' (unlimited), 'default' (the Nextcloud's default quota), '1234' (quota in |
|
473 | + * bytes), '1234 MB' (quota in MB - check the \OC_Helper::computerFileSize method for more info) |
|
474 | + * |
|
475 | + * fetches the quota from LDAP and stores it as Nextcloud user value |
|
476 | + * @param string $valueFromLDAP the quota attribute's value can be passed, |
|
477 | + * to save the readAttribute request |
|
478 | + * @return null |
|
479 | + */ |
|
480 | + public function updateQuota($valueFromLDAP = null) { |
|
481 | + if ($this->wasRefreshed('quota')) { |
|
482 | + return; |
|
483 | + } |
|
484 | + |
|
485 | + $quotaAttribute = $this->connection->ldapQuotaAttribute; |
|
486 | + $defaultQuota = $this->connection->ldapQuotaDefault; |
|
487 | + if ($quotaAttribute === '' && $defaultQuota === '') { |
|
488 | + return; |
|
489 | + } |
|
490 | + |
|
491 | + $quota = false; |
|
492 | + if (is_null($valueFromLDAP) && $quotaAttribute !== '') { |
|
493 | + $aQuota = $this->access->readAttribute($this->dn, $quotaAttribute); |
|
494 | + if ($aQuota && (count($aQuota) > 0) && $this->verifyQuotaValue($aQuota[0])) { |
|
495 | + $quota = $aQuota[0]; |
|
496 | + } elseif (is_array($aQuota) && isset($aQuota[0])) { |
|
497 | + $this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', ILogger::DEBUG); |
|
498 | + } |
|
499 | + } elseif ($this->verifyQuotaValue($valueFromLDAP)) { |
|
500 | + $quota = $valueFromLDAP; |
|
501 | + } else { |
|
502 | + $this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', ILogger::DEBUG); |
|
503 | + } |
|
504 | + |
|
505 | + if ($quota === false && $this->verifyQuotaValue($defaultQuota)) { |
|
506 | + // quota not found using the LDAP attribute (or not parseable). Try the default quota |
|
507 | + $quota = $defaultQuota; |
|
508 | + } elseif ($quota === false) { |
|
509 | + $this->log->log('no suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', ILogger::DEBUG); |
|
510 | + return; |
|
511 | + } |
|
512 | + |
|
513 | + $targetUser = $this->userManager->get($this->uid); |
|
514 | + if ($targetUser instanceof IUser) { |
|
515 | + $targetUser->setQuota($quota); |
|
516 | + } else { |
|
517 | + $this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', ILogger::INFO); |
|
518 | + } |
|
519 | + } |
|
520 | + |
|
521 | + private function verifyQuotaValue($quotaValue) { |
|
522 | + return $quotaValue === 'none' || $quotaValue === 'default' || \OC_Helper::computerFileSize($quotaValue) !== false; |
|
523 | + } |
|
524 | + |
|
525 | + /** |
|
526 | + * called by a post_login hook to save the avatar picture |
|
527 | + * |
|
528 | + * @param array $params |
|
529 | + */ |
|
530 | + public function updateAvatarPostLogin($params) { |
|
531 | + if (isset($params['uid']) && $params['uid'] === $this->getUsername()) { |
|
532 | + $this->updateAvatar(); |
|
533 | + } |
|
534 | + } |
|
535 | + |
|
536 | + /** |
|
537 | + * @brief attempts to get an image from LDAP and sets it as Nextcloud avatar |
|
538 | + * @return bool |
|
539 | + */ |
|
540 | + public function updateAvatar($force = false) { |
|
541 | + if (!$force && $this->wasRefreshed('avatar')) { |
|
542 | + return false; |
|
543 | + } |
|
544 | + $avatarImage = $this->getAvatarImage(); |
|
545 | + if ($avatarImage === false) { |
|
546 | + //not set, nothing left to do; |
|
547 | + return false; |
|
548 | + } |
|
549 | + |
|
550 | + if (!$this->image->loadFromBase64(base64_encode($avatarImage))) { |
|
551 | + return false; |
|
552 | + } |
|
553 | + |
|
554 | + // use the checksum before modifications |
|
555 | + $checksum = md5($this->image->data()); |
|
556 | + |
|
557 | + if ($checksum === $this->config->getUserValue($this->uid, 'user_ldap', 'lastAvatarChecksum', '')) { |
|
558 | + return true; |
|
559 | + } |
|
560 | + |
|
561 | + $isSet = $this->setOwnCloudAvatar(); |
|
562 | + |
|
563 | + if ($isSet) { |
|
564 | + // save checksum only after successful setting |
|
565 | + $this->config->setUserValue($this->uid, 'user_ldap', 'lastAvatarChecksum', $checksum); |
|
566 | + } |
|
567 | + |
|
568 | + return $isSet; |
|
569 | + } |
|
570 | + |
|
571 | + /** |
|
572 | + * @brief sets an image as Nextcloud avatar |
|
573 | + * @return bool |
|
574 | + */ |
|
575 | + private function setOwnCloudAvatar() { |
|
576 | + if (!$this->image->valid()) { |
|
577 | + $this->log->log('avatar image data from LDAP invalid for '.$this->dn, ILogger::ERROR); |
|
578 | + return false; |
|
579 | + } |
|
580 | + |
|
581 | + |
|
582 | + //make sure it is a square and not bigger than 128x128 |
|
583 | + $size = min([$this->image->width(), $this->image->height(), 128]); |
|
584 | + if (!$this->image->centerCrop($size)) { |
|
585 | + $this->log->log('croping image for avatar failed for '.$this->dn, ILogger::ERROR); |
|
586 | + return false; |
|
587 | + } |
|
588 | + |
|
589 | + if (!$this->fs->isLoaded()) { |
|
590 | + $this->fs->setup($this->uid); |
|
591 | + } |
|
592 | + |
|
593 | + try { |
|
594 | + $avatar = $this->avatarManager->getAvatar($this->uid); |
|
595 | + $avatar->set($this->image); |
|
596 | + return true; |
|
597 | + } catch (\Exception $e) { |
|
598 | + \OC::$server->getLogger()->logException($e, [ |
|
599 | + 'message' => 'Could not set avatar for ' . $this->dn, |
|
600 | + 'level' => ILogger::INFO, |
|
601 | + 'app' => 'user_ldap', |
|
602 | + ]); |
|
603 | + } |
|
604 | + return false; |
|
605 | + } |
|
606 | + |
|
607 | + /** |
|
608 | + * @throws AttributeNotSet |
|
609 | + * @throws \OC\ServerNotAvailableException |
|
610 | + * @throws \OCP\PreConditionNotMetException |
|
611 | + */ |
|
612 | + public function getExtStorageHome():string { |
|
613 | + $value = $this->config->getUserValue($this->getUsername(), 'user_ldap', 'extStorageHome', ''); |
|
614 | + if ($value !== '') { |
|
615 | + return $value; |
|
616 | + } |
|
617 | + |
|
618 | + $value = $this->updateExtStorageHome(); |
|
619 | + if ($value !== '') { |
|
620 | + return $value; |
|
621 | + } |
|
622 | + |
|
623 | + throw new AttributeNotSet(sprintf( |
|
624 | + 'external home storage attribute yield no value for %s', $this->getUsername() |
|
625 | + )); |
|
626 | + } |
|
627 | + |
|
628 | + /** |
|
629 | + * @throws \OCP\PreConditionNotMetException |
|
630 | + * @throws \OC\ServerNotAvailableException |
|
631 | + */ |
|
632 | + public function updateExtStorageHome(string $valueFromLDAP = null):string { |
|
633 | + if ($valueFromLDAP === null) { |
|
634 | + $extHomeValues = $this->access->readAttribute($this->getDN(), $this->connection->ldapExtStorageHomeAttribute); |
|
635 | + } else { |
|
636 | + $extHomeValues = [$valueFromLDAP]; |
|
637 | + } |
|
638 | + if ($extHomeValues && isset($extHomeValues[0])) { |
|
639 | + $extHome = $extHomeValues[0]; |
|
640 | + $this->config->setUserValue($this->getUsername(), 'user_ldap', 'extStorageHome', $extHome); |
|
641 | + return $extHome; |
|
642 | + } else { |
|
643 | + $this->config->deleteUserValue($this->getUsername(), 'user_ldap', 'extStorageHome'); |
|
644 | + return ''; |
|
645 | + } |
|
646 | + } |
|
647 | + |
|
648 | + /** |
|
649 | + * called by a post_login hook to handle password expiry |
|
650 | + * |
|
651 | + * @param array $params |
|
652 | + */ |
|
653 | + public function handlePasswordExpiry($params) { |
|
654 | + $ppolicyDN = $this->connection->ldapDefaultPPolicyDN; |
|
655 | + if (empty($ppolicyDN) || ((int)$this->connection->turnOnPasswordChange !== 1)) { |
|
656 | + return;//password expiry handling disabled |
|
657 | + } |
|
658 | + $uid = $params['uid']; |
|
659 | + if (isset($uid) && $uid === $this->getUsername()) { |
|
660 | + //retrieve relevant user attributes |
|
661 | + $result = $this->access->search('objectclass=*', $this->dn, ['pwdpolicysubentry', 'pwdgraceusetime', 'pwdreset', 'pwdchangedtime']); |
|
662 | + |
|
663 | + if (array_key_exists('pwdpolicysubentry', $result[0])) { |
|
664 | + $pwdPolicySubentry = $result[0]['pwdpolicysubentry']; |
|
665 | + if ($pwdPolicySubentry && (count($pwdPolicySubentry) > 0)) { |
|
666 | + $ppolicyDN = $pwdPolicySubentry[0];//custom ppolicy DN |
|
667 | + } |
|
668 | + } |
|
669 | + |
|
670 | + $pwdGraceUseTime = array_key_exists('pwdgraceusetime', $result[0]) ? $result[0]['pwdgraceusetime'] : []; |
|
671 | + $pwdReset = array_key_exists('pwdreset', $result[0]) ? $result[0]['pwdreset'] : []; |
|
672 | + $pwdChangedTime = array_key_exists('pwdchangedtime', $result[0]) ? $result[0]['pwdchangedtime'] : []; |
|
673 | + |
|
674 | + //retrieve relevant password policy attributes |
|
675 | + $cacheKey = 'ppolicyAttributes' . $ppolicyDN; |
|
676 | + $result = $this->connection->getFromCache($cacheKey); |
|
677 | + if (is_null($result)) { |
|
678 | + $result = $this->access->search('objectclass=*', $ppolicyDN, ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']); |
|
679 | + $this->connection->writeToCache($cacheKey, $result); |
|
680 | + } |
|
681 | + |
|
682 | + $pwdGraceAuthNLimit = array_key_exists('pwdgraceauthnlimit', $result[0]) ? $result[0]['pwdgraceauthnlimit'] : []; |
|
683 | + $pwdMaxAge = array_key_exists('pwdmaxage', $result[0]) ? $result[0]['pwdmaxage'] : []; |
|
684 | + $pwdExpireWarning = array_key_exists('pwdexpirewarning', $result[0]) ? $result[0]['pwdexpirewarning'] : []; |
|
685 | + |
|
686 | + //handle grace login |
|
687 | + if (!empty($pwdGraceUseTime)) { //was this a grace login? |
|
688 | + if (!empty($pwdGraceAuthNLimit) |
|
689 | + && count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available? |
|
690 | + $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); |
|
691 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
|
692 | + 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); |
|
693 | + } else { //no more grace login available |
|
694 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
|
695 | + 'user_ldap.renewPassword.showLoginFormInvalidPassword', ['user' => $uid])); |
|
696 | + } |
|
697 | + exit(); |
|
698 | + } |
|
699 | + //handle pwdReset attribute |
|
700 | + if (!empty($pwdReset) && $pwdReset[0] === 'TRUE') { //user must change his password |
|
701 | + $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); |
|
702 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
|
703 | + 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); |
|
704 | + exit(); |
|
705 | + } |
|
706 | + //handle password expiry warning |
|
707 | + if (!empty($pwdChangedTime)) { |
|
708 | + if (!empty($pwdMaxAge) |
|
709 | + && !empty($pwdExpireWarning)) { |
|
710 | + $pwdMaxAgeInt = (int)$pwdMaxAge[0]; |
|
711 | + $pwdExpireWarningInt = (int)$pwdExpireWarning[0]; |
|
712 | + if ($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0) { |
|
713 | + $pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]); |
|
714 | + $pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S')); |
|
715 | + $currentDateTime = new \DateTime(); |
|
716 | + $secondsToExpiry = $pwdChangedTimeDt->getTimestamp() - $currentDateTime->getTimestamp(); |
|
717 | + if ($secondsToExpiry <= $pwdExpireWarningInt) { |
|
718 | + //remove last password expiry warning if any |
|
719 | + $notification = $this->notificationManager->createNotification(); |
|
720 | + $notification->setApp('user_ldap') |
|
721 | + ->setUser($uid) |
|
722 | + ->setObject('pwd_exp_warn', $uid) |
|
723 | + ; |
|
724 | + $this->notificationManager->markProcessed($notification); |
|
725 | + //create new password expiry warning |
|
726 | + $notification = $this->notificationManager->createNotification(); |
|
727 | + $notification->setApp('user_ldap') |
|
728 | + ->setUser($uid) |
|
729 | + ->setDateTime($currentDateTime) |
|
730 | + ->setObject('pwd_exp_warn', $uid) |
|
731 | + ->setSubject('pwd_exp_warn_days', [(int) ceil($secondsToExpiry / 60 / 60 / 24)]) |
|
732 | + ; |
|
733 | + $this->notificationManager->notify($notification); |
|
734 | + } |
|
735 | + } |
|
736 | + } |
|
737 | + } |
|
738 | + } |
|
739 | + } |
|
740 | 740 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * DB config keys for user preferences |
109 | 109 | */ |
110 | - public const USER_PREFKEY_FIRSTLOGIN = 'firstLoginAccomplished'; |
|
110 | + public const USER_PREFKEY_FIRSTLOGIN = 'firstLoginAccomplished'; |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * @brief constructor, make sure the subclasses call this one! |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | return; |
162 | 162 | } |
163 | 163 | $this->config->setUserValue($this->getUsername(), 'user_ldap', 'isDeleted', '1'); |
164 | - $this->config->setUserValue($this->getUsername(), 'user_ldap', 'foundDeleted', (string)time()); |
|
164 | + $this->config->setUserValue($this->getUsername(), 'user_ldap', 'foundDeleted', (string) time()); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | $displayName = $displayName2 = ''; |
185 | 185 | $attr = strtolower($this->connection->ldapUserDisplayName); |
186 | 186 | if (isset($ldapEntry[$attr])) { |
187 | - $displayName = (string)$ldapEntry[$attr][0]; |
|
187 | + $displayName = (string) $ldapEntry[$attr][0]; |
|
188 | 188 | } |
189 | 189 | $attr = strtolower($this->connection->ldapUserDisplayName2); |
190 | 190 | if (isset($ldapEntry[$attr])) { |
191 | - $displayName2 = (string)$ldapEntry[$attr][0]; |
|
191 | + $displayName2 = (string) $ldapEntry[$attr][0]; |
|
192 | 192 | } |
193 | 193 | if ($displayName !== '') { |
194 | 194 | $this->composeAndStoreDisplayName($displayName, $displayName2); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @throws \Exception |
281 | 281 | */ |
282 | 282 | public function getHomePath($valueFromLDAP = null) { |
283 | - $path = (string)$valueFromLDAP; |
|
283 | + $path = (string) $valueFromLDAP; |
|
284 | 284 | $attr = null; |
285 | 285 | |
286 | 286 | if (is_null($valueFromLDAP) |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) |
303 | 303 | ) { |
304 | 304 | $path = $this->config->getSystemValue('datadirectory', |
305 | - \OC::$SERVERROOT.'/data') . '/' . $path; |
|
305 | + \OC::$SERVERROOT.'/data').'/'.$path; |
|
306 | 306 | } |
307 | 307 | //we need it to store it in the DB as well in case a user gets |
308 | 308 | //deleted so we can clean up afterwards |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | && $this->config->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true) |
317 | 317 | ) { |
318 | 318 | // a naming rule attribute is defined, but it doesn't exist for that LDAP user |
319 | - throw new \Exception('Home dir attribute can\'t be read from LDAP for uid: ' . $this->getUsername()); |
|
319 | + throw new \Exception('Home dir attribute can\'t be read from LDAP for uid: '.$this->getUsername()); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | //false will apply default behaviour as defined and done by OC_User |
@@ -387,9 +387,9 @@ discard block |
||
387 | 387 | * @return string the effective display name |
388 | 388 | */ |
389 | 389 | public function composeAndStoreDisplayName($displayName, $displayName2 = '') { |
390 | - $displayName2 = (string)$displayName2; |
|
390 | + $displayName2 = (string) $displayName2; |
|
391 | 391 | if ($displayName2 !== '') { |
392 | - $displayName .= ' (' . $displayName2 . ')'; |
|
392 | + $displayName .= ' ('.$displayName2.')'; |
|
393 | 393 | } |
394 | 394 | $oldName = $this->config->getUserValue($this->uid, 'user_ldap', 'displayName', null); |
395 | 395 | if ($oldName !== $displayName) { |
@@ -436,20 +436,20 @@ discard block |
||
436 | 436 | if ($this->wasRefreshed('email')) { |
437 | 437 | return; |
438 | 438 | } |
439 | - $email = (string)$valueFromLDAP; |
|
439 | + $email = (string) $valueFromLDAP; |
|
440 | 440 | if (is_null($valueFromLDAP)) { |
441 | 441 | $emailAttribute = $this->connection->ldapEmailAttribute; |
442 | 442 | if ($emailAttribute !== '') { |
443 | 443 | $aEmail = $this->access->readAttribute($this->dn, $emailAttribute); |
444 | 444 | if (is_array($aEmail) && (count($aEmail) > 0)) { |
445 | - $email = (string)$aEmail[0]; |
|
445 | + $email = (string) $aEmail[0]; |
|
446 | 446 | } |
447 | 447 | } |
448 | 448 | } |
449 | 449 | if ($email !== '') { |
450 | 450 | $user = $this->userManager->get($this->uid); |
451 | 451 | if (!is_null($user)) { |
452 | - $currentEmail = (string)$user->getEMailAddress(); |
|
452 | + $currentEmail = (string) $user->getEMailAddress(); |
|
453 | 453 | if ($currentEmail !== $email) { |
454 | 454 | $user->setEMailAddress($email); |
455 | 455 | } |
@@ -494,19 +494,19 @@ discard block |
||
494 | 494 | if ($aQuota && (count($aQuota) > 0) && $this->verifyQuotaValue($aQuota[0])) { |
495 | 495 | $quota = $aQuota[0]; |
496 | 496 | } elseif (is_array($aQuota) && isset($aQuota[0])) { |
497 | - $this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', ILogger::DEBUG); |
|
497 | + $this->log->log('no suitable LDAP quota found for user '.$this->uid.': ['.$aQuota[0].']', ILogger::DEBUG); |
|
498 | 498 | } |
499 | 499 | } elseif ($this->verifyQuotaValue($valueFromLDAP)) { |
500 | 500 | $quota = $valueFromLDAP; |
501 | 501 | } else { |
502 | - $this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', ILogger::DEBUG); |
|
502 | + $this->log->log('no suitable LDAP quota found for user '.$this->uid.': ['.$valueFromLDAP.']', ILogger::DEBUG); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | if ($quota === false && $this->verifyQuotaValue($defaultQuota)) { |
506 | 506 | // quota not found using the LDAP attribute (or not parseable). Try the default quota |
507 | 507 | $quota = $defaultQuota; |
508 | 508 | } elseif ($quota === false) { |
509 | - $this->log->log('no suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', ILogger::DEBUG); |
|
509 | + $this->log->log('no suitable default quota found for user '.$this->uid.': ['.$defaultQuota.']', ILogger::DEBUG); |
|
510 | 510 | return; |
511 | 511 | } |
512 | 512 | |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | if ($targetUser instanceof IUser) { |
515 | 515 | $targetUser->setQuota($quota); |
516 | 516 | } else { |
517 | - $this->log->log('trying to set a quota for user ' . $this->uid . ' but the user is missing', ILogger::INFO); |
|
517 | + $this->log->log('trying to set a quota for user '.$this->uid.' but the user is missing', ILogger::INFO); |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | return true; |
597 | 597 | } catch (\Exception $e) { |
598 | 598 | \OC::$server->getLogger()->logException($e, [ |
599 | - 'message' => 'Could not set avatar for ' . $this->dn, |
|
599 | + 'message' => 'Could not set avatar for '.$this->dn, |
|
600 | 600 | 'level' => ILogger::INFO, |
601 | 601 | 'app' => 'user_ldap', |
602 | 602 | ]); |
@@ -652,8 +652,8 @@ discard block |
||
652 | 652 | */ |
653 | 653 | public function handlePasswordExpiry($params) { |
654 | 654 | $ppolicyDN = $this->connection->ldapDefaultPPolicyDN; |
655 | - if (empty($ppolicyDN) || ((int)$this->connection->turnOnPasswordChange !== 1)) { |
|
656 | - return;//password expiry handling disabled |
|
655 | + if (empty($ppolicyDN) || ((int) $this->connection->turnOnPasswordChange !== 1)) { |
|
656 | + return; //password expiry handling disabled |
|
657 | 657 | } |
658 | 658 | $uid = $params['uid']; |
659 | 659 | if (isset($uid) && $uid === $this->getUsername()) { |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | if (array_key_exists('pwdpolicysubentry', $result[0])) { |
664 | 664 | $pwdPolicySubentry = $result[0]['pwdpolicysubentry']; |
665 | 665 | if ($pwdPolicySubentry && (count($pwdPolicySubentry) > 0)) { |
666 | - $ppolicyDN = $pwdPolicySubentry[0];//custom ppolicy DN |
|
666 | + $ppolicyDN = $pwdPolicySubentry[0]; //custom ppolicy DN |
|
667 | 667 | } |
668 | 668 | } |
669 | 669 | |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | $pwdChangedTime = array_key_exists('pwdchangedtime', $result[0]) ? $result[0]['pwdchangedtime'] : []; |
673 | 673 | |
674 | 674 | //retrieve relevant password policy attributes |
675 | - $cacheKey = 'ppolicyAttributes' . $ppolicyDN; |
|
675 | + $cacheKey = 'ppolicyAttributes'.$ppolicyDN; |
|
676 | 676 | $result = $this->connection->getFromCache($cacheKey); |
677 | 677 | if (is_null($result)) { |
678 | 678 | $result = $this->access->search('objectclass=*', $ppolicyDN, ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']); |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | //handle grace login |
687 | 687 | if (!empty($pwdGraceUseTime)) { //was this a grace login? |
688 | 688 | if (!empty($pwdGraceAuthNLimit) |
689 | - && count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available? |
|
689 | + && count($pwdGraceUseTime) < (int) $pwdGraceAuthNLimit[0]) { //at least one more grace login available? |
|
690 | 690 | $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true'); |
691 | 691 | header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute( |
692 | 692 | 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid])); |
@@ -707,8 +707,8 @@ discard block |
||
707 | 707 | if (!empty($pwdChangedTime)) { |
708 | 708 | if (!empty($pwdMaxAge) |
709 | 709 | && !empty($pwdExpireWarning)) { |
710 | - $pwdMaxAgeInt = (int)$pwdMaxAge[0]; |
|
711 | - $pwdExpireWarningInt = (int)$pwdExpireWarning[0]; |
|
710 | + $pwdMaxAgeInt = (int) $pwdMaxAge[0]; |
|
711 | + $pwdExpireWarningInt = (int) $pwdExpireWarning[0]; |
|
712 | 712 | if ($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0) { |
713 | 713 | $pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]); |
714 | 714 | $pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S')); |
@@ -6,71 +6,71 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\User_LDAP\\Access' => $baseDir . '/../lib/Access.php', |
|
10 | - 'OCA\\User_LDAP\\AccessFactory' => $baseDir . '/../lib/AccessFactory.php', |
|
11 | - 'OCA\\User_LDAP\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
12 | - 'OCA\\User_LDAP\\BackendUtility' => $baseDir . '/../lib/BackendUtility.php', |
|
13 | - 'OCA\\User_LDAP\\Command\\CheckUser' => $baseDir . '/../lib/Command/CheckUser.php', |
|
14 | - 'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => $baseDir . '/../lib/Command/CreateEmptyConfig.php', |
|
15 | - 'OCA\\User_LDAP\\Command\\DeleteConfig' => $baseDir . '/../lib/Command/DeleteConfig.php', |
|
16 | - 'OCA\\User_LDAP\\Command\\Search' => $baseDir . '/../lib/Command/Search.php', |
|
17 | - 'OCA\\User_LDAP\\Command\\SetConfig' => $baseDir . '/../lib/Command/SetConfig.php', |
|
18 | - 'OCA\\User_LDAP\\Command\\ShowConfig' => $baseDir . '/../lib/Command/ShowConfig.php', |
|
19 | - 'OCA\\User_LDAP\\Command\\ShowRemnants' => $baseDir . '/../lib/Command/ShowRemnants.php', |
|
20 | - 'OCA\\User_LDAP\\Command\\TestConfig' => $baseDir . '/../lib/Command/TestConfig.php', |
|
21 | - 'OCA\\User_LDAP\\Configuration' => $baseDir . '/../lib/Configuration.php', |
|
22 | - 'OCA\\User_LDAP\\Connection' => $baseDir . '/../lib/Connection.php', |
|
23 | - 'OCA\\User_LDAP\\ConnectionFactory' => $baseDir . '/../lib/ConnectionFactory.php', |
|
24 | - 'OCA\\User_LDAP\\Controller\\ConfigAPIController' => $baseDir . '/../lib/Controller/ConfigAPIController.php', |
|
25 | - 'OCA\\User_LDAP\\Controller\\RenewPasswordController' => $baseDir . '/../lib/Controller/RenewPasswordController.php', |
|
26 | - 'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => $baseDir . '/../lib/Events/GroupBackendRegistered.php', |
|
27 | - 'OCA\\User_LDAP\\Events\\UserBackendRegistered' => $baseDir . '/../lib/Events/UserBackendRegistered.php', |
|
28 | - 'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => $baseDir . '/../lib/Exceptions/AttributeNotSet.php', |
|
29 | - 'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => $baseDir . '/../lib/Exceptions/ConstraintViolationException.php', |
|
30 | - 'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => $baseDir . '/../lib/Exceptions/NotOnLDAP.php', |
|
31 | - 'OCA\\User_LDAP\\FilesystemHelper' => $baseDir . '/../lib/FilesystemHelper.php', |
|
32 | - 'OCA\\User_LDAP\\GroupPluginManager' => $baseDir . '/../lib/GroupPluginManager.php', |
|
33 | - 'OCA\\User_LDAP\\Group_LDAP' => $baseDir . '/../lib/Group_LDAP.php', |
|
34 | - 'OCA\\User_LDAP\\Group_Proxy' => $baseDir . '/../lib/Group_Proxy.php', |
|
35 | - 'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => $baseDir . '/../lib/Handler/ExtStorageConfigHandler.php', |
|
36 | - 'OCA\\User_LDAP\\Helper' => $baseDir . '/../lib/Helper.php', |
|
37 | - 'OCA\\User_LDAP\\IGroupLDAP' => $baseDir . '/../lib/IGroupLDAP.php', |
|
38 | - 'OCA\\User_LDAP\\ILDAPGroupPlugin' => $baseDir . '/../lib/ILDAPGroupPlugin.php', |
|
39 | - 'OCA\\User_LDAP\\ILDAPUserPlugin' => $baseDir . '/../lib/ILDAPUserPlugin.php', |
|
40 | - 'OCA\\User_LDAP\\ILDAPWrapper' => $baseDir . '/../lib/ILDAPWrapper.php', |
|
41 | - 'OCA\\User_LDAP\\IUserLDAP' => $baseDir . '/../lib/IUserLDAP.php', |
|
42 | - 'OCA\\User_LDAP\\Jobs\\CleanUp' => $baseDir . '/../lib/Jobs/CleanUp.php', |
|
43 | - 'OCA\\User_LDAP\\Jobs\\Sync' => $baseDir . '/../lib/Jobs/Sync.php', |
|
44 | - 'OCA\\User_LDAP\\Jobs\\UpdateGroups' => $baseDir . '/../lib/Jobs/UpdateGroups.php', |
|
45 | - 'OCA\\User_LDAP\\LDAP' => $baseDir . '/../lib/LDAP.php', |
|
46 | - 'OCA\\User_LDAP\\LDAPProvider' => $baseDir . '/../lib/LDAPProvider.php', |
|
47 | - 'OCA\\User_LDAP\\LDAPProviderFactory' => $baseDir . '/../lib/LDAPProviderFactory.php', |
|
48 | - 'OCA\\User_LDAP\\LDAPUtility' => $baseDir . '/../lib/LDAPUtility.php', |
|
49 | - 'OCA\\User_LDAP\\LogWrapper' => $baseDir . '/../lib/LogWrapper.php', |
|
50 | - 'OCA\\User_LDAP\\Mapping\\AbstractMapping' => $baseDir . '/../lib/Mapping/AbstractMapping.php', |
|
51 | - 'OCA\\User_LDAP\\Mapping\\GroupMapping' => $baseDir . '/../lib/Mapping/GroupMapping.php', |
|
52 | - 'OCA\\User_LDAP\\Mapping\\UserMapping' => $baseDir . '/../lib/Mapping/UserMapping.php', |
|
53 | - 'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => $baseDir . '/../lib/Migration/RemoveRefreshTime.php', |
|
54 | - 'OCA\\User_LDAP\\Migration\\UUIDFix' => $baseDir . '/../lib/Migration/UUIDFix.php', |
|
55 | - 'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir . '/../lib/Migration/UUIDFixGroup.php', |
|
56 | - 'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir . '/../lib/Migration/UUIDFixInsert.php', |
|
57 | - 'OCA\\User_LDAP\\Migration\\UUIDFixUser' => $baseDir . '/../lib/Migration/UUIDFixUser.php', |
|
58 | - 'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => $baseDir . '/../lib/Migration/Version1010Date20200630192842.php', |
|
59 | - 'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
60 | - 'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir . '/../lib/PagedResults/IAdapter.php', |
|
61 | - 'OCA\\User_LDAP\\PagedResults\\Php54' => $baseDir . '/../lib/PagedResults/Php54.php', |
|
62 | - 'OCA\\User_LDAP\\PagedResults\\Php73' => $baseDir . '/../lib/PagedResults/Php73.php', |
|
63 | - 'OCA\\User_LDAP\\PagedResults\\TLinkId' => $baseDir . '/../lib/PagedResults/TLinkId.php', |
|
64 | - 'OCA\\User_LDAP\\Proxy' => $baseDir . '/../lib/Proxy.php', |
|
65 | - 'OCA\\User_LDAP\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
66 | - 'OCA\\User_LDAP\\Settings\\Section' => $baseDir . '/../lib/Settings/Section.php', |
|
67 | - 'OCA\\User_LDAP\\UserPluginManager' => $baseDir . '/../lib/UserPluginManager.php', |
|
68 | - 'OCA\\User_LDAP\\User\\DeletedUsersIndex' => $baseDir . '/../lib/User/DeletedUsersIndex.php', |
|
69 | - 'OCA\\User_LDAP\\User\\Manager' => $baseDir . '/../lib/User/Manager.php', |
|
70 | - 'OCA\\User_LDAP\\User\\OfflineUser' => $baseDir . '/../lib/User/OfflineUser.php', |
|
71 | - 'OCA\\User_LDAP\\User\\User' => $baseDir . '/../lib/User/User.php', |
|
72 | - 'OCA\\User_LDAP\\User_LDAP' => $baseDir . '/../lib/User_LDAP.php', |
|
73 | - 'OCA\\User_LDAP\\User_Proxy' => $baseDir . '/../lib/User_Proxy.php', |
|
74 | - 'OCA\\User_LDAP\\Wizard' => $baseDir . '/../lib/Wizard.php', |
|
75 | - 'OCA\\User_LDAP\\WizardResult' => $baseDir . '/../lib/WizardResult.php', |
|
9 | + 'OCA\\User_LDAP\\Access' => $baseDir.'/../lib/Access.php', |
|
10 | + 'OCA\\User_LDAP\\AccessFactory' => $baseDir.'/../lib/AccessFactory.php', |
|
11 | + 'OCA\\User_LDAP\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
12 | + 'OCA\\User_LDAP\\BackendUtility' => $baseDir.'/../lib/BackendUtility.php', |
|
13 | + 'OCA\\User_LDAP\\Command\\CheckUser' => $baseDir.'/../lib/Command/CheckUser.php', |
|
14 | + 'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => $baseDir.'/../lib/Command/CreateEmptyConfig.php', |
|
15 | + 'OCA\\User_LDAP\\Command\\DeleteConfig' => $baseDir.'/../lib/Command/DeleteConfig.php', |
|
16 | + 'OCA\\User_LDAP\\Command\\Search' => $baseDir.'/../lib/Command/Search.php', |
|
17 | + 'OCA\\User_LDAP\\Command\\SetConfig' => $baseDir.'/../lib/Command/SetConfig.php', |
|
18 | + 'OCA\\User_LDAP\\Command\\ShowConfig' => $baseDir.'/../lib/Command/ShowConfig.php', |
|
19 | + 'OCA\\User_LDAP\\Command\\ShowRemnants' => $baseDir.'/../lib/Command/ShowRemnants.php', |
|
20 | + 'OCA\\User_LDAP\\Command\\TestConfig' => $baseDir.'/../lib/Command/TestConfig.php', |
|
21 | + 'OCA\\User_LDAP\\Configuration' => $baseDir.'/../lib/Configuration.php', |
|
22 | + 'OCA\\User_LDAP\\Connection' => $baseDir.'/../lib/Connection.php', |
|
23 | + 'OCA\\User_LDAP\\ConnectionFactory' => $baseDir.'/../lib/ConnectionFactory.php', |
|
24 | + 'OCA\\User_LDAP\\Controller\\ConfigAPIController' => $baseDir.'/../lib/Controller/ConfigAPIController.php', |
|
25 | + 'OCA\\User_LDAP\\Controller\\RenewPasswordController' => $baseDir.'/../lib/Controller/RenewPasswordController.php', |
|
26 | + 'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => $baseDir.'/../lib/Events/GroupBackendRegistered.php', |
|
27 | + 'OCA\\User_LDAP\\Events\\UserBackendRegistered' => $baseDir.'/../lib/Events/UserBackendRegistered.php', |
|
28 | + 'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => $baseDir.'/../lib/Exceptions/AttributeNotSet.php', |
|
29 | + 'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => $baseDir.'/../lib/Exceptions/ConstraintViolationException.php', |
|
30 | + 'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => $baseDir.'/../lib/Exceptions/NotOnLDAP.php', |
|
31 | + 'OCA\\User_LDAP\\FilesystemHelper' => $baseDir.'/../lib/FilesystemHelper.php', |
|
32 | + 'OCA\\User_LDAP\\GroupPluginManager' => $baseDir.'/../lib/GroupPluginManager.php', |
|
33 | + 'OCA\\User_LDAP\\Group_LDAP' => $baseDir.'/../lib/Group_LDAP.php', |
|
34 | + 'OCA\\User_LDAP\\Group_Proxy' => $baseDir.'/../lib/Group_Proxy.php', |
|
35 | + 'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => $baseDir.'/../lib/Handler/ExtStorageConfigHandler.php', |
|
36 | + 'OCA\\User_LDAP\\Helper' => $baseDir.'/../lib/Helper.php', |
|
37 | + 'OCA\\User_LDAP\\IGroupLDAP' => $baseDir.'/../lib/IGroupLDAP.php', |
|
38 | + 'OCA\\User_LDAP\\ILDAPGroupPlugin' => $baseDir.'/../lib/ILDAPGroupPlugin.php', |
|
39 | + 'OCA\\User_LDAP\\ILDAPUserPlugin' => $baseDir.'/../lib/ILDAPUserPlugin.php', |
|
40 | + 'OCA\\User_LDAP\\ILDAPWrapper' => $baseDir.'/../lib/ILDAPWrapper.php', |
|
41 | + 'OCA\\User_LDAP\\IUserLDAP' => $baseDir.'/../lib/IUserLDAP.php', |
|
42 | + 'OCA\\User_LDAP\\Jobs\\CleanUp' => $baseDir.'/../lib/Jobs/CleanUp.php', |
|
43 | + 'OCA\\User_LDAP\\Jobs\\Sync' => $baseDir.'/../lib/Jobs/Sync.php', |
|
44 | + 'OCA\\User_LDAP\\Jobs\\UpdateGroups' => $baseDir.'/../lib/Jobs/UpdateGroups.php', |
|
45 | + 'OCA\\User_LDAP\\LDAP' => $baseDir.'/../lib/LDAP.php', |
|
46 | + 'OCA\\User_LDAP\\LDAPProvider' => $baseDir.'/../lib/LDAPProvider.php', |
|
47 | + 'OCA\\User_LDAP\\LDAPProviderFactory' => $baseDir.'/../lib/LDAPProviderFactory.php', |
|
48 | + 'OCA\\User_LDAP\\LDAPUtility' => $baseDir.'/../lib/LDAPUtility.php', |
|
49 | + 'OCA\\User_LDAP\\LogWrapper' => $baseDir.'/../lib/LogWrapper.php', |
|
50 | + 'OCA\\User_LDAP\\Mapping\\AbstractMapping' => $baseDir.'/../lib/Mapping/AbstractMapping.php', |
|
51 | + 'OCA\\User_LDAP\\Mapping\\GroupMapping' => $baseDir.'/../lib/Mapping/GroupMapping.php', |
|
52 | + 'OCA\\User_LDAP\\Mapping\\UserMapping' => $baseDir.'/../lib/Mapping/UserMapping.php', |
|
53 | + 'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => $baseDir.'/../lib/Migration/RemoveRefreshTime.php', |
|
54 | + 'OCA\\User_LDAP\\Migration\\UUIDFix' => $baseDir.'/../lib/Migration/UUIDFix.php', |
|
55 | + 'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir.'/../lib/Migration/UUIDFixGroup.php', |
|
56 | + 'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir.'/../lib/Migration/UUIDFixInsert.php', |
|
57 | + 'OCA\\User_LDAP\\Migration\\UUIDFixUser' => $baseDir.'/../lib/Migration/UUIDFixUser.php', |
|
58 | + 'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => $baseDir.'/../lib/Migration/Version1010Date20200630192842.php', |
|
59 | + 'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
60 | + 'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir.'/../lib/PagedResults/IAdapter.php', |
|
61 | + 'OCA\\User_LDAP\\PagedResults\\Php54' => $baseDir.'/../lib/PagedResults/Php54.php', |
|
62 | + 'OCA\\User_LDAP\\PagedResults\\Php73' => $baseDir.'/../lib/PagedResults/Php73.php', |
|
63 | + 'OCA\\User_LDAP\\PagedResults\\TLinkId' => $baseDir.'/../lib/PagedResults/TLinkId.php', |
|
64 | + 'OCA\\User_LDAP\\Proxy' => $baseDir.'/../lib/Proxy.php', |
|
65 | + 'OCA\\User_LDAP\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
66 | + 'OCA\\User_LDAP\\Settings\\Section' => $baseDir.'/../lib/Settings/Section.php', |
|
67 | + 'OCA\\User_LDAP\\UserPluginManager' => $baseDir.'/../lib/UserPluginManager.php', |
|
68 | + 'OCA\\User_LDAP\\User\\DeletedUsersIndex' => $baseDir.'/../lib/User/DeletedUsersIndex.php', |
|
69 | + 'OCA\\User_LDAP\\User\\Manager' => $baseDir.'/../lib/User/Manager.php', |
|
70 | + 'OCA\\User_LDAP\\User\\OfflineUser' => $baseDir.'/../lib/User/OfflineUser.php', |
|
71 | + 'OCA\\User_LDAP\\User\\User' => $baseDir.'/../lib/User/User.php', |
|
72 | + 'OCA\\User_LDAP\\User_LDAP' => $baseDir.'/../lib/User_LDAP.php', |
|
73 | + 'OCA\\User_LDAP\\User_Proxy' => $baseDir.'/../lib/User_Proxy.php', |
|
74 | + 'OCA\\User_LDAP\\Wizard' => $baseDir.'/../lib/Wizard.php', |
|
75 | + 'OCA\\User_LDAP\\WizardResult' => $baseDir.'/../lib/WizardResult.php', |
|
76 | 76 | ); |
@@ -6,93 +6,93 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitUser_LDAP |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\User_LDAP\\' => 14, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\User_LDAP\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'OCA\\User_LDAP\\Access' => __DIR__ . '/..' . '/../lib/Access.php', |
|
25 | - 'OCA\\User_LDAP\\AccessFactory' => __DIR__ . '/..' . '/../lib/AccessFactory.php', |
|
26 | - 'OCA\\User_LDAP\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
27 | - 'OCA\\User_LDAP\\BackendUtility' => __DIR__ . '/..' . '/../lib/BackendUtility.php', |
|
28 | - 'OCA\\User_LDAP\\Command\\CheckUser' => __DIR__ . '/..' . '/../lib/Command/CheckUser.php', |
|
29 | - 'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => __DIR__ . '/..' . '/../lib/Command/CreateEmptyConfig.php', |
|
30 | - 'OCA\\User_LDAP\\Command\\DeleteConfig' => __DIR__ . '/..' . '/../lib/Command/DeleteConfig.php', |
|
31 | - 'OCA\\User_LDAP\\Command\\Search' => __DIR__ . '/..' . '/../lib/Command/Search.php', |
|
32 | - 'OCA\\User_LDAP\\Command\\SetConfig' => __DIR__ . '/..' . '/../lib/Command/SetConfig.php', |
|
33 | - 'OCA\\User_LDAP\\Command\\ShowConfig' => __DIR__ . '/..' . '/../lib/Command/ShowConfig.php', |
|
34 | - 'OCA\\User_LDAP\\Command\\ShowRemnants' => __DIR__ . '/..' . '/../lib/Command/ShowRemnants.php', |
|
35 | - 'OCA\\User_LDAP\\Command\\TestConfig' => __DIR__ . '/..' . '/../lib/Command/TestConfig.php', |
|
36 | - 'OCA\\User_LDAP\\Configuration' => __DIR__ . '/..' . '/../lib/Configuration.php', |
|
37 | - 'OCA\\User_LDAP\\Connection' => __DIR__ . '/..' . '/../lib/Connection.php', |
|
38 | - 'OCA\\User_LDAP\\ConnectionFactory' => __DIR__ . '/..' . '/../lib/ConnectionFactory.php', |
|
39 | - 'OCA\\User_LDAP\\Controller\\ConfigAPIController' => __DIR__ . '/..' . '/../lib/Controller/ConfigAPIController.php', |
|
40 | - 'OCA\\User_LDAP\\Controller\\RenewPasswordController' => __DIR__ . '/..' . '/../lib/Controller/RenewPasswordController.php', |
|
41 | - 'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => __DIR__ . '/..' . '/../lib/Events/GroupBackendRegistered.php', |
|
42 | - 'OCA\\User_LDAP\\Events\\UserBackendRegistered' => __DIR__ . '/..' . '/../lib/Events/UserBackendRegistered.php', |
|
43 | - 'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => __DIR__ . '/..' . '/../lib/Exceptions/AttributeNotSet.php', |
|
44 | - 'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => __DIR__ . '/..' . '/../lib/Exceptions/ConstraintViolationException.php', |
|
45 | - 'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => __DIR__ . '/..' . '/../lib/Exceptions/NotOnLDAP.php', |
|
46 | - 'OCA\\User_LDAP\\FilesystemHelper' => __DIR__ . '/..' . '/../lib/FilesystemHelper.php', |
|
47 | - 'OCA\\User_LDAP\\GroupPluginManager' => __DIR__ . '/..' . '/../lib/GroupPluginManager.php', |
|
48 | - 'OCA\\User_LDAP\\Group_LDAP' => __DIR__ . '/..' . '/../lib/Group_LDAP.php', |
|
49 | - 'OCA\\User_LDAP\\Group_Proxy' => __DIR__ . '/..' . '/../lib/Group_Proxy.php', |
|
50 | - 'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => __DIR__ . '/..' . '/../lib/Handler/ExtStorageConfigHandler.php', |
|
51 | - 'OCA\\User_LDAP\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php', |
|
52 | - 'OCA\\User_LDAP\\IGroupLDAP' => __DIR__ . '/..' . '/../lib/IGroupLDAP.php', |
|
53 | - 'OCA\\User_LDAP\\ILDAPGroupPlugin' => __DIR__ . '/..' . '/../lib/ILDAPGroupPlugin.php', |
|
54 | - 'OCA\\User_LDAP\\ILDAPUserPlugin' => __DIR__ . '/..' . '/../lib/ILDAPUserPlugin.php', |
|
55 | - 'OCA\\User_LDAP\\ILDAPWrapper' => __DIR__ . '/..' . '/../lib/ILDAPWrapper.php', |
|
56 | - 'OCA\\User_LDAP\\IUserLDAP' => __DIR__ . '/..' . '/../lib/IUserLDAP.php', |
|
57 | - 'OCA\\User_LDAP\\Jobs\\CleanUp' => __DIR__ . '/..' . '/../lib/Jobs/CleanUp.php', |
|
58 | - 'OCA\\User_LDAP\\Jobs\\Sync' => __DIR__ . '/..' . '/../lib/Jobs/Sync.php', |
|
59 | - 'OCA\\User_LDAP\\Jobs\\UpdateGroups' => __DIR__ . '/..' . '/../lib/Jobs/UpdateGroups.php', |
|
60 | - 'OCA\\User_LDAP\\LDAP' => __DIR__ . '/..' . '/../lib/LDAP.php', |
|
61 | - 'OCA\\User_LDAP\\LDAPProvider' => __DIR__ . '/..' . '/../lib/LDAPProvider.php', |
|
62 | - 'OCA\\User_LDAP\\LDAPProviderFactory' => __DIR__ . '/..' . '/../lib/LDAPProviderFactory.php', |
|
63 | - 'OCA\\User_LDAP\\LDAPUtility' => __DIR__ . '/..' . '/../lib/LDAPUtility.php', |
|
64 | - 'OCA\\User_LDAP\\LogWrapper' => __DIR__ . '/..' . '/../lib/LogWrapper.php', |
|
65 | - 'OCA\\User_LDAP\\Mapping\\AbstractMapping' => __DIR__ . '/..' . '/../lib/Mapping/AbstractMapping.php', |
|
66 | - 'OCA\\User_LDAP\\Mapping\\GroupMapping' => __DIR__ . '/..' . '/../lib/Mapping/GroupMapping.php', |
|
67 | - 'OCA\\User_LDAP\\Mapping\\UserMapping' => __DIR__ . '/..' . '/../lib/Mapping/UserMapping.php', |
|
68 | - 'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => __DIR__ . '/..' . '/../lib/Migration/RemoveRefreshTime.php', |
|
69 | - 'OCA\\User_LDAP\\Migration\\UUIDFix' => __DIR__ . '/..' . '/../lib/Migration/UUIDFix.php', |
|
70 | - 'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixGroup.php', |
|
71 | - 'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixInsert.php', |
|
72 | - 'OCA\\User_LDAP\\Migration\\UUIDFixUser' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixUser.php', |
|
73 | - 'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630192842.php', |
|
74 | - 'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
75 | - 'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__ . '/..' . '/../lib/PagedResults/IAdapter.php', |
|
76 | - 'OCA\\User_LDAP\\PagedResults\\Php54' => __DIR__ . '/..' . '/../lib/PagedResults/Php54.php', |
|
77 | - 'OCA\\User_LDAP\\PagedResults\\Php73' => __DIR__ . '/..' . '/../lib/PagedResults/Php73.php', |
|
78 | - 'OCA\\User_LDAP\\PagedResults\\TLinkId' => __DIR__ . '/..' . '/../lib/PagedResults/TLinkId.php', |
|
79 | - 'OCA\\User_LDAP\\Proxy' => __DIR__ . '/..' . '/../lib/Proxy.php', |
|
80 | - 'OCA\\User_LDAP\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
81 | - 'OCA\\User_LDAP\\Settings\\Section' => __DIR__ . '/..' . '/../lib/Settings/Section.php', |
|
82 | - 'OCA\\User_LDAP\\UserPluginManager' => __DIR__ . '/..' . '/../lib/UserPluginManager.php', |
|
83 | - 'OCA\\User_LDAP\\User\\DeletedUsersIndex' => __DIR__ . '/..' . '/../lib/User/DeletedUsersIndex.php', |
|
84 | - 'OCA\\User_LDAP\\User\\Manager' => __DIR__ . '/..' . '/../lib/User/Manager.php', |
|
85 | - 'OCA\\User_LDAP\\User\\OfflineUser' => __DIR__ . '/..' . '/../lib/User/OfflineUser.php', |
|
86 | - 'OCA\\User_LDAP\\User\\User' => __DIR__ . '/..' . '/../lib/User/User.php', |
|
87 | - 'OCA\\User_LDAP\\User_LDAP' => __DIR__ . '/..' . '/../lib/User_LDAP.php', |
|
88 | - 'OCA\\User_LDAP\\User_Proxy' => __DIR__ . '/..' . '/../lib/User_Proxy.php', |
|
89 | - 'OCA\\User_LDAP\\Wizard' => __DIR__ . '/..' . '/../lib/Wizard.php', |
|
90 | - 'OCA\\User_LDAP\\WizardResult' => __DIR__ . '/..' . '/../lib/WizardResult.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\User_LDAP\\Access' => __DIR__.'/..'.'/../lib/Access.php', |
|
25 | + 'OCA\\User_LDAP\\AccessFactory' => __DIR__.'/..'.'/../lib/AccessFactory.php', |
|
26 | + 'OCA\\User_LDAP\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
27 | + 'OCA\\User_LDAP\\BackendUtility' => __DIR__.'/..'.'/../lib/BackendUtility.php', |
|
28 | + 'OCA\\User_LDAP\\Command\\CheckUser' => __DIR__.'/..'.'/../lib/Command/CheckUser.php', |
|
29 | + 'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => __DIR__.'/..'.'/../lib/Command/CreateEmptyConfig.php', |
|
30 | + 'OCA\\User_LDAP\\Command\\DeleteConfig' => __DIR__.'/..'.'/../lib/Command/DeleteConfig.php', |
|
31 | + 'OCA\\User_LDAP\\Command\\Search' => __DIR__.'/..'.'/../lib/Command/Search.php', |
|
32 | + 'OCA\\User_LDAP\\Command\\SetConfig' => __DIR__.'/..'.'/../lib/Command/SetConfig.php', |
|
33 | + 'OCA\\User_LDAP\\Command\\ShowConfig' => __DIR__.'/..'.'/../lib/Command/ShowConfig.php', |
|
34 | + 'OCA\\User_LDAP\\Command\\ShowRemnants' => __DIR__.'/..'.'/../lib/Command/ShowRemnants.php', |
|
35 | + 'OCA\\User_LDAP\\Command\\TestConfig' => __DIR__.'/..'.'/../lib/Command/TestConfig.php', |
|
36 | + 'OCA\\User_LDAP\\Configuration' => __DIR__.'/..'.'/../lib/Configuration.php', |
|
37 | + 'OCA\\User_LDAP\\Connection' => __DIR__.'/..'.'/../lib/Connection.php', |
|
38 | + 'OCA\\User_LDAP\\ConnectionFactory' => __DIR__.'/..'.'/../lib/ConnectionFactory.php', |
|
39 | + 'OCA\\User_LDAP\\Controller\\ConfigAPIController' => __DIR__.'/..'.'/../lib/Controller/ConfigAPIController.php', |
|
40 | + 'OCA\\User_LDAP\\Controller\\RenewPasswordController' => __DIR__.'/..'.'/../lib/Controller/RenewPasswordController.php', |
|
41 | + 'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => __DIR__.'/..'.'/../lib/Events/GroupBackendRegistered.php', |
|
42 | + 'OCA\\User_LDAP\\Events\\UserBackendRegistered' => __DIR__.'/..'.'/../lib/Events/UserBackendRegistered.php', |
|
43 | + 'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => __DIR__.'/..'.'/../lib/Exceptions/AttributeNotSet.php', |
|
44 | + 'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => __DIR__.'/..'.'/../lib/Exceptions/ConstraintViolationException.php', |
|
45 | + 'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => __DIR__.'/..'.'/../lib/Exceptions/NotOnLDAP.php', |
|
46 | + 'OCA\\User_LDAP\\FilesystemHelper' => __DIR__.'/..'.'/../lib/FilesystemHelper.php', |
|
47 | + 'OCA\\User_LDAP\\GroupPluginManager' => __DIR__.'/..'.'/../lib/GroupPluginManager.php', |
|
48 | + 'OCA\\User_LDAP\\Group_LDAP' => __DIR__.'/..'.'/../lib/Group_LDAP.php', |
|
49 | + 'OCA\\User_LDAP\\Group_Proxy' => __DIR__.'/..'.'/../lib/Group_Proxy.php', |
|
50 | + 'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => __DIR__.'/..'.'/../lib/Handler/ExtStorageConfigHandler.php', |
|
51 | + 'OCA\\User_LDAP\\Helper' => __DIR__.'/..'.'/../lib/Helper.php', |
|
52 | + 'OCA\\User_LDAP\\IGroupLDAP' => __DIR__.'/..'.'/../lib/IGroupLDAP.php', |
|
53 | + 'OCA\\User_LDAP\\ILDAPGroupPlugin' => __DIR__.'/..'.'/../lib/ILDAPGroupPlugin.php', |
|
54 | + 'OCA\\User_LDAP\\ILDAPUserPlugin' => __DIR__.'/..'.'/../lib/ILDAPUserPlugin.php', |
|
55 | + 'OCA\\User_LDAP\\ILDAPWrapper' => __DIR__.'/..'.'/../lib/ILDAPWrapper.php', |
|
56 | + 'OCA\\User_LDAP\\IUserLDAP' => __DIR__.'/..'.'/../lib/IUserLDAP.php', |
|
57 | + 'OCA\\User_LDAP\\Jobs\\CleanUp' => __DIR__.'/..'.'/../lib/Jobs/CleanUp.php', |
|
58 | + 'OCA\\User_LDAP\\Jobs\\Sync' => __DIR__.'/..'.'/../lib/Jobs/Sync.php', |
|
59 | + 'OCA\\User_LDAP\\Jobs\\UpdateGroups' => __DIR__.'/..'.'/../lib/Jobs/UpdateGroups.php', |
|
60 | + 'OCA\\User_LDAP\\LDAP' => __DIR__.'/..'.'/../lib/LDAP.php', |
|
61 | + 'OCA\\User_LDAP\\LDAPProvider' => __DIR__.'/..'.'/../lib/LDAPProvider.php', |
|
62 | + 'OCA\\User_LDAP\\LDAPProviderFactory' => __DIR__.'/..'.'/../lib/LDAPProviderFactory.php', |
|
63 | + 'OCA\\User_LDAP\\LDAPUtility' => __DIR__.'/..'.'/../lib/LDAPUtility.php', |
|
64 | + 'OCA\\User_LDAP\\LogWrapper' => __DIR__.'/..'.'/../lib/LogWrapper.php', |
|
65 | + 'OCA\\User_LDAP\\Mapping\\AbstractMapping' => __DIR__.'/..'.'/../lib/Mapping/AbstractMapping.php', |
|
66 | + 'OCA\\User_LDAP\\Mapping\\GroupMapping' => __DIR__.'/..'.'/../lib/Mapping/GroupMapping.php', |
|
67 | + 'OCA\\User_LDAP\\Mapping\\UserMapping' => __DIR__.'/..'.'/../lib/Mapping/UserMapping.php', |
|
68 | + 'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => __DIR__.'/..'.'/../lib/Migration/RemoveRefreshTime.php', |
|
69 | + 'OCA\\User_LDAP\\Migration\\UUIDFix' => __DIR__.'/..'.'/../lib/Migration/UUIDFix.php', |
|
70 | + 'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__.'/..'.'/../lib/Migration/UUIDFixGroup.php', |
|
71 | + 'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__.'/..'.'/../lib/Migration/UUIDFixInsert.php', |
|
72 | + 'OCA\\User_LDAP\\Migration\\UUIDFixUser' => __DIR__.'/..'.'/../lib/Migration/UUIDFixUser.php', |
|
73 | + 'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => __DIR__.'/..'.'/../lib/Migration/Version1010Date20200630192842.php', |
|
74 | + 'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
75 | + 'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__.'/..'.'/../lib/PagedResults/IAdapter.php', |
|
76 | + 'OCA\\User_LDAP\\PagedResults\\Php54' => __DIR__.'/..'.'/../lib/PagedResults/Php54.php', |
|
77 | + 'OCA\\User_LDAP\\PagedResults\\Php73' => __DIR__.'/..'.'/../lib/PagedResults/Php73.php', |
|
78 | + 'OCA\\User_LDAP\\PagedResults\\TLinkId' => __DIR__.'/..'.'/../lib/PagedResults/TLinkId.php', |
|
79 | + 'OCA\\User_LDAP\\Proxy' => __DIR__.'/..'.'/../lib/Proxy.php', |
|
80 | + 'OCA\\User_LDAP\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
81 | + 'OCA\\User_LDAP\\Settings\\Section' => __DIR__.'/..'.'/../lib/Settings/Section.php', |
|
82 | + 'OCA\\User_LDAP\\UserPluginManager' => __DIR__.'/..'.'/../lib/UserPluginManager.php', |
|
83 | + 'OCA\\User_LDAP\\User\\DeletedUsersIndex' => __DIR__.'/..'.'/../lib/User/DeletedUsersIndex.php', |
|
84 | + 'OCA\\User_LDAP\\User\\Manager' => __DIR__.'/..'.'/../lib/User/Manager.php', |
|
85 | + 'OCA\\User_LDAP\\User\\OfflineUser' => __DIR__.'/..'.'/../lib/User/OfflineUser.php', |
|
86 | + 'OCA\\User_LDAP\\User\\User' => __DIR__.'/..'.'/../lib/User/User.php', |
|
87 | + 'OCA\\User_LDAP\\User_LDAP' => __DIR__.'/..'.'/../lib/User_LDAP.php', |
|
88 | + 'OCA\\User_LDAP\\User_Proxy' => __DIR__.'/..'.'/../lib/User_Proxy.php', |
|
89 | + 'OCA\\User_LDAP\\Wizard' => __DIR__.'/..'.'/../lib/Wizard.php', |
|
90 | + 'OCA\\User_LDAP\\WizardResult' => __DIR__.'/..'.'/../lib/WizardResult.php', |
|
91 | 91 | ); |
92 | 92 | |
93 | 93 | public static function getInitializer(ClassLoader $loader) |
94 | 94 | { |
95 | - return \Closure::bind(function () use ($loader) { |
|
95 | + return \Closure::bind(function() use ($loader) { |
|
96 | 96 | $loader->prefixLengthsPsr4 = ComposerStaticInitUser_LDAP::$prefixLengthsPsr4; |
97 | 97 | $loader->prefixDirsPsr4 = ComposerStaticInitUser_LDAP::$prefixDirsPsr4; |
98 | 98 | $loader->classMap = ComposerStaticInitUser_LDAP::$classMap; |