Passed
Push — master ( 3f0b7f...9de6ef )
by Julius
15:21 queued 10s
created
apps/user_ldap/composer/composer/autoload_classmap.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -6,73 +6,73 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
-    'OCA\\User_LDAP\\Access' => $baseDir . '/../lib/Access.php',
11
-    'OCA\\User_LDAP\\AccessFactory' => $baseDir . '/../lib/AccessFactory.php',
12
-    'OCA\\User_LDAP\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
13
-    'OCA\\User_LDAP\\BackendUtility' => $baseDir . '/../lib/BackendUtility.php',
14
-    'OCA\\User_LDAP\\Command\\CheckUser' => $baseDir . '/../lib/Command/CheckUser.php',
15
-    'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => $baseDir . '/../lib/Command/CreateEmptyConfig.php',
16
-    'OCA\\User_LDAP\\Command\\DeleteConfig' => $baseDir . '/../lib/Command/DeleteConfig.php',
17
-    'OCA\\User_LDAP\\Command\\ResetUser' => $baseDir . '/../lib/Command/ResetUser.php',
18
-    'OCA\\User_LDAP\\Command\\Search' => $baseDir . '/../lib/Command/Search.php',
19
-    'OCA\\User_LDAP\\Command\\SetConfig' => $baseDir . '/../lib/Command/SetConfig.php',
20
-    'OCA\\User_LDAP\\Command\\ShowConfig' => $baseDir . '/../lib/Command/ShowConfig.php',
21
-    'OCA\\User_LDAP\\Command\\ShowRemnants' => $baseDir . '/../lib/Command/ShowRemnants.php',
22
-    'OCA\\User_LDAP\\Command\\TestConfig' => $baseDir . '/../lib/Command/TestConfig.php',
23
-    'OCA\\User_LDAP\\Configuration' => $baseDir . '/../lib/Configuration.php',
24
-    'OCA\\User_LDAP\\Connection' => $baseDir . '/../lib/Connection.php',
25
-    'OCA\\User_LDAP\\ConnectionFactory' => $baseDir . '/../lib/ConnectionFactory.php',
26
-    'OCA\\User_LDAP\\Controller\\ConfigAPIController' => $baseDir . '/../lib/Controller/ConfigAPIController.php',
27
-    'OCA\\User_LDAP\\Controller\\RenewPasswordController' => $baseDir . '/../lib/Controller/RenewPasswordController.php',
28
-    'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => $baseDir . '/../lib/Events/GroupBackendRegistered.php',
29
-    'OCA\\User_LDAP\\Events\\UserBackendRegistered' => $baseDir . '/../lib/Events/UserBackendRegistered.php',
30
-    'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => $baseDir . '/../lib/Exceptions/AttributeNotSet.php',
31
-    'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => $baseDir . '/../lib/Exceptions/ConstraintViolationException.php',
32
-    'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => $baseDir . '/../lib/Exceptions/NotOnLDAP.php',
33
-    'OCA\\User_LDAP\\FilesystemHelper' => $baseDir . '/../lib/FilesystemHelper.php',
34
-    'OCA\\User_LDAP\\GroupPluginManager' => $baseDir . '/../lib/GroupPluginManager.php',
35
-    'OCA\\User_LDAP\\Group_LDAP' => $baseDir . '/../lib/Group_LDAP.php',
36
-    'OCA\\User_LDAP\\Group_Proxy' => $baseDir . '/../lib/Group_Proxy.php',
37
-    'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => $baseDir . '/../lib/Handler/ExtStorageConfigHandler.php',
38
-    'OCA\\User_LDAP\\Helper' => $baseDir . '/../lib/Helper.php',
39
-    'OCA\\User_LDAP\\IGroupLDAP' => $baseDir . '/../lib/IGroupLDAP.php',
40
-    'OCA\\User_LDAP\\ILDAPGroupPlugin' => $baseDir . '/../lib/ILDAPGroupPlugin.php',
41
-    'OCA\\User_LDAP\\ILDAPUserPlugin' => $baseDir . '/../lib/ILDAPUserPlugin.php',
42
-    'OCA\\User_LDAP\\ILDAPWrapper' => $baseDir . '/../lib/ILDAPWrapper.php',
43
-    'OCA\\User_LDAP\\IUserLDAP' => $baseDir . '/../lib/IUserLDAP.php',
44
-    'OCA\\User_LDAP\\Jobs\\CleanUp' => $baseDir . '/../lib/Jobs/CleanUp.php',
45
-    'OCA\\User_LDAP\\Jobs\\Sync' => $baseDir . '/../lib/Jobs/Sync.php',
46
-    'OCA\\User_LDAP\\Jobs\\UpdateGroups' => $baseDir . '/../lib/Jobs/UpdateGroups.php',
47
-    'OCA\\User_LDAP\\LDAP' => $baseDir . '/../lib/LDAP.php',
48
-    'OCA\\User_LDAP\\LDAPProvider' => $baseDir . '/../lib/LDAPProvider.php',
49
-    'OCA\\User_LDAP\\LDAPProviderFactory' => $baseDir . '/../lib/LDAPProviderFactory.php',
50
-    'OCA\\User_LDAP\\LDAPUtility' => $baseDir . '/../lib/LDAPUtility.php',
51
-    'OCA\\User_LDAP\\LogWrapper' => $baseDir . '/../lib/LogWrapper.php',
52
-    'OCA\\User_LDAP\\Mapping\\AbstractMapping' => $baseDir . '/../lib/Mapping/AbstractMapping.php',
53
-    'OCA\\User_LDAP\\Mapping\\GroupMapping' => $baseDir . '/../lib/Mapping/GroupMapping.php',
54
-    'OCA\\User_LDAP\\Mapping\\UserMapping' => $baseDir . '/../lib/Mapping/UserMapping.php',
55
-    'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => $baseDir . '/../lib/Migration/RemoveRefreshTime.php',
56
-    'OCA\\User_LDAP\\Migration\\SetDefaultProvider' => $baseDir . '/../lib/Migration/SetDefaultProvider.php',
57
-    'OCA\\User_LDAP\\Migration\\UUIDFix' => $baseDir . '/../lib/Migration/UUIDFix.php',
58
-    'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir . '/../lib/Migration/UUIDFixGroup.php',
59
-    'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir . '/../lib/Migration/UUIDFixInsert.php',
60
-    'OCA\\User_LDAP\\Migration\\UUIDFixUser' => $baseDir . '/../lib/Migration/UUIDFixUser.php',
61
-    'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => $baseDir . '/../lib/Migration/Version1010Date20200630192842.php',
62
-    'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
63
-    'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir . '/../lib/PagedResults/IAdapter.php',
64
-    'OCA\\User_LDAP\\PagedResults\\Php73' => $baseDir . '/../lib/PagedResults/Php73.php',
65
-    'OCA\\User_LDAP\\PagedResults\\TLinkId' => $baseDir . '/../lib/PagedResults/TLinkId.php',
66
-    'OCA\\User_LDAP\\Proxy' => $baseDir . '/../lib/Proxy.php',
67
-    'OCA\\User_LDAP\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php',
68
-    'OCA\\User_LDAP\\Settings\\Section' => $baseDir . '/../lib/Settings/Section.php',
69
-    'OCA\\User_LDAP\\UserPluginManager' => $baseDir . '/../lib/UserPluginManager.php',
70
-    'OCA\\User_LDAP\\User\\DeletedUsersIndex' => $baseDir . '/../lib/User/DeletedUsersIndex.php',
71
-    'OCA\\User_LDAP\\User\\Manager' => $baseDir . '/../lib/User/Manager.php',
72
-    'OCA\\User_LDAP\\User\\OfflineUser' => $baseDir . '/../lib/User/OfflineUser.php',
73
-    'OCA\\User_LDAP\\User\\User' => $baseDir . '/../lib/User/User.php',
74
-    'OCA\\User_LDAP\\User_LDAP' => $baseDir . '/../lib/User_LDAP.php',
75
-    'OCA\\User_LDAP\\User_Proxy' => $baseDir . '/../lib/User_Proxy.php',
76
-    'OCA\\User_LDAP\\Wizard' => $baseDir . '/../lib/Wizard.php',
77
-    'OCA\\User_LDAP\\WizardResult' => $baseDir . '/../lib/WizardResult.php',
9
+    'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php',
10
+    'OCA\\User_LDAP\\Access' => $baseDir.'/../lib/Access.php',
11
+    'OCA\\User_LDAP\\AccessFactory' => $baseDir.'/../lib/AccessFactory.php',
12
+    'OCA\\User_LDAP\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
13
+    'OCA\\User_LDAP\\BackendUtility' => $baseDir.'/../lib/BackendUtility.php',
14
+    'OCA\\User_LDAP\\Command\\CheckUser' => $baseDir.'/../lib/Command/CheckUser.php',
15
+    'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => $baseDir.'/../lib/Command/CreateEmptyConfig.php',
16
+    'OCA\\User_LDAP\\Command\\DeleteConfig' => $baseDir.'/../lib/Command/DeleteConfig.php',
17
+    'OCA\\User_LDAP\\Command\\ResetUser' => $baseDir.'/../lib/Command/ResetUser.php',
18
+    'OCA\\User_LDAP\\Command\\Search' => $baseDir.'/../lib/Command/Search.php',
19
+    'OCA\\User_LDAP\\Command\\SetConfig' => $baseDir.'/../lib/Command/SetConfig.php',
20
+    'OCA\\User_LDAP\\Command\\ShowConfig' => $baseDir.'/../lib/Command/ShowConfig.php',
21
+    'OCA\\User_LDAP\\Command\\ShowRemnants' => $baseDir.'/../lib/Command/ShowRemnants.php',
22
+    'OCA\\User_LDAP\\Command\\TestConfig' => $baseDir.'/../lib/Command/TestConfig.php',
23
+    'OCA\\User_LDAP\\Configuration' => $baseDir.'/../lib/Configuration.php',
24
+    'OCA\\User_LDAP\\Connection' => $baseDir.'/../lib/Connection.php',
25
+    'OCA\\User_LDAP\\ConnectionFactory' => $baseDir.'/../lib/ConnectionFactory.php',
26
+    'OCA\\User_LDAP\\Controller\\ConfigAPIController' => $baseDir.'/../lib/Controller/ConfigAPIController.php',
27
+    'OCA\\User_LDAP\\Controller\\RenewPasswordController' => $baseDir.'/../lib/Controller/RenewPasswordController.php',
28
+    'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => $baseDir.'/../lib/Events/GroupBackendRegistered.php',
29
+    'OCA\\User_LDAP\\Events\\UserBackendRegistered' => $baseDir.'/../lib/Events/UserBackendRegistered.php',
30
+    'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => $baseDir.'/../lib/Exceptions/AttributeNotSet.php',
31
+    'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => $baseDir.'/../lib/Exceptions/ConstraintViolationException.php',
32
+    'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => $baseDir.'/../lib/Exceptions/NotOnLDAP.php',
33
+    'OCA\\User_LDAP\\FilesystemHelper' => $baseDir.'/../lib/FilesystemHelper.php',
34
+    'OCA\\User_LDAP\\GroupPluginManager' => $baseDir.'/../lib/GroupPluginManager.php',
35
+    'OCA\\User_LDAP\\Group_LDAP' => $baseDir.'/../lib/Group_LDAP.php',
36
+    'OCA\\User_LDAP\\Group_Proxy' => $baseDir.'/../lib/Group_Proxy.php',
37
+    'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => $baseDir.'/../lib/Handler/ExtStorageConfigHandler.php',
38
+    'OCA\\User_LDAP\\Helper' => $baseDir.'/../lib/Helper.php',
39
+    'OCA\\User_LDAP\\IGroupLDAP' => $baseDir.'/../lib/IGroupLDAP.php',
40
+    'OCA\\User_LDAP\\ILDAPGroupPlugin' => $baseDir.'/../lib/ILDAPGroupPlugin.php',
41
+    'OCA\\User_LDAP\\ILDAPUserPlugin' => $baseDir.'/../lib/ILDAPUserPlugin.php',
42
+    'OCA\\User_LDAP\\ILDAPWrapper' => $baseDir.'/../lib/ILDAPWrapper.php',
43
+    'OCA\\User_LDAP\\IUserLDAP' => $baseDir.'/../lib/IUserLDAP.php',
44
+    'OCA\\User_LDAP\\Jobs\\CleanUp' => $baseDir.'/../lib/Jobs/CleanUp.php',
45
+    'OCA\\User_LDAP\\Jobs\\Sync' => $baseDir.'/../lib/Jobs/Sync.php',
46
+    'OCA\\User_LDAP\\Jobs\\UpdateGroups' => $baseDir.'/../lib/Jobs/UpdateGroups.php',
47
+    'OCA\\User_LDAP\\LDAP' => $baseDir.'/../lib/LDAP.php',
48
+    'OCA\\User_LDAP\\LDAPProvider' => $baseDir.'/../lib/LDAPProvider.php',
49
+    'OCA\\User_LDAP\\LDAPProviderFactory' => $baseDir.'/../lib/LDAPProviderFactory.php',
50
+    'OCA\\User_LDAP\\LDAPUtility' => $baseDir.'/../lib/LDAPUtility.php',
51
+    'OCA\\User_LDAP\\LogWrapper' => $baseDir.'/../lib/LogWrapper.php',
52
+    'OCA\\User_LDAP\\Mapping\\AbstractMapping' => $baseDir.'/../lib/Mapping/AbstractMapping.php',
53
+    'OCA\\User_LDAP\\Mapping\\GroupMapping' => $baseDir.'/../lib/Mapping/GroupMapping.php',
54
+    'OCA\\User_LDAP\\Mapping\\UserMapping' => $baseDir.'/../lib/Mapping/UserMapping.php',
55
+    'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => $baseDir.'/../lib/Migration/RemoveRefreshTime.php',
56
+    'OCA\\User_LDAP\\Migration\\SetDefaultProvider' => $baseDir.'/../lib/Migration/SetDefaultProvider.php',
57
+    'OCA\\User_LDAP\\Migration\\UUIDFix' => $baseDir.'/../lib/Migration/UUIDFix.php',
58
+    'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir.'/../lib/Migration/UUIDFixGroup.php',
59
+    'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir.'/../lib/Migration/UUIDFixInsert.php',
60
+    'OCA\\User_LDAP\\Migration\\UUIDFixUser' => $baseDir.'/../lib/Migration/UUIDFixUser.php',
61
+    'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => $baseDir.'/../lib/Migration/Version1010Date20200630192842.php',
62
+    'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php',
63
+    'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir.'/../lib/PagedResults/IAdapter.php',
64
+    'OCA\\User_LDAP\\PagedResults\\Php73' => $baseDir.'/../lib/PagedResults/Php73.php',
65
+    'OCA\\User_LDAP\\PagedResults\\TLinkId' => $baseDir.'/../lib/PagedResults/TLinkId.php',
66
+    'OCA\\User_LDAP\\Proxy' => $baseDir.'/../lib/Proxy.php',
67
+    'OCA\\User_LDAP\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php',
68
+    'OCA\\User_LDAP\\Settings\\Section' => $baseDir.'/../lib/Settings/Section.php',
69
+    'OCA\\User_LDAP\\UserPluginManager' => $baseDir.'/../lib/UserPluginManager.php',
70
+    'OCA\\User_LDAP\\User\\DeletedUsersIndex' => $baseDir.'/../lib/User/DeletedUsersIndex.php',
71
+    'OCA\\User_LDAP\\User\\Manager' => $baseDir.'/../lib/User/Manager.php',
72
+    'OCA\\User_LDAP\\User\\OfflineUser' => $baseDir.'/../lib/User/OfflineUser.php',
73
+    'OCA\\User_LDAP\\User\\User' => $baseDir.'/../lib/User/User.php',
74
+    'OCA\\User_LDAP\\User_LDAP' => $baseDir.'/../lib/User_LDAP.php',
75
+    'OCA\\User_LDAP\\User_Proxy' => $baseDir.'/../lib/User_Proxy.php',
76
+    'OCA\\User_LDAP\\Wizard' => $baseDir.'/../lib/Wizard.php',
77
+    'OCA\\User_LDAP\\WizardResult' => $baseDir.'/../lib/WizardResult.php',
78 78
 );
Please login to merge, or discard this patch.
apps/user_ldap/composer/composer/autoload_static.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -6,95 +6,95 @@
 block discarded – undo
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
-        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
25
-        'OCA\\User_LDAP\\Access' => __DIR__ . '/..' . '/../lib/Access.php',
26
-        'OCA\\User_LDAP\\AccessFactory' => __DIR__ . '/..' . '/../lib/AccessFactory.php',
27
-        'OCA\\User_LDAP\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
28
-        'OCA\\User_LDAP\\BackendUtility' => __DIR__ . '/..' . '/../lib/BackendUtility.php',
29
-        'OCA\\User_LDAP\\Command\\CheckUser' => __DIR__ . '/..' . '/../lib/Command/CheckUser.php',
30
-        'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => __DIR__ . '/..' . '/../lib/Command/CreateEmptyConfig.php',
31
-        'OCA\\User_LDAP\\Command\\DeleteConfig' => __DIR__ . '/..' . '/../lib/Command/DeleteConfig.php',
32
-        'OCA\\User_LDAP\\Command\\ResetUser' => __DIR__ . '/..' . '/../lib/Command/ResetUser.php',
33
-        'OCA\\User_LDAP\\Command\\Search' => __DIR__ . '/..' . '/../lib/Command/Search.php',
34
-        'OCA\\User_LDAP\\Command\\SetConfig' => __DIR__ . '/..' . '/../lib/Command/SetConfig.php',
35
-        'OCA\\User_LDAP\\Command\\ShowConfig' => __DIR__ . '/..' . '/../lib/Command/ShowConfig.php',
36
-        'OCA\\User_LDAP\\Command\\ShowRemnants' => __DIR__ . '/..' . '/../lib/Command/ShowRemnants.php',
37
-        'OCA\\User_LDAP\\Command\\TestConfig' => __DIR__ . '/..' . '/../lib/Command/TestConfig.php',
38
-        'OCA\\User_LDAP\\Configuration' => __DIR__ . '/..' . '/../lib/Configuration.php',
39
-        'OCA\\User_LDAP\\Connection' => __DIR__ . '/..' . '/../lib/Connection.php',
40
-        'OCA\\User_LDAP\\ConnectionFactory' => __DIR__ . '/..' . '/../lib/ConnectionFactory.php',
41
-        'OCA\\User_LDAP\\Controller\\ConfigAPIController' => __DIR__ . '/..' . '/../lib/Controller/ConfigAPIController.php',
42
-        'OCA\\User_LDAP\\Controller\\RenewPasswordController' => __DIR__ . '/..' . '/../lib/Controller/RenewPasswordController.php',
43
-        'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => __DIR__ . '/..' . '/../lib/Events/GroupBackendRegistered.php',
44
-        'OCA\\User_LDAP\\Events\\UserBackendRegistered' => __DIR__ . '/..' . '/../lib/Events/UserBackendRegistered.php',
45
-        'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => __DIR__ . '/..' . '/../lib/Exceptions/AttributeNotSet.php',
46
-        'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => __DIR__ . '/..' . '/../lib/Exceptions/ConstraintViolationException.php',
47
-        'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => __DIR__ . '/..' . '/../lib/Exceptions/NotOnLDAP.php',
48
-        'OCA\\User_LDAP\\FilesystemHelper' => __DIR__ . '/..' . '/../lib/FilesystemHelper.php',
49
-        'OCA\\User_LDAP\\GroupPluginManager' => __DIR__ . '/..' . '/../lib/GroupPluginManager.php',
50
-        'OCA\\User_LDAP\\Group_LDAP' => __DIR__ . '/..' . '/../lib/Group_LDAP.php',
51
-        'OCA\\User_LDAP\\Group_Proxy' => __DIR__ . '/..' . '/../lib/Group_Proxy.php',
52
-        'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => __DIR__ . '/..' . '/../lib/Handler/ExtStorageConfigHandler.php',
53
-        'OCA\\User_LDAP\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
54
-        'OCA\\User_LDAP\\IGroupLDAP' => __DIR__ . '/..' . '/../lib/IGroupLDAP.php',
55
-        'OCA\\User_LDAP\\ILDAPGroupPlugin' => __DIR__ . '/..' . '/../lib/ILDAPGroupPlugin.php',
56
-        'OCA\\User_LDAP\\ILDAPUserPlugin' => __DIR__ . '/..' . '/../lib/ILDAPUserPlugin.php',
57
-        'OCA\\User_LDAP\\ILDAPWrapper' => __DIR__ . '/..' . '/../lib/ILDAPWrapper.php',
58
-        'OCA\\User_LDAP\\IUserLDAP' => __DIR__ . '/..' . '/../lib/IUserLDAP.php',
59
-        'OCA\\User_LDAP\\Jobs\\CleanUp' => __DIR__ . '/..' . '/../lib/Jobs/CleanUp.php',
60
-        'OCA\\User_LDAP\\Jobs\\Sync' => __DIR__ . '/..' . '/../lib/Jobs/Sync.php',
61
-        'OCA\\User_LDAP\\Jobs\\UpdateGroups' => __DIR__ . '/..' . '/../lib/Jobs/UpdateGroups.php',
62
-        'OCA\\User_LDAP\\LDAP' => __DIR__ . '/..' . '/../lib/LDAP.php',
63
-        'OCA\\User_LDAP\\LDAPProvider' => __DIR__ . '/..' . '/../lib/LDAPProvider.php',
64
-        'OCA\\User_LDAP\\LDAPProviderFactory' => __DIR__ . '/..' . '/../lib/LDAPProviderFactory.php',
65
-        'OCA\\User_LDAP\\LDAPUtility' => __DIR__ . '/..' . '/../lib/LDAPUtility.php',
66
-        'OCA\\User_LDAP\\LogWrapper' => __DIR__ . '/..' . '/../lib/LogWrapper.php',
67
-        'OCA\\User_LDAP\\Mapping\\AbstractMapping' => __DIR__ . '/..' . '/../lib/Mapping/AbstractMapping.php',
68
-        'OCA\\User_LDAP\\Mapping\\GroupMapping' => __DIR__ . '/..' . '/../lib/Mapping/GroupMapping.php',
69
-        'OCA\\User_LDAP\\Mapping\\UserMapping' => __DIR__ . '/..' . '/../lib/Mapping/UserMapping.php',
70
-        'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => __DIR__ . '/..' . '/../lib/Migration/RemoveRefreshTime.php',
71
-        'OCA\\User_LDAP\\Migration\\SetDefaultProvider' => __DIR__ . '/..' . '/../lib/Migration/SetDefaultProvider.php',
72
-        'OCA\\User_LDAP\\Migration\\UUIDFix' => __DIR__ . '/..' . '/../lib/Migration/UUIDFix.php',
73
-        'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixGroup.php',
74
-        'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixInsert.php',
75
-        'OCA\\User_LDAP\\Migration\\UUIDFixUser' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixUser.php',
76
-        'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630192842.php',
77
-        'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
78
-        'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__ . '/..' . '/../lib/PagedResults/IAdapter.php',
79
-        'OCA\\User_LDAP\\PagedResults\\Php73' => __DIR__ . '/..' . '/../lib/PagedResults/Php73.php',
80
-        'OCA\\User_LDAP\\PagedResults\\TLinkId' => __DIR__ . '/..' . '/../lib/PagedResults/TLinkId.php',
81
-        'OCA\\User_LDAP\\Proxy' => __DIR__ . '/..' . '/../lib/Proxy.php',
82
-        'OCA\\User_LDAP\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',
83
-        'OCA\\User_LDAP\\Settings\\Section' => __DIR__ . '/..' . '/../lib/Settings/Section.php',
84
-        'OCA\\User_LDAP\\UserPluginManager' => __DIR__ . '/..' . '/../lib/UserPluginManager.php',
85
-        'OCA\\User_LDAP\\User\\DeletedUsersIndex' => __DIR__ . '/..' . '/../lib/User/DeletedUsersIndex.php',
86
-        'OCA\\User_LDAP\\User\\Manager' => __DIR__ . '/..' . '/../lib/User/Manager.php',
87
-        'OCA\\User_LDAP\\User\\OfflineUser' => __DIR__ . '/..' . '/../lib/User/OfflineUser.php',
88
-        'OCA\\User_LDAP\\User\\User' => __DIR__ . '/..' . '/../lib/User/User.php',
89
-        'OCA\\User_LDAP\\User_LDAP' => __DIR__ . '/..' . '/../lib/User_LDAP.php',
90
-        'OCA\\User_LDAP\\User_Proxy' => __DIR__ . '/..' . '/../lib/User_Proxy.php',
91
-        'OCA\\User_LDAP\\Wizard' => __DIR__ . '/..' . '/../lib/Wizard.php',
92
-        'OCA\\User_LDAP\\WizardResult' => __DIR__ . '/..' . '/../lib/WizardResult.php',
23
+    public static $classMap = array(
24
+        'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php',
25
+        'OCA\\User_LDAP\\Access' => __DIR__.'/..'.'/../lib/Access.php',
26
+        'OCA\\User_LDAP\\AccessFactory' => __DIR__.'/..'.'/../lib/AccessFactory.php',
27
+        'OCA\\User_LDAP\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
28
+        'OCA\\User_LDAP\\BackendUtility' => __DIR__.'/..'.'/../lib/BackendUtility.php',
29
+        'OCA\\User_LDAP\\Command\\CheckUser' => __DIR__.'/..'.'/../lib/Command/CheckUser.php',
30
+        'OCA\\User_LDAP\\Command\\CreateEmptyConfig' => __DIR__.'/..'.'/../lib/Command/CreateEmptyConfig.php',
31
+        'OCA\\User_LDAP\\Command\\DeleteConfig' => __DIR__.'/..'.'/../lib/Command/DeleteConfig.php',
32
+        'OCA\\User_LDAP\\Command\\ResetUser' => __DIR__.'/..'.'/../lib/Command/ResetUser.php',
33
+        'OCA\\User_LDAP\\Command\\Search' => __DIR__.'/..'.'/../lib/Command/Search.php',
34
+        'OCA\\User_LDAP\\Command\\SetConfig' => __DIR__.'/..'.'/../lib/Command/SetConfig.php',
35
+        'OCA\\User_LDAP\\Command\\ShowConfig' => __DIR__.'/..'.'/../lib/Command/ShowConfig.php',
36
+        'OCA\\User_LDAP\\Command\\ShowRemnants' => __DIR__.'/..'.'/../lib/Command/ShowRemnants.php',
37
+        'OCA\\User_LDAP\\Command\\TestConfig' => __DIR__.'/..'.'/../lib/Command/TestConfig.php',
38
+        'OCA\\User_LDAP\\Configuration' => __DIR__.'/..'.'/../lib/Configuration.php',
39
+        'OCA\\User_LDAP\\Connection' => __DIR__.'/..'.'/../lib/Connection.php',
40
+        'OCA\\User_LDAP\\ConnectionFactory' => __DIR__.'/..'.'/../lib/ConnectionFactory.php',
41
+        'OCA\\User_LDAP\\Controller\\ConfigAPIController' => __DIR__.'/..'.'/../lib/Controller/ConfigAPIController.php',
42
+        'OCA\\User_LDAP\\Controller\\RenewPasswordController' => __DIR__.'/..'.'/../lib/Controller/RenewPasswordController.php',
43
+        'OCA\\User_LDAP\\Events\\GroupBackendRegistered' => __DIR__.'/..'.'/../lib/Events/GroupBackendRegistered.php',
44
+        'OCA\\User_LDAP\\Events\\UserBackendRegistered' => __DIR__.'/..'.'/../lib/Events/UserBackendRegistered.php',
45
+        'OCA\\User_LDAP\\Exceptions\\AttributeNotSet' => __DIR__.'/..'.'/../lib/Exceptions/AttributeNotSet.php',
46
+        'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => __DIR__.'/..'.'/../lib/Exceptions/ConstraintViolationException.php',
47
+        'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => __DIR__.'/..'.'/../lib/Exceptions/NotOnLDAP.php',
48
+        'OCA\\User_LDAP\\FilesystemHelper' => __DIR__.'/..'.'/../lib/FilesystemHelper.php',
49
+        'OCA\\User_LDAP\\GroupPluginManager' => __DIR__.'/..'.'/../lib/GroupPluginManager.php',
50
+        'OCA\\User_LDAP\\Group_LDAP' => __DIR__.'/..'.'/../lib/Group_LDAP.php',
51
+        'OCA\\User_LDAP\\Group_Proxy' => __DIR__.'/..'.'/../lib/Group_Proxy.php',
52
+        'OCA\\User_LDAP\\Handler\\ExtStorageConfigHandler' => __DIR__.'/..'.'/../lib/Handler/ExtStorageConfigHandler.php',
53
+        'OCA\\User_LDAP\\Helper' => __DIR__.'/..'.'/../lib/Helper.php',
54
+        'OCA\\User_LDAP\\IGroupLDAP' => __DIR__.'/..'.'/../lib/IGroupLDAP.php',
55
+        'OCA\\User_LDAP\\ILDAPGroupPlugin' => __DIR__.'/..'.'/../lib/ILDAPGroupPlugin.php',
56
+        'OCA\\User_LDAP\\ILDAPUserPlugin' => __DIR__.'/..'.'/../lib/ILDAPUserPlugin.php',
57
+        'OCA\\User_LDAP\\ILDAPWrapper' => __DIR__.'/..'.'/../lib/ILDAPWrapper.php',
58
+        'OCA\\User_LDAP\\IUserLDAP' => __DIR__.'/..'.'/../lib/IUserLDAP.php',
59
+        'OCA\\User_LDAP\\Jobs\\CleanUp' => __DIR__.'/..'.'/../lib/Jobs/CleanUp.php',
60
+        'OCA\\User_LDAP\\Jobs\\Sync' => __DIR__.'/..'.'/../lib/Jobs/Sync.php',
61
+        'OCA\\User_LDAP\\Jobs\\UpdateGroups' => __DIR__.'/..'.'/../lib/Jobs/UpdateGroups.php',
62
+        'OCA\\User_LDAP\\LDAP' => __DIR__.'/..'.'/../lib/LDAP.php',
63
+        'OCA\\User_LDAP\\LDAPProvider' => __DIR__.'/..'.'/../lib/LDAPProvider.php',
64
+        'OCA\\User_LDAP\\LDAPProviderFactory' => __DIR__.'/..'.'/../lib/LDAPProviderFactory.php',
65
+        'OCA\\User_LDAP\\LDAPUtility' => __DIR__.'/..'.'/../lib/LDAPUtility.php',
66
+        'OCA\\User_LDAP\\LogWrapper' => __DIR__.'/..'.'/../lib/LogWrapper.php',
67
+        'OCA\\User_LDAP\\Mapping\\AbstractMapping' => __DIR__.'/..'.'/../lib/Mapping/AbstractMapping.php',
68
+        'OCA\\User_LDAP\\Mapping\\GroupMapping' => __DIR__.'/..'.'/../lib/Mapping/GroupMapping.php',
69
+        'OCA\\User_LDAP\\Mapping\\UserMapping' => __DIR__.'/..'.'/../lib/Mapping/UserMapping.php',
70
+        'OCA\\User_LDAP\\Migration\\RemoveRefreshTime' => __DIR__.'/..'.'/../lib/Migration/RemoveRefreshTime.php',
71
+        'OCA\\User_LDAP\\Migration\\SetDefaultProvider' => __DIR__.'/..'.'/../lib/Migration/SetDefaultProvider.php',
72
+        'OCA\\User_LDAP\\Migration\\UUIDFix' => __DIR__.'/..'.'/../lib/Migration/UUIDFix.php',
73
+        'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__.'/..'.'/../lib/Migration/UUIDFixGroup.php',
74
+        'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__.'/..'.'/../lib/Migration/UUIDFixInsert.php',
75
+        'OCA\\User_LDAP\\Migration\\UUIDFixUser' => __DIR__.'/..'.'/../lib/Migration/UUIDFixUser.php',
76
+        'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => __DIR__.'/..'.'/../lib/Migration/Version1010Date20200630192842.php',
77
+        'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php',
78
+        'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__.'/..'.'/../lib/PagedResults/IAdapter.php',
79
+        'OCA\\User_LDAP\\PagedResults\\Php73' => __DIR__.'/..'.'/../lib/PagedResults/Php73.php',
80
+        'OCA\\User_LDAP\\PagedResults\\TLinkId' => __DIR__.'/..'.'/../lib/PagedResults/TLinkId.php',
81
+        'OCA\\User_LDAP\\Proxy' => __DIR__.'/..'.'/../lib/Proxy.php',
82
+        'OCA\\User_LDAP\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php',
83
+        'OCA\\User_LDAP\\Settings\\Section' => __DIR__.'/..'.'/../lib/Settings/Section.php',
84
+        'OCA\\User_LDAP\\UserPluginManager' => __DIR__.'/..'.'/../lib/UserPluginManager.php',
85
+        'OCA\\User_LDAP\\User\\DeletedUsersIndex' => __DIR__.'/..'.'/../lib/User/DeletedUsersIndex.php',
86
+        'OCA\\User_LDAP\\User\\Manager' => __DIR__.'/..'.'/../lib/User/Manager.php',
87
+        'OCA\\User_LDAP\\User\\OfflineUser' => __DIR__.'/..'.'/../lib/User/OfflineUser.php',
88
+        'OCA\\User_LDAP\\User\\User' => __DIR__.'/..'.'/../lib/User/User.php',
89
+        'OCA\\User_LDAP\\User_LDAP' => __DIR__.'/..'.'/../lib/User_LDAP.php',
90
+        'OCA\\User_LDAP\\User_Proxy' => __DIR__.'/..'.'/../lib/User_Proxy.php',
91
+        'OCA\\User_LDAP\\Wizard' => __DIR__.'/..'.'/../lib/Wizard.php',
92
+        'OCA\\User_LDAP\\WizardResult' => __DIR__.'/..'.'/../lib/WizardResult.php',
93 93
     );
94 94
 
95 95
     public static function getInitializer(ClassLoader $loader)
96 96
     {
97
-        return \Closure::bind(function () use ($loader) {
97
+        return \Closure::bind(function() use ($loader) {
98 98
             $loader->prefixLengthsPsr4 = ComposerStaticInitUser_LDAP::$prefixLengthsPsr4;
99 99
             $loader->prefixDirsPsr4 = ComposerStaticInitUser_LDAP::$prefixDirsPsr4;
100 100
             $loader->classMap = ComposerStaticInitUser_LDAP::$classMap;
Please login to merge, or discard this patch.
apps/user_ldap/lib/LDAP.php 1 patch
Indentation   +379 added lines, -379 removed lines patch added patch discarded remove patch
@@ -39,383 +39,383 @@
 block discarded – undo
39 39
 use OCA\User_LDAP\PagedResults\Php73;
40 40
 
41 41
 class LDAP implements ILDAPWrapper {
42
-	protected $curFunc = '';
43
-	protected $curArgs = [];
44
-
45
-	/** @var IAdapter */
46
-	protected $pagedResultsAdapter;
47
-
48
-	public function __construct() {
49
-		$this->pagedResultsAdapter = new Php73();
50
-	}
51
-
52
-	/**
53
-	 * @param resource $link
54
-	 * @param string $dn
55
-	 * @param string $password
56
-	 * @return bool|mixed
57
-	 */
58
-	public function bind($link, $dn, $password) {
59
-		return $this->invokeLDAPMethod('bind', $link, $dn, $password);
60
-	}
61
-
62
-	/**
63
-	 * @param string $host
64
-	 * @param string $port
65
-	 * @return mixed
66
-	 */
67
-	public function connect($host, $port) {
68
-		if (strpos($host, '://') === false) {
69
-			$host = 'ldap://' . $host;
70
-		}
71
-		if (strpos($host, ':', strpos($host, '://') + 1) === false) {
72
-			//ldap_connect ignores port parameter when URLs are passed
73
-			$host .= ':' . $port;
74
-		}
75
-		return $this->invokeLDAPMethod('connect', $host);
76
-	}
77
-
78
-	public function controlPagedResultResponse($link, $result, &$cookie): bool {
79
-		$this->preFunctionCall(
80
-			$this->pagedResultsAdapter->getResponseCallFunc(),
81
-			$this->pagedResultsAdapter->getResponseCallArgs([$link, $result, &$cookie])
82
-		);
83
-
84
-		$result = $this->pagedResultsAdapter->responseCall($link);
85
-		$cookie = $this->pagedResultsAdapter->getCookie($link);
86
-
87
-		if ($this->isResultFalse($result)) {
88
-			$this->postFunctionCall();
89
-		}
90
-
91
-		return $result;
92
-	}
93
-
94
-	/**
95
-	 * @param LDAP $link
96
-	 * @param int $pageSize
97
-	 * @param bool $isCritical
98
-	 * @return mixed|true
99
-	 */
100
-	public function controlPagedResult($link, $pageSize, $isCritical) {
101
-		$fn = $this->pagedResultsAdapter->getRequestCallFunc();
102
-		$this->pagedResultsAdapter->setRequestParameters($link, $pageSize, $isCritical);
103
-		if ($fn === null) {
104
-			return true;
105
-		}
106
-
107
-		$this->preFunctionCall($fn, $this->pagedResultsAdapter->getRequestCallArgs($link));
108
-		$result = $this->pagedResultsAdapter->requestCall($link);
109
-
110
-		if ($this->isResultFalse($result)) {
111
-			$this->postFunctionCall();
112
-		}
113
-
114
-		return $result;
115
-	}
116
-
117
-	/**
118
-	 * @param LDAP $link
119
-	 * @param LDAP $result
120
-	 * @return mixed
121
-	 */
122
-	public function countEntries($link, $result) {
123
-		return $this->invokeLDAPMethod('count_entries', $link, $result);
124
-	}
125
-
126
-	/**
127
-	 * @param LDAP $link
128
-	 * @return integer
129
-	 */
130
-	public function errno($link) {
131
-		return $this->invokeLDAPMethod('errno', $link);
132
-	}
133
-
134
-	/**
135
-	 * @param LDAP $link
136
-	 * @return string
137
-	 */
138
-	public function error($link) {
139
-		return $this->invokeLDAPMethod('error', $link);
140
-	}
141
-
142
-	/**
143
-	 * Splits DN into its component parts
144
-	 * @param string $dn
145
-	 * @param int @withAttrib
146
-	 * @return array|false
147
-	 * @link https://www.php.net/manual/en/function.ldap-explode-dn.php
148
-	 */
149
-	public function explodeDN($dn, $withAttrib) {
150
-		return $this->invokeLDAPMethod('explode_dn', $dn, $withAttrib);
151
-	}
152
-
153
-	/**
154
-	 * @param LDAP $link
155
-	 * @param LDAP $result
156
-	 * @return mixed
157
-	 */
158
-	public function firstEntry($link, $result) {
159
-		return $this->invokeLDAPMethod('first_entry', $link, $result);
160
-	}
161
-
162
-	/**
163
-	 * @param LDAP $link
164
-	 * @param LDAP $result
165
-	 * @return array|mixed
166
-	 */
167
-	public function getAttributes($link, $result) {
168
-		return $this->invokeLDAPMethod('get_attributes', $link, $result);
169
-	}
170
-
171
-	/**
172
-	 * @param LDAP $link
173
-	 * @param LDAP $result
174
-	 * @return mixed|string
175
-	 */
176
-	public function getDN($link, $result) {
177
-		return $this->invokeLDAPMethod('get_dn', $link, $result);
178
-	}
179
-
180
-	/**
181
-	 * @param LDAP $link
182
-	 * @param LDAP $result
183
-	 * @return array|mixed
184
-	 */
185
-	public function getEntries($link, $result) {
186
-		return $this->invokeLDAPMethod('get_entries', $link, $result);
187
-	}
188
-
189
-	/**
190
-	 * @param LDAP $link
191
-	 * @param resource $result
192
-	 * @return mixed
193
-	 */
194
-	public function nextEntry($link, $result) {
195
-		return $this->invokeLDAPMethod('next_entry', $link, $result);
196
-	}
197
-
198
-	/**
199
-	 * @param LDAP $link
200
-	 * @param string $baseDN
201
-	 * @param string $filter
202
-	 * @param array $attr
203
-	 * @return mixed
204
-	 */
205
-	public function read($link, $baseDN, $filter, $attr) {
206
-		$this->pagedResultsAdapter->setReadArgs($link, $baseDN, $filter, $attr);
207
-		return $this->invokeLDAPMethod('read', ...$this->pagedResultsAdapter->getReadArgs($link));
208
-	}
209
-
210
-	/**
211
-	 * @param LDAP $link
212
-	 * @param string[] $baseDN
213
-	 * @param string $filter
214
-	 * @param array $attr
215
-	 * @param int $attrsOnly
216
-	 * @param int $limit
217
-	 * @return mixed
218
-	 * @throws \Exception
219
-	 */
220
-	public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) {
221
-		$oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) {
222
-			if (strpos($message, 'Partial search results returned: Sizelimit exceeded') !== false) {
223
-				return true;
224
-			}
225
-			$oldHandler($no, $message, $file, $line);
226
-			return true;
227
-		});
228
-		try {
229
-			$this->pagedResultsAdapter->setSearchArgs($link, $baseDN, $filter, $attr, $attrsOnly, $limit);
230
-			$result = $this->invokeLDAPMethod('search', ...$this->pagedResultsAdapter->getSearchArgs($link));
231
-
232
-			restore_error_handler();
233
-			return $result;
234
-		} catch (\Exception $e) {
235
-			restore_error_handler();
236
-			throw $e;
237
-		}
238
-	}
239
-
240
-	/**
241
-	 * @param LDAP $link
242
-	 * @param string $userDN
243
-	 * @param string $password
244
-	 * @return bool
245
-	 */
246
-	public function modReplace($link, $userDN, $password) {
247
-		return $this->invokeLDAPMethod('mod_replace', $link, $userDN, ['userPassword' => $password]);
248
-	}
249
-
250
-	/**
251
-	 * @param LDAP $link
252
-	 * @param string $userDN
253
-	 * @param string $oldPassword
254
-	 * @param string $password
255
-	 * @return bool
256
-	 */
257
-	public function exopPasswd($link, $userDN, $oldPassword, $password) {
258
-		return $this->invokeLDAPMethod('exop_passwd', $link, $userDN, $oldPassword, $password);
259
-	}
260
-
261
-	/**
262
-	 * @param LDAP $link
263
-	 * @param string $option
264
-	 * @param int $value
265
-	 * @return bool|mixed
266
-	 */
267
-	public function setOption($link, $option, $value) {
268
-		return $this->invokeLDAPMethod('set_option', $link, $option, $value);
269
-	}
270
-
271
-	/**
272
-	 * @param LDAP $link
273
-	 * @return mixed|true
274
-	 */
275
-	public function startTls($link) {
276
-		return $this->invokeLDAPMethod('start_tls', $link);
277
-	}
278
-
279
-	/**
280
-	 * @param resource $link
281
-	 * @return bool|mixed
282
-	 */
283
-	public function unbind($link) {
284
-		return $this->invokeLDAPMethod('unbind', $link);
285
-	}
286
-
287
-	/**
288
-	 * Checks whether the server supports LDAP
289
-	 * @return boolean if it the case, false otherwise
290
-	 * */
291
-	public function areLDAPFunctionsAvailable() {
292
-		return function_exists('ldap_connect');
293
-	}
294
-
295
-	/**
296
-	 * Checks whether the submitted parameter is a resource
297
-	 * @param Resource $resource the resource variable to check
298
-	 * @return bool true if it is a resource, false otherwise
299
-	 */
300
-	public function isResource($resource) {
301
-		return is_resource($resource);
302
-	}
303
-
304
-	/**
305
-	 * Checks whether the return value from LDAP is wrong or not.
306
-	 *
307
-	 * When using ldap_search we provide an array, in case multiple bases are
308
-	 * configured. Thus, we need to check the array elements.
309
-	 *
310
-	 * @param $result
311
-	 * @return bool
312
-	 */
313
-	protected function isResultFalse($result) {
314
-		if ($result === false) {
315
-			return true;
316
-		}
317
-
318
-		if ($this->curFunc === 'ldap_search' && is_array($result)) {
319
-			foreach ($result as $singleResult) {
320
-				if ($singleResult === false) {
321
-					return true;
322
-				}
323
-			}
324
-		}
325
-
326
-		return false;
327
-	}
328
-
329
-	/**
330
-	 * @return mixed
331
-	 */
332
-	protected function invokeLDAPMethod() {
333
-		$arguments = func_get_args();
334
-		$func = 'ldap_' . array_shift($arguments);
335
-		if (function_exists($func)) {
336
-			$this->preFunctionCall($func, $arguments);
337
-			$result = call_user_func_array($func, $arguments);
338
-			if ($this->isResultFalse($result)) {
339
-				$this->postFunctionCall();
340
-			}
341
-			return $result;
342
-		}
343
-		return null;
344
-	}
345
-
346
-	/**
347
-	 * @param string $functionName
348
-	 * @param array $args
349
-	 */
350
-	private function preFunctionCall($functionName, $args) {
351
-		$this->curFunc = $functionName;
352
-		$this->curArgs = $args;
353
-	}
354
-
355
-	/**
356
-	 * Analyzes the returned LDAP error and acts accordingly if not 0
357
-	 *
358
-	 * @param resource $resource the LDAP Connection resource
359
-	 * @throws ConstraintViolationException
360
-	 * @throws ServerNotAvailableException
361
-	 * @throws \Exception
362
-	 */
363
-	private function processLDAPError($resource) {
364
-		$errorCode = ldap_errno($resource);
365
-		if ($errorCode === 0) {
366
-			return;
367
-		}
368
-		$errorMsg = ldap_error($resource);
369
-
370
-		if ($this->curFunc === 'ldap_get_entries'
371
-			&& $errorCode === -4) {
372
-		} elseif ($errorCode === 32) {
373
-			//for now
374
-		} elseif ($errorCode === 10) {
375
-			//referrals, we switch them off, but then there is AD :)
376
-		} elseif ($errorCode === -1) {
377
-			throw new ServerNotAvailableException('Lost connection to LDAP server.');
378
-		} elseif ($errorCode === 52) {
379
-			throw new ServerNotAvailableException('LDAP server is shutting down.');
380
-		} elseif ($errorCode === 48) {
381
-			throw new \Exception('LDAP authentication method rejected', $errorCode);
382
-		} elseif ($errorCode === 1) {
383
-			throw new \Exception('LDAP Operations error', $errorCode);
384
-		} elseif ($errorCode === 19) {
385
-			ldap_get_option($this->curArgs[0], LDAP_OPT_ERROR_STRING, $extended_error);
386
-			throw new ConstraintViolationException(!empty($extended_error)?$extended_error:$errorMsg, $errorCode);
387
-		} else {
388
-			\OC::$server->getLogger()->debug('LDAP error {message} ({code}) after calling {func}', [
389
-				'app' => 'user_ldap',
390
-				'message' => $errorMsg,
391
-				'code' => $errorCode,
392
-				'func' => $this->curFunc,
393
-			]);
394
-		}
395
-	}
396
-
397
-	/**
398
-	 * Called after an ldap method is run to act on LDAP error if necessary
399
-	 * @throw \Exception
400
-	 */
401
-	private function postFunctionCall() {
402
-		if ($this->isResource($this->curArgs[0])) {
403
-			$resource = $this->curArgs[0];
404
-		} elseif (
405
-			   $this->curFunc === 'ldap_search'
406
-			&& is_array($this->curArgs[0])
407
-			&& $this->isResource($this->curArgs[0][0])
408
-		) {
409
-			// we use always the same LDAP connection resource, is enough to
410
-			// take the first one.
411
-			$resource = $this->curArgs[0][0];
412
-		} else {
413
-			return;
414
-		}
415
-
416
-		$this->processLDAPError($resource);
417
-
418
-		$this->curFunc = '';
419
-		$this->curArgs = [];
420
-	}
42
+    protected $curFunc = '';
43
+    protected $curArgs = [];
44
+
45
+    /** @var IAdapter */
46
+    protected $pagedResultsAdapter;
47
+
48
+    public function __construct() {
49
+        $this->pagedResultsAdapter = new Php73();
50
+    }
51
+
52
+    /**
53
+     * @param resource $link
54
+     * @param string $dn
55
+     * @param string $password
56
+     * @return bool|mixed
57
+     */
58
+    public function bind($link, $dn, $password) {
59
+        return $this->invokeLDAPMethod('bind', $link, $dn, $password);
60
+    }
61
+
62
+    /**
63
+     * @param string $host
64
+     * @param string $port
65
+     * @return mixed
66
+     */
67
+    public function connect($host, $port) {
68
+        if (strpos($host, '://') === false) {
69
+            $host = 'ldap://' . $host;
70
+        }
71
+        if (strpos($host, ':', strpos($host, '://') + 1) === false) {
72
+            //ldap_connect ignores port parameter when URLs are passed
73
+            $host .= ':' . $port;
74
+        }
75
+        return $this->invokeLDAPMethod('connect', $host);
76
+    }
77
+
78
+    public function controlPagedResultResponse($link, $result, &$cookie): bool {
79
+        $this->preFunctionCall(
80
+            $this->pagedResultsAdapter->getResponseCallFunc(),
81
+            $this->pagedResultsAdapter->getResponseCallArgs([$link, $result, &$cookie])
82
+        );
83
+
84
+        $result = $this->pagedResultsAdapter->responseCall($link);
85
+        $cookie = $this->pagedResultsAdapter->getCookie($link);
86
+
87
+        if ($this->isResultFalse($result)) {
88
+            $this->postFunctionCall();
89
+        }
90
+
91
+        return $result;
92
+    }
93
+
94
+    /**
95
+     * @param LDAP $link
96
+     * @param int $pageSize
97
+     * @param bool $isCritical
98
+     * @return mixed|true
99
+     */
100
+    public function controlPagedResult($link, $pageSize, $isCritical) {
101
+        $fn = $this->pagedResultsAdapter->getRequestCallFunc();
102
+        $this->pagedResultsAdapter->setRequestParameters($link, $pageSize, $isCritical);
103
+        if ($fn === null) {
104
+            return true;
105
+        }
106
+
107
+        $this->preFunctionCall($fn, $this->pagedResultsAdapter->getRequestCallArgs($link));
108
+        $result = $this->pagedResultsAdapter->requestCall($link);
109
+
110
+        if ($this->isResultFalse($result)) {
111
+            $this->postFunctionCall();
112
+        }
113
+
114
+        return $result;
115
+    }
116
+
117
+    /**
118
+     * @param LDAP $link
119
+     * @param LDAP $result
120
+     * @return mixed
121
+     */
122
+    public function countEntries($link, $result) {
123
+        return $this->invokeLDAPMethod('count_entries', $link, $result);
124
+    }
125
+
126
+    /**
127
+     * @param LDAP $link
128
+     * @return integer
129
+     */
130
+    public function errno($link) {
131
+        return $this->invokeLDAPMethod('errno', $link);
132
+    }
133
+
134
+    /**
135
+     * @param LDAP $link
136
+     * @return string
137
+     */
138
+    public function error($link) {
139
+        return $this->invokeLDAPMethod('error', $link);
140
+    }
141
+
142
+    /**
143
+     * Splits DN into its component parts
144
+     * @param string $dn
145
+     * @param int @withAttrib
146
+     * @return array|false
147
+     * @link https://www.php.net/manual/en/function.ldap-explode-dn.php
148
+     */
149
+    public function explodeDN($dn, $withAttrib) {
150
+        return $this->invokeLDAPMethod('explode_dn', $dn, $withAttrib);
151
+    }
152
+
153
+    /**
154
+     * @param LDAP $link
155
+     * @param LDAP $result
156
+     * @return mixed
157
+     */
158
+    public function firstEntry($link, $result) {
159
+        return $this->invokeLDAPMethod('first_entry', $link, $result);
160
+    }
161
+
162
+    /**
163
+     * @param LDAP $link
164
+     * @param LDAP $result
165
+     * @return array|mixed
166
+     */
167
+    public function getAttributes($link, $result) {
168
+        return $this->invokeLDAPMethod('get_attributes', $link, $result);
169
+    }
170
+
171
+    /**
172
+     * @param LDAP $link
173
+     * @param LDAP $result
174
+     * @return mixed|string
175
+     */
176
+    public function getDN($link, $result) {
177
+        return $this->invokeLDAPMethod('get_dn', $link, $result);
178
+    }
179
+
180
+    /**
181
+     * @param LDAP $link
182
+     * @param LDAP $result
183
+     * @return array|mixed
184
+     */
185
+    public function getEntries($link, $result) {
186
+        return $this->invokeLDAPMethod('get_entries', $link, $result);
187
+    }
188
+
189
+    /**
190
+     * @param LDAP $link
191
+     * @param resource $result
192
+     * @return mixed
193
+     */
194
+    public function nextEntry($link, $result) {
195
+        return $this->invokeLDAPMethod('next_entry', $link, $result);
196
+    }
197
+
198
+    /**
199
+     * @param LDAP $link
200
+     * @param string $baseDN
201
+     * @param string $filter
202
+     * @param array $attr
203
+     * @return mixed
204
+     */
205
+    public function read($link, $baseDN, $filter, $attr) {
206
+        $this->pagedResultsAdapter->setReadArgs($link, $baseDN, $filter, $attr);
207
+        return $this->invokeLDAPMethod('read', ...$this->pagedResultsAdapter->getReadArgs($link));
208
+    }
209
+
210
+    /**
211
+     * @param LDAP $link
212
+     * @param string[] $baseDN
213
+     * @param string $filter
214
+     * @param array $attr
215
+     * @param int $attrsOnly
216
+     * @param int $limit
217
+     * @return mixed
218
+     * @throws \Exception
219
+     */
220
+    public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) {
221
+        $oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) {
222
+            if (strpos($message, 'Partial search results returned: Sizelimit exceeded') !== false) {
223
+                return true;
224
+            }
225
+            $oldHandler($no, $message, $file, $line);
226
+            return true;
227
+        });
228
+        try {
229
+            $this->pagedResultsAdapter->setSearchArgs($link, $baseDN, $filter, $attr, $attrsOnly, $limit);
230
+            $result = $this->invokeLDAPMethod('search', ...$this->pagedResultsAdapter->getSearchArgs($link));
231
+
232
+            restore_error_handler();
233
+            return $result;
234
+        } catch (\Exception $e) {
235
+            restore_error_handler();
236
+            throw $e;
237
+        }
238
+    }
239
+
240
+    /**
241
+     * @param LDAP $link
242
+     * @param string $userDN
243
+     * @param string $password
244
+     * @return bool
245
+     */
246
+    public function modReplace($link, $userDN, $password) {
247
+        return $this->invokeLDAPMethod('mod_replace', $link, $userDN, ['userPassword' => $password]);
248
+    }
249
+
250
+    /**
251
+     * @param LDAP $link
252
+     * @param string $userDN
253
+     * @param string $oldPassword
254
+     * @param string $password
255
+     * @return bool
256
+     */
257
+    public function exopPasswd($link, $userDN, $oldPassword, $password) {
258
+        return $this->invokeLDAPMethod('exop_passwd', $link, $userDN, $oldPassword, $password);
259
+    }
260
+
261
+    /**
262
+     * @param LDAP $link
263
+     * @param string $option
264
+     * @param int $value
265
+     * @return bool|mixed
266
+     */
267
+    public function setOption($link, $option, $value) {
268
+        return $this->invokeLDAPMethod('set_option', $link, $option, $value);
269
+    }
270
+
271
+    /**
272
+     * @param LDAP $link
273
+     * @return mixed|true
274
+     */
275
+    public function startTls($link) {
276
+        return $this->invokeLDAPMethod('start_tls', $link);
277
+    }
278
+
279
+    /**
280
+     * @param resource $link
281
+     * @return bool|mixed
282
+     */
283
+    public function unbind($link) {
284
+        return $this->invokeLDAPMethod('unbind', $link);
285
+    }
286
+
287
+    /**
288
+     * Checks whether the server supports LDAP
289
+     * @return boolean if it the case, false otherwise
290
+     * */
291
+    public function areLDAPFunctionsAvailable() {
292
+        return function_exists('ldap_connect');
293
+    }
294
+
295
+    /**
296
+     * Checks whether the submitted parameter is a resource
297
+     * @param Resource $resource the resource variable to check
298
+     * @return bool true if it is a resource, false otherwise
299
+     */
300
+    public function isResource($resource) {
301
+        return is_resource($resource);
302
+    }
303
+
304
+    /**
305
+     * Checks whether the return value from LDAP is wrong or not.
306
+     *
307
+     * When using ldap_search we provide an array, in case multiple bases are
308
+     * configured. Thus, we need to check the array elements.
309
+     *
310
+     * @param $result
311
+     * @return bool
312
+     */
313
+    protected function isResultFalse($result) {
314
+        if ($result === false) {
315
+            return true;
316
+        }
317
+
318
+        if ($this->curFunc === 'ldap_search' && is_array($result)) {
319
+            foreach ($result as $singleResult) {
320
+                if ($singleResult === false) {
321
+                    return true;
322
+                }
323
+            }
324
+        }
325
+
326
+        return false;
327
+    }
328
+
329
+    /**
330
+     * @return mixed
331
+     */
332
+    protected function invokeLDAPMethod() {
333
+        $arguments = func_get_args();
334
+        $func = 'ldap_' . array_shift($arguments);
335
+        if (function_exists($func)) {
336
+            $this->preFunctionCall($func, $arguments);
337
+            $result = call_user_func_array($func, $arguments);
338
+            if ($this->isResultFalse($result)) {
339
+                $this->postFunctionCall();
340
+            }
341
+            return $result;
342
+        }
343
+        return null;
344
+    }
345
+
346
+    /**
347
+     * @param string $functionName
348
+     * @param array $args
349
+     */
350
+    private function preFunctionCall($functionName, $args) {
351
+        $this->curFunc = $functionName;
352
+        $this->curArgs = $args;
353
+    }
354
+
355
+    /**
356
+     * Analyzes the returned LDAP error and acts accordingly if not 0
357
+     *
358
+     * @param resource $resource the LDAP Connection resource
359
+     * @throws ConstraintViolationException
360
+     * @throws ServerNotAvailableException
361
+     * @throws \Exception
362
+     */
363
+    private function processLDAPError($resource) {
364
+        $errorCode = ldap_errno($resource);
365
+        if ($errorCode === 0) {
366
+            return;
367
+        }
368
+        $errorMsg = ldap_error($resource);
369
+
370
+        if ($this->curFunc === 'ldap_get_entries'
371
+            && $errorCode === -4) {
372
+        } elseif ($errorCode === 32) {
373
+            //for now
374
+        } elseif ($errorCode === 10) {
375
+            //referrals, we switch them off, but then there is AD :)
376
+        } elseif ($errorCode === -1) {
377
+            throw new ServerNotAvailableException('Lost connection to LDAP server.');
378
+        } elseif ($errorCode === 52) {
379
+            throw new ServerNotAvailableException('LDAP server is shutting down.');
380
+        } elseif ($errorCode === 48) {
381
+            throw new \Exception('LDAP authentication method rejected', $errorCode);
382
+        } elseif ($errorCode === 1) {
383
+            throw new \Exception('LDAP Operations error', $errorCode);
384
+        } elseif ($errorCode === 19) {
385
+            ldap_get_option($this->curArgs[0], LDAP_OPT_ERROR_STRING, $extended_error);
386
+            throw new ConstraintViolationException(!empty($extended_error)?$extended_error:$errorMsg, $errorCode);
387
+        } else {
388
+            \OC::$server->getLogger()->debug('LDAP error {message} ({code}) after calling {func}', [
389
+                'app' => 'user_ldap',
390
+                'message' => $errorMsg,
391
+                'code' => $errorCode,
392
+                'func' => $this->curFunc,
393
+            ]);
394
+        }
395
+    }
396
+
397
+    /**
398
+     * Called after an ldap method is run to act on LDAP error if necessary
399
+     * @throw \Exception
400
+     */
401
+    private function postFunctionCall() {
402
+        if ($this->isResource($this->curArgs[0])) {
403
+            $resource = $this->curArgs[0];
404
+        } elseif (
405
+                $this->curFunc === 'ldap_search'
406
+            && is_array($this->curArgs[0])
407
+            && $this->isResource($this->curArgs[0][0])
408
+        ) {
409
+            // we use always the same LDAP connection resource, is enough to
410
+            // take the first one.
411
+            $resource = $this->curArgs[0][0];
412
+        } else {
413
+            return;
414
+        }
415
+
416
+        $this->processLDAPError($resource);
417
+
418
+        $this->curFunc = '';
419
+        $this->curArgs = [];
420
+    }
421 421
 }
Please login to merge, or discard this patch.