diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-05-25 17:11:10 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-25 17:11:10 +0200 |
commit | 379f8a1e4538a76d4b9bbc4adf0ebe7b12b1d104 (patch) | |
tree | 49cd75f97d2fa84851ff7604259acbcdb438d115 | |
parent | 2bddf71f2286aa461fc5b5412343e002206d0abe (diff) | |
parent | 2c0743c46b8c338538a80e7e6bd01c33c59bacc6 (diff) | |
download | nextcloud-server-379f8a1e4538a76d4b9bbc4adf0ebe7b12b1d104.tar.gz nextcloud-server-379f8a1e4538a76d4b9bbc4adf0ebe7b12b1d104.zip |
Merge pull request #24604 from owncloud/user_ldap-psr4
Move user_ldap to PSR-4
-rw-r--r-- | apps/user_ldap/ajax/deleteConfiguration.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/ajax/getConfiguration.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/ajax/getNewServerConfigPrefix.php | 8 | ||||
-rw-r--r-- | apps/user_ldap/ajax/setConfiguration.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/ajax/testConfiguration.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/ajax/wizard.php | 18 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/app.php | 24 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/info.xml | 6 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/register_command.php | 24 | ||||
-rw-r--r-- | apps/user_ldap/lib/Access.php (renamed from apps/user_ldap/lib/access.php) | 20 | ||||
-rw-r--r-- | apps/user_ldap/lib/BackendUtility.php (renamed from apps/user_ldap/lib/backendutility.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/CheckUser.php (renamed from apps/user_ldap/command/checkuser.php) | 23 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/CreateEmptyConfig.php (renamed from apps/user_ldap/command/createemptyconfig.php) | 10 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/DeleteConfig.php (renamed from apps/user_ldap/command/deleteconfig.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/Search.php (renamed from apps/user_ldap/command/search.php) | 10 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/SetConfig.php (renamed from apps/user_ldap/command/setconfig.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/ShowConfig.php (renamed from apps/user_ldap/command/showconfig.php) | 8 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/ShowRemnants.php (renamed from apps/user_ldap/command/showremnants.php) | 12 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/TestConfig.php (renamed from apps/user_ldap/command/testconfig.php) | 9 | ||||
-rw-r--r-- | apps/user_ldap/lib/Configuration.php (renamed from apps/user_ldap/lib/configuration.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Connection.php (renamed from apps/user_ldap/lib/connection.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/FilesystemHelper.php (renamed from apps/user_ldap/lib/filesystemhelper.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Group_LDAP.php (renamed from apps/user_ldap/group_ldap.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/Group_Proxy.php (renamed from apps/user_ldap/group_proxy.php) | 8 | ||||
-rw-r--r-- | apps/user_ldap/lib/Helper.php (renamed from apps/user_ldap/lib/helper.php) | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib/ILDAPWrapper.php (renamed from apps/user_ldap/lib/ildapwrapper.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Jobs/CleanUp.php (renamed from apps/user_ldap/lib/jobs/cleanup.php) | 14 | ||||
-rw-r--r-- | apps/user_ldap/lib/Jobs/UpdateGroups.php (renamed from apps/user_ldap/lib/jobs.php) | 23 | ||||
-rw-r--r-- | apps/user_ldap/lib/LDAP.php (renamed from apps/user_ldap/lib/ldap.php) | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib/LDAPUtility.php (renamed from apps/user_ldap/lib/ldaputility.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/LogWrapper.php (renamed from apps/user_ldap/lib/logwrapper.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Mapping/AbstractMapping.php (renamed from apps/user_ldap/lib/mapping/abstractmapping.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/lib/Mapping/GroupMapping.php (renamed from apps/user_ldap/lib/mapping/groupmapping.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/lib/Mapping/UserMapping.php (renamed from apps/user_ldap/lib/mapping/usermapping.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/lib/Proxy.php (renamed from apps/user_ldap/lib/proxy.php) | 3 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/DeletedUsersIndex.php (renamed from apps/user_ldap/lib/user/deletedusersindex.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/IUserTools.php (renamed from apps/user_ldap/lib/user/iusertools.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/Manager.php (renamed from apps/user_ldap/lib/user/manager.php) | 25 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/OfflineUser.php (renamed from apps/user_ldap/lib/user/offlineuser.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/User/User.php (renamed from apps/user_ldap/lib/user/user.php) | 17 | ||||
-rw-r--r-- | apps/user_ldap/lib/User_LDAP.php (renamed from apps/user_ldap/user_ldap.php) | 16 | ||||
-rw-r--r-- | apps/user_ldap/lib/User_Proxy.php (renamed from apps/user_ldap/user_proxy.php) | 10 | ||||
-rw-r--r-- | apps/user_ldap/lib/Wizard.php (renamed from apps/user_ldap/lib/wizard.php) | 8 | ||||
-rw-r--r-- | apps/user_ldap/lib/WizardResult.php (renamed from apps/user_ldap/lib/wizardresult.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/settings.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/tests/AccessTest.php (renamed from apps/user_ldap/tests/access.php) | 33 | ||||
-rw-r--r-- | apps/user_ldap/tests/ConfigurationTest.php (renamed from apps/user_ldap/tests/configuration.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/tests/ConnectionTest.php (renamed from apps/user_ldap/tests/connection.php) | 16 | ||||
-rw-r--r-- | apps/user_ldap/tests/Group_LDAPTest.php (renamed from apps/user_ldap/tests/group_ldap.php) | 31 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/AbstractIntegrationTest.php (renamed from apps/user_ldap/tests/integration/abstractintegrationtest.php) | 10 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php (renamed from apps/user_ldap/tests/integration/exceptionOnLostConnection.php) | 13 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/FakeManager.php (renamed from apps/user_ldap/tests/integration/fakemanager.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestAccessGroupsMatchFilter.php (renamed from apps/user_ldap/tests/integration/lib/IntegrationTestAccessGroupsMatchFilter.php) | 6 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestBackupServer.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestbackupserver.php) | 13 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestbatchapplyuserattributes.php) | 4 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestConnect.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestconnect.php) | 13 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestCountUsersByLoginName.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestcountusersbyloginname.php) | 11 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestfetchusersbyloginname.php) | 15 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestpaging.php) | 11 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php (renamed from apps/user_ldap/tests/integration/lib/integrationtestuserhome.php) | 21 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php (renamed from apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php) | 15 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php (renamed from apps/user_ldap/tests/integration/lib/user/IntegrationTestUserDisplayName.php) | 8 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/data/avatar-invalid.gif (renamed from apps/user_ldap/tests/integration/data/avatar-invalid.gif) | bin | 48702 -> 48702 bytes | |||
-rw-r--r-- | apps/user_ldap/tests/Integration/data/avatar-valid.jpg (renamed from apps/user_ldap/tests/integration/data/avatar-valid.jpg) | bin | 95495 -> 95495 bytes | |||
-rw-r--r-- | apps/user_ldap/tests/Integration/readme.md (renamed from apps/user_ldap/tests/integration/readme.md) | 0 | ||||
-rwxr-xr-x | apps/user_ldap/tests/Integration/run-test.sh (renamed from apps/user_ldap/tests/integration/run-test.sh) | 0 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/setup-scripts/createExplicitGroups.php (renamed from apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/setup-scripts/createExplicitGroupsDifferentOU.php (renamed from apps/user_ldap/tests/integration/setup-scripts/createExplicitGroupsDifferentOU.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/setup-scripts/createExplicitUsers.php (renamed from apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/tests/Integration/setup-scripts/createUsersWithoutDisplayName.php (renamed from apps/user_ldap/tests/integration/setup-scripts/createUsersWithoutDisplayName.php) | 0 | ||||
-rw-r--r-- | apps/user_ldap/tests/Jobs/CleanUpTest.php (renamed from apps/user_ldap/tests/jobs/cleanup.php) | 10 | ||||
-rw-r--r-- | apps/user_ldap/tests/Mapping/AbstractMappingTest.php (renamed from apps/user_ldap/tests/mapping/abstractmappingtest.php) | 2 | ||||
-rw-r--r-- | apps/user_ldap/tests/Mapping/GroupMappingTest.php (renamed from apps/user_ldap/tests/mapping/groupmapping.php) | 8 | ||||
-rw-r--r-- | apps/user_ldap/tests/Mapping/UserMappingTest.php (renamed from apps/user_ldap/tests/mapping/usermapping.php) | 8 | ||||
-rw-r--r-- | apps/user_ldap/tests/User/ManagerTest.php (renamed from apps/user_ldap/tests/user/manager.php) | 26 | ||||
-rw-r--r-- | apps/user_ldap/tests/User/UserTest.php (renamed from apps/user_ldap/tests/user/user.php) | 32 | ||||
-rw-r--r-- | apps/user_ldap/tests/User_LDAPTest.php (renamed from apps/user_ldap/tests/user_ldap.php) | 39 | ||||
-rw-r--r-- | apps/user_ldap/tests/WizardTest.php (renamed from apps/user_ldap/tests/wizard.php) | 29 | ||||
-rw-r--r-- | lib/private/Repair/DropOldJobs.php | 4 | ||||
-rw-r--r-- | settings/users.php | 4 | ||||
-rw-r--r-- | tests/apps.php | 3 |
81 files changed, 378 insertions, 385 deletions
diff --git a/apps/user_ldap/ajax/deleteConfiguration.php b/apps/user_ldap/ajax/deleteConfiguration.php index 780a4bc35d0..80b73cb82f9 100644 --- a/apps/user_ldap/ajax/deleteConfiguration.php +++ b/apps/user_ldap/ajax/deleteConfiguration.php @@ -30,7 +30,7 @@ OCP\JSON::checkAppEnabled('user_ldap'); OCP\JSON::callCheck(); $prefix = (string)$_POST['ldap_serverconfig_chooser']; -$helper = new \OCA\user_ldap\lib\Helper(); +$helper = new \OCA\User_LDAP\Helper(); if($helper->deleteServerConfiguration($prefix)) { OCP\JSON::success(); } else { diff --git a/apps/user_ldap/ajax/getConfiguration.php b/apps/user_ldap/ajax/getConfiguration.php index 795261bc91d..b2c2bc5cbc5 100644 --- a/apps/user_ldap/ajax/getConfiguration.php +++ b/apps/user_ldap/ajax/getConfiguration.php @@ -28,6 +28,6 @@ OCP\JSON::checkAppEnabled('user_ldap'); OCP\JSON::callCheck(); $prefix = (string)$_POST['ldap_serverconfig_chooser']; -$ldapWrapper = new OCA\user_ldap\lib\LDAP(); -$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix); +$ldapWrapper = new OCA\User_LDAP\LDAP(); +$connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix); OCP\JSON::success(array('configuration' => $connection->getConfiguration())); diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index df85d99f2c7..18407126fbf 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -25,7 +25,7 @@ OCP\JSON::checkAdminUser(); OCP\JSON::checkAppEnabled('user_ldap'); OCP\JSON::callCheck(); -$helper = new \OCA\user_ldap\lib\Helper(); +$helper = new \OCA\User_LDAP\Helper(); $serverConnections = $helper->getServerConfigurationPrefixes(); sort($serverConnections); $lk = array_pop($serverConnections); @@ -34,12 +34,12 @@ $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT); $resultData = array('configPrefix' => $nk); -$newConfig = new \OCA\user_ldap\lib\Configuration($nk, false); +$newConfig = new \OCA\User_LDAP\Configuration($nk, false); if(isset($_POST['copyConfig'])) { - $originalConfig = new \OCA\user_ldap\lib\Configuration($_POST['copyConfig']); + $originalConfig = new \OCA\User_LDAP\Configuration($_POST['copyConfig']); $newConfig->setConfiguration($originalConfig->getConfiguration()); } else { - $configuration = new \OCA\user_ldap\lib\Configuration($nk, false); + $configuration = new \OCA\User_LDAP\Configuration($nk, false); $newConfig->setConfiguration($configuration->getDefaults()); $resultData['defaults'] = $configuration->getDefaults(); } diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index a2e73783e00..964baa81c55 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -41,8 +41,8 @@ foreach($chkboxes as $boxid) { } } -$ldapWrapper = new OCA\user_ldap\lib\LDAP(); -$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix); +$ldapWrapper = new OCA\User_LDAP\LDAP(); +$connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix); $connection->setConfiguration($_POST); $connection->saveConfiguration(); OCP\JSON::success(); diff --git a/apps/user_ldap/ajax/testConfiguration.php b/apps/user_ldap/ajax/testConfiguration.php index e9f5167bfe7..0b69dd3af57 100644 --- a/apps/user_ldap/ajax/testConfiguration.php +++ b/apps/user_ldap/ajax/testConfiguration.php @@ -30,8 +30,8 @@ OCP\JSON::callCheck(); $l = \OC::$server->getL10N('user_ldap'); -$ldapWrapper = new OCA\user_ldap\lib\LDAP(); -$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, '', null); +$ldapWrapper = new OCA\User_LDAP\LDAP(); +$connection = new \OCA\User_LDAP\Connection($ldapWrapper, '', null); //needs to be true, otherwise it will also fail with an irritating message $_POST['ldap_configuration_active'] = 1; diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php index f3e5efffc24..656c9d51575 100644 --- a/apps/user_ldap/ajax/wizard.php +++ b/apps/user_ldap/ajax/wizard.php @@ -41,26 +41,26 @@ if(!isset($_POST['ldap_serverconfig_chooser'])) { } $prefix = (string)$_POST['ldap_serverconfig_chooser']; -$ldapWrapper = new \OCA\user_ldap\lib\LDAP(); -$configuration = new \OCA\user_ldap\lib\Configuration($prefix); +$ldapWrapper = new \OCA\User_LDAP\LDAP(); +$configuration = new \OCA\User_LDAP\Configuration($prefix); -$con = new \OCA\user_ldap\lib\Connection($ldapWrapper, '', null); +$con = new \OCA\User_LDAP\Connection($ldapWrapper, '', null); $con->setConfiguration($configuration->getConfiguration()); $con->ldapConfigurationActive = true; $con->setIgnoreValidation(true); -$userManager = new \OCA\user_ldap\lib\user\Manager( +$userManager = new \OCA\User_LDAP\User\Manager( \OC::$server->getConfig(), - new \OCA\user_ldap\lib\FilesystemHelper(), - new \OCA\user_ldap\lib\LogWrapper(), + new \OCA\User_LDAP\FilesystemHelper(), + new \OCA\User_LDAP\LogWrapper(), \OC::$server->getAvatarManager(), new \OCP\Image(), \OC::$server->getDatabaseConnection(), \OC::$server->getUserManager()); -$access = new \OCA\user_ldap\lib\Access($con, $ldapWrapper, $userManager); +$access = new \OCA\User_LDAP\Access($con, $ldapWrapper, $userManager); -$wizard = new \OCA\user_ldap\lib\Wizard($configuration, $ldapWrapper, $access); +$wizard = new \OCA\User_LDAP\Wizard($configuration, $ldapWrapper, $access); switch($action) { case 'guessPortAndTLS': @@ -127,7 +127,7 @@ switch($action) { } $configuration->saveConfiguration(); //clear the cache on save - $connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix); + $connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix); $connection->clearCache(); OCP\JSON::success(); break; diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php index f1ac2dbd26b..a80088bdd20 100644 --- a/apps/user_ldap/appinfo/app.php +++ b/apps/user_ldap/appinfo/app.php @@ -27,32 +27,32 @@ OCP\App::registerAdmin('user_ldap', 'settings'); -$helper = new \OCA\user_ldap\lib\Helper(); +$helper = new \OCA\User_LDAP\Helper(); $configPrefixes = $helper->getServerConfigurationPrefixes(true); -$ldapWrapper = new OCA\user_ldap\lib\LDAP(); +$ldapWrapper = new OCA\User_LDAP\LDAP(); $ocConfig = \OC::$server->getConfig(); if(count($configPrefixes) === 1) { $dbc = \OC::$server->getDatabaseConnection(); - $userManager = new OCA\user_ldap\lib\user\Manager($ocConfig, - new OCA\user_ldap\lib\FilesystemHelper(), - new OCA\user_ldap\lib\LogWrapper(), + $userManager = new OCA\User_LDAP\User\Manager($ocConfig, + new OCA\User_LDAP\FilesystemHelper(), + new OCA\User_LDAP\LogWrapper(), \OC::$server->getAvatarManager(), new \OCP\Image(), $dbc, \OC::$server->getUserManager() ); - $connector = new OCA\user_ldap\lib\Connection($ldapWrapper, $configPrefixes[0]); - $ldapAccess = new OCA\user_ldap\lib\Access($connector, $ldapWrapper, $userManager); + $connector = new OCA\User_LDAP\Connection($ldapWrapper, $configPrefixes[0]); + $ldapAccess = new OCA\User_LDAP\Access($connector, $ldapWrapper, $userManager); $ldapAccess->setUserMapper(new OCA\User_LDAP\Mapping\UserMapping($dbc)); $ldapAccess->setGroupMapper(new OCA\User_LDAP\Mapping\GroupMapping($dbc)); - $userBackend = new OCA\user_ldap\USER_LDAP($ldapAccess, $ocConfig); - $groupBackend = new OCA\user_ldap\GROUP_LDAP($ldapAccess); + $userBackend = new OCA\User_LDAP\User_LDAP($ldapAccess, $ocConfig); + $groupBackend = new \OCA\User_LDAP\Group_LDAP($ldapAccess); } else if(count($configPrefixes) > 1) { - $userBackend = new OCA\user_ldap\User_Proxy( + $userBackend = new OCA\User_LDAP\User_Proxy( $configPrefixes, $ldapWrapper, $ocConfig ); - $groupBackend = new OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper); + $groupBackend = new OCA\User_LDAP\Group_Proxy($configPrefixes, $ldapWrapper); } if(count($configPrefixes) > 0) { @@ -64,7 +64,7 @@ if(count($configPrefixes) > 0) { \OCP\Util::connectHook( '\OCA\Files_Sharing\API\Server2Server', 'preLoginNameUsedAsUserName', - '\OCA\user_ldap\lib\Helper', + '\OCA\User_LDAP\Helper', 'loginName2UserName' ); diff --git a/apps/user_ldap/appinfo/info.xml b/apps/user_ldap/appinfo/info.xml index b84a33f75a4..144479e132e 100644 --- a/apps/user_ldap/appinfo/info.xml +++ b/apps/user_ldap/appinfo/info.xml @@ -21,8 +21,10 @@ A user logs into ownCloud with their LDAP or AD credentials, and is granted acce <owncloud min-version="9.1" max-version="9.1" /> </dependencies> + <namespace>User_LDAP</namespace> + <background-jobs> - <job>OCA\user_ldap\lib\Jobs</job> - <job>\OCA\User_LDAP\Jobs\CleanUp</job> + <job>OCA\User_LDAP\Jobs\UpdateGroups</job> + <job>OCA\User_LDAP\Jobs\CleanUp</job> </background-jobs> </info> diff --git a/apps/user_ldap/appinfo/register_command.php b/apps/user_ldap/appinfo/register_command.php index f356f635023..6ed6325e197 100644 --- a/apps/user_ldap/appinfo/register_command.php +++ b/apps/user_ldap/appinfo/register_command.php @@ -21,11 +21,11 @@ * */ -use OCA\user_ldap\lib\Helper; -use OCA\user_ldap\lib\LDAP; -use OCA\user_ldap\User_Proxy; +use OCA\User_LDAP\Helper; +use OCA\User_LDAP\LDAP; +use OCA\User_LDAP\User_Proxy; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\User_LDAP\lib\User\DeletedUsersIndex; +use OCA\User_LDAP\User\DeletedUsersIndex; $dbConnection = \OC::$server->getDatabaseConnection(); $userMapping = new UserMapping($dbConnection); @@ -40,15 +40,15 @@ $deletedUsersIndex = new DeletedUsersIndex( $ocConfig, $dbConnection, $userMapping ); -$application->add(new OCA\user_ldap\Command\ShowConfig($helper)); -$application->add(new OCA\user_ldap\Command\SetConfig()); -$application->add(new OCA\user_ldap\Command\TestConfig()); -$application->add(new OCA\user_ldap\Command\CreateEmptyConfig($helper)); -$application->add(new OCA\user_ldap\Command\DeleteConfig($helper)); -$application->add(new OCA\user_ldap\Command\Search($ocConfig)); -$application->add(new OCA\user_ldap\Command\ShowRemnants( +$application->add(new OCA\User_LDAP\Command\ShowConfig($helper)); +$application->add(new OCA\User_LDAP\Command\SetConfig()); +$application->add(new OCA\User_LDAP\Command\TestConfig()); +$application->add(new OCA\User_LDAP\Command\CreateEmptyConfig($helper)); +$application->add(new OCA\User_LDAP\Command\DeleteConfig($helper)); +$application->add(new OCA\User_LDAP\Command\Search($ocConfig)); +$application->add(new OCA\User_LDAP\Command\ShowRemnants( $deletedUsersIndex, \OC::$server->getDateTimeFormatter()) ); -$application->add(new OCA\user_ldap\Command\CheckUser( +$application->add(new OCA\User_LDAP\Command\CheckUser( $uBackend, $helper, $deletedUsersIndex, $userMapping) ); diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/Access.php index f92ded64797..6ec90cfff8f 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/Access.php @@ -35,18 +35,20 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; -use OCA\user_ldap\lib\user\OfflineUser; +use OCA\User_LDAP\User\IUserTools; +use OCA\User_LDAP\User\Manager; +use OCA\User_LDAP\User\OfflineUser; use OCA\User_LDAP\Mapping\AbstractMapping; /** * Class Access - * @package OCA\user_ldap\lib + * @package OCA\User_LDAP */ -class Access extends LDAPUtility implements user\IUserTools { +class Access extends LDAPUtility implements IUserTools { /** - * @var \OCA\user_ldap\lib\Connection + * @var \OCA\User_LDAP\Connection */ public $connection; public $userManager; @@ -75,7 +77,7 @@ class Access extends LDAPUtility implements user\IUserTools { protected $groupMapper; public function __construct(Connection $connection, ILDAPWrapper $ldap, - user\Manager $userManager) { + Manager $userManager) { parent::__construct($ldap); $this->connection = $connection; $this->userManager = $userManager; @@ -131,7 +133,7 @@ class Access extends LDAPUtility implements user\IUserTools { /** * returns the Connection instance - * @return \OCA\user_ldap\lib\Connection + * @return \OCA\User_LDAP\Connection */ public function getConnection() { return $this->connection; @@ -314,7 +316,7 @@ class Access extends LDAPUtility implements user\IUserTools { * @return string|false LDAP DN on success, otherwise false */ public function groupname2dn($name) { - return $this->groupMapper->getDNbyName($name); + return $this->groupMapper->getDNByName($name); } /** @@ -323,7 +325,7 @@ class Access extends LDAPUtility implements user\IUserTools { * @return string|false with the LDAP DN on success, otherwise false */ public function username2dn($name) { - $fdn = $this->userMapper->getDNbyName($name); + $fdn = $this->userMapper->getDNByName($name); //Check whether the DN belongs to the Base, to avoid issues on multi- //server setups diff --git a/apps/user_ldap/lib/backendutility.php b/apps/user_ldap/lib/BackendUtility.php index 87c1649cada..fc4efe28924 100644 --- a/apps/user_ldap/lib/backendutility.php +++ b/apps/user_ldap/lib/BackendUtility.php @@ -21,7 +21,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; abstract class BackendUtility { diff --git a/apps/user_ldap/command/checkuser.php b/apps/user_ldap/lib/Command/CheckUser.php index eb1a7e494d5..43de421de6a 100644 --- a/apps/user_ldap/command/checkuser.php +++ b/apps/user_ldap/lib/Command/CheckUser.php @@ -20,7 +20,7 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -28,30 +28,29 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use OCA\user_ldap\lib\user\User; -use OCA\User_LDAP\lib\User\DeletedUsersIndex; +use OCA\User_LDAP\User\DeletedUsersIndex; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\lib\Helper as LDAPHelper; -use OCA\user_ldap\User_Proxy; +use OCA\User_LDAP\Helper as LDAPHelper; +use OCA\User_LDAP\User_Proxy; class CheckUser extends Command { - /** @var \OCA\user_ldap\User_Proxy */ + /** @var \OCA\User_LDAP\User_Proxy */ protected $backend; - /** @var \OCA\User_LDAP\lib\Helper */ + /** @var \OCA\User_LDAP\Helper */ protected $helper; - /** @var \OCA\User_LDAP\lib\User\DeletedUsersIndex */ + /** @var \OCA\User_LDAP\User\DeletedUsersIndex */ protected $dui; /** @var \OCA\User_LDAP\Mapping\UserMapping */ protected $mapping; /** - * @param OCA\user_ldap\User_Proxy $uBackend - * @param OCA\user_ldap\lib\Helper $helper - * @param OCA\User_LDAP\lib\User\DeletedUsersIndex $dui - * @param OCA\User_LDAP\Mapping\UserMapping $mapping + * @param User_Proxy $uBackend + * @param LDAPHelper $helper + * @param DeletedUsersIndex $dui + * @param UserMapping $mapping */ public function __construct(User_Proxy $uBackend, LDAPHelper $helper, DeletedUsersIndex $dui, UserMapping $mapping) { $this->backend = $uBackend; diff --git a/apps/user_ldap/command/createemptyconfig.php b/apps/user_ldap/lib/Command/CreateEmptyConfig.php index f1c94704415..c735e51f491 100644 --- a/apps/user_ldap/command/createemptyconfig.php +++ b/apps/user_ldap/lib/Command/CreateEmptyConfig.php @@ -21,18 +21,16 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\user_ldap\lib\Helper; -use \OCA\user_ldap\lib\Configuration; +use \OCA\User_LDAP\Helper; +use \OCA\User_LDAP\Configuration; class CreateEmptyConfig extends Command { - /** @var \OCA\User_LDAP\lib\Helper */ + /** @var \OCA\User_LDAP\Helper */ protected $helper; /** diff --git a/apps/user_ldap/command/deleteconfig.php b/apps/user_ldap/lib/Command/DeleteConfig.php index 4dfef9c18da..a56753daddc 100644 --- a/apps/user_ldap/command/deleteconfig.php +++ b/apps/user_ldap/lib/Command/DeleteConfig.php @@ -21,16 +21,16 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\user_ldap\lib\Helper; +use \OCA\User_LDAP\Helper; class DeleteConfig extends Command { - /** @var \OCA\User_LDAP\lib\Helper */ + /** @var \OCA\User_LDAP\Helper */ protected $helper; /** diff --git a/apps/user_ldap/command/search.php b/apps/user_ldap/lib/Command/Search.php index 8d43d15649a..795530e2044 100644 --- a/apps/user_ldap/command/search.php +++ b/apps/user_ldap/lib/Command/Search.php @@ -20,7 +20,7 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -28,10 +28,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use OCA\user_ldap\User_Proxy; -use OCA\user_ldap\Group_Proxy; -use OCA\user_ldap\lib\Helper; -use OCA\user_ldap\lib\LDAP; +use OCA\User_LDAP\User_Proxy; +use OCA\User_LDAP\Group_Proxy; +use OCA\User_LDAP\Helper; +use OCA\User_LDAP\LDAP; use OCP\IConfig; class Search extends Command { diff --git a/apps/user_ldap/command/setconfig.php b/apps/user_ldap/lib/Command/SetConfig.php index 575d429241b..d466e1eb769 100644 --- a/apps/user_ldap/command/setconfig.php +++ b/apps/user_ldap/lib/Command/SetConfig.php @@ -21,14 +21,14 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\user_ldap\lib\Helper; -use \OCA\user_ldap\lib\Configuration; +use OCA\User_LDAP\Helper; +use OCA\User_LDAP\Configuration; class SetConfig extends Command { diff --git a/apps/user_ldap/command/showconfig.php b/apps/user_ldap/lib/Command/ShowConfig.php index 164cdada100..dbd18216f81 100644 --- a/apps/user_ldap/command/showconfig.php +++ b/apps/user_ldap/lib/Command/ShowConfig.php @@ -21,18 +21,18 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\user_ldap\lib\Helper; -use \OCA\user_ldap\lib\Configuration; +use OCA\User_LDAP\Helper; +use OCA\User_LDAP\Configuration; class ShowConfig extends Command { - /** @var \OCA\User_LDAP\lib\Helper */ + /** @var \OCA\User_LDAP\Helper */ protected $helper; /** diff --git a/apps/user_ldap/command/showremnants.php b/apps/user_ldap/lib/Command/ShowRemnants.php index 83bb5eaefd3..59da6e5522d 100644 --- a/apps/user_ldap/command/showremnants.php +++ b/apps/user_ldap/lib/Command/ShowRemnants.php @@ -21,26 +21,26 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use OCA\user_ldap\lib\user\DeletedUsersIndex; +use OCA\User_LDAP\User\DeletedUsersIndex; use OCP\IDateTimeFormatter; class ShowRemnants extends Command { - /** @var \OCA\User_LDAP\lib\User\DeletedUsersIndex */ + /** @var \OCA\User_LDAP\User\DeletedUsersIndex */ protected $dui; /** @var \OCP\IDateTimeFormatter */ protected $dateFormatter; /** - * @param OCA\user_ldap\lib\user\DeletedUsersIndex $dui - * @param OCP\IDateTimeFormatter $dateFormatter + * @param DeletedUsersIndex $dui + * @param IDateTimeFormatter $dateFormatter */ public function __construct(DeletedUsersIndex $dui, IDateTimeFormatter $dateFormatter) { $this->dui = $dui; @@ -74,7 +74,7 @@ class ShowRemnants extends Command { $this->dateFormatter->formatDate($user->getLastLogin()) : '-'; $rows[] = array('ocName' => $user->getOCName(), 'displayName' => $user->getDisplayName(), - 'uid' => $user->getUid(), + 'uid' => $user->getUID(), 'dn' => $user->getDN(), 'lastLogin' => $lastLogin, 'homePath' => $user->getHomePath(), diff --git a/apps/user_ldap/command/testconfig.php b/apps/user_ldap/lib/Command/TestConfig.php index 62d40265777..93a9f644714 100644 --- a/apps/user_ldap/command/testconfig.php +++ b/apps/user_ldap/lib/Command/TestConfig.php @@ -21,15 +21,14 @@ * */ -namespace OCA\user_ldap\Command; +namespace OCA\User_LDAP\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\user_ldap\lib\Helper; -use \OCA\user_ldap\lib\Connection; +use \OCA\User_LDAP\Helper; +use \OCA\User_LDAP\Connection; class TestConfig extends Command { @@ -72,7 +71,7 @@ class TestConfig extends Command { * @return int */ protected function testConfig($configID) { - $lw = new \OCA\user_ldap\lib\LDAP(); + $lw = new \OCA\User_LDAP\LDAP(); $connection = new Connection($lw, $configID); //ensure validation is run before we attempt the bind diff --git a/apps/user_ldap/lib/configuration.php b/apps/user_ldap/lib/Configuration.php index 418a2bfc015..476483ecc2f 100644 --- a/apps/user_ldap/lib/configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -26,7 +26,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; /** * @property int ldapPagingSize holds an integer diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/Connection.php index 93e7e4bf974..1cf02a0a898 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -26,7 +26,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; use OC\ServerNotAvailableException; diff --git a/apps/user_ldap/lib/filesystemhelper.php b/apps/user_ldap/lib/FilesystemHelper.php index 03f4c4274f4..439e7fb1d0b 100644 --- a/apps/user_ldap/lib/filesystemhelper.php +++ b/apps/user_ldap/lib/FilesystemHelper.php @@ -21,7 +21,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; /** * @brief wraps around static ownCloud core methods diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/lib/Group_LDAP.php index 617bdc3e6ed..39b2e9ff446 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -32,12 +32,10 @@ * */ -namespace OCA\user_ldap; +namespace OCA\User_LDAP; -use OCA\user_ldap\lib\Access; -use OCA\user_ldap\lib\BackendUtility; -class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { +class Group_LDAP extends BackendUtility implements \OCP\GroupInterface { protected $enabled = false; /** diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/lib/Group_Proxy.php index 7d496a129a1..333a74bab22 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/lib/Group_Proxy.php @@ -22,11 +22,9 @@ * */ -namespace OCA\user_ldap; +namespace OCA\User_LDAP; -use OCA\user_ldap\lib\ILDAPWrapper; - -class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { +class Group_Proxy extends Proxy implements \OCP\GroupInterface { private $backends = array(); private $refBackend = null; @@ -38,7 +36,7 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { parent::__construct($ldap); foreach($serverConfigPrefixes as $configPrefix) { $this->backends[$configPrefix] = - new \OCA\user_ldap\GROUP_LDAP($this->getAccess($configPrefix)); + new \OCA\User_LDAP\Group_LDAP($this->getAccess($configPrefix)); if(is_null($this->refBackend)) { $this->refBackend = &$this->backends[$configPrefix]; } diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/Helper.php index bfff6baf0d3..aa6d6aa1bce 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/Helper.php @@ -25,9 +25,7 @@ * */ -namespace OCA\user_ldap\lib; - -use OCA\user_ldap\User_Proxy; +namespace OCA\User_LDAP; class Helper { diff --git a/apps/user_ldap/lib/ildapwrapper.php b/apps/user_ldap/lib/ILDAPWrapper.php index d607a3fdb66..a95f3a615f2 100644 --- a/apps/user_ldap/lib/ildapwrapper.php +++ b/apps/user_ldap/lib/ILDAPWrapper.php @@ -23,7 +23,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; interface ILDAPWrapper { diff --git a/apps/user_ldap/lib/jobs/cleanup.php b/apps/user_ldap/lib/Jobs/CleanUp.php index c9f5f2021eb..48f80ed9fa0 100644 --- a/apps/user_ldap/lib/jobs/cleanup.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -23,11 +23,11 @@ namespace OCA\User_LDAP\Jobs; use \OC\BackgroundJob\TimedJob; -use \OCA\user_ldap\User_LDAP; -use \OCA\user_ldap\User_Proxy; -use \OCA\user_ldap\lib\Helper; -use \OCA\user_ldap\lib\LDAP; -use \OCA\user_ldap\lib\user\DeletedUsersIndex; +use \OCA\User_LDAP\User_LDAP; +use \OCA\User_LDAP\User_Proxy; +use \OCA\User_LDAP\Helper; +use \OCA\User_LDAP\LDAP; +use \OCA\User_LDAP\User\DeletedUsersIndex; use \OCA\User_LDAP\Mapping\UserMapping; /** @@ -35,7 +35,7 @@ use \OCA\User_LDAP\Mapping\UserMapping; * * a Background job to clean up deleted users * - * @package OCA\user_ldap\lib; + * @package OCA\User_LDAP\Jobs; */ class CleanUp extends TimedJob { /** @var int $limit amount of users that should be checked per run */ @@ -59,7 +59,7 @@ class CleanUp extends TimedJob { /** @var \OCA\User_LDAP\Mapping\UserMapping */ protected $mapping; - /** @var \OCA\User_LDAP\lib\User\DeletedUsersIndex */ + /** @var \OCA\User_LDAP\User\DeletedUsersIndex */ protected $dui; public function __construct() { diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index ecf2e6daa0f..3ea74959f5c 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -26,12 +26,19 @@ * */ -namespace OCA\user_ldap\lib; - +namespace OCA\User_LDAP\Jobs; + +use OCA\User_LDAP\Access; +use OCA\User_LDAP\Connection; +use OCA\User_LDAP\FilesystemHelper; +use OCA\User_LDAP\Helper; +use OCA\User_LDAP\LDAP; +use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\Mapping\GroupMapping; use OCA\User_LDAP\Mapping\UserMapping; +use OCA\User_LDAP\User\Manager; -class Jobs extends \OC\BackgroundJob\TimedJob { +class UpdateGroups extends \OC\BackgroundJob\TimedJob { static private $groupsFromDB; static private $groupBE; @@ -45,7 +52,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { * @param mixed $argument */ public function run($argument){ - Jobs::updateGroups(); + self::updateGroups(); } static public function updateGroups() { @@ -158,7 +165,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { } /** - * @return \OCA\user_ldap\GROUP_LDAP|\OCA\user_ldap\Group_Proxy + * @return \OCA\User_LDAP\Group_LDAP|\OCA\User_LDAP\Group_Proxy */ static private function getGroupBE() { if(!is_null(self::$groupBE)) { @@ -170,7 +177,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob { if(count($configPrefixes) === 1) { //avoid the proxy when there is only one LDAP server configured $dbc = \OC::$server->getDatabaseConnection(); - $userManager = new user\Manager( + $userManager = new Manager( \OC::$server->getConfig(), new FilesystemHelper(), new LogWrapper(), @@ -184,9 +191,9 @@ class Jobs extends \OC\BackgroundJob\TimedJob { $userMapper = new UserMapping($dbc); $ldapAccess->setGroupMapper($groupMapper); $ldapAccess->setUserMapper($userMapper); - self::$groupBE = new \OCA\user_ldap\GROUP_LDAP($ldapAccess); + self::$groupBE = new \OCA\User_LDAP\Group_LDAP($ldapAccess); } else { - self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper); + self::$groupBE = new \OCA\User_LDAP\Group_Proxy($configPrefixes, $ldapWrapper); } return self::$groupBE; diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/LDAP.php index 383d71ca6eb..a7033d82254 100644 --- a/apps/user_ldap/lib/ldap.php +++ b/apps/user_ldap/lib/LDAP.php @@ -24,7 +24,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; use OC\ServerNotAvailableException; @@ -160,7 +160,7 @@ class LDAP implements ILDAPWrapper { /** * @param LDAP $link * @param resource $result - * @return mixed|an + * @return mixed */ public function nextEntry($link, $result) { return $this->invokeLDAPMethod('next_entry', $link, $result); diff --git a/apps/user_ldap/lib/ldaputility.php b/apps/user_ldap/lib/LDAPUtility.php index e80fc12e087..33b2685593f 100644 --- a/apps/user_ldap/lib/ldaputility.php +++ b/apps/user_ldap/lib/LDAPUtility.php @@ -21,7 +21,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; abstract class LDAPUtility { protected $ldap; diff --git a/apps/user_ldap/lib/logwrapper.php b/apps/user_ldap/lib/LogWrapper.php index 41ae4fc3426..5368e82417b 100644 --- a/apps/user_ldap/lib/logwrapper.php +++ b/apps/user_ldap/lib/LogWrapper.php @@ -20,7 +20,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; /** * @brief wraps around static ownCloud core methods diff --git a/apps/user_ldap/lib/mapping/abstractmapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index 1c896a9bbf4..1c896a9bbf4 100644 --- a/apps/user_ldap/lib/mapping/abstractmapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php diff --git a/apps/user_ldap/lib/mapping/groupmapping.php b/apps/user_ldap/lib/Mapping/GroupMapping.php index 49bb41b8c76..49bb41b8c76 100644 --- a/apps/user_ldap/lib/mapping/groupmapping.php +++ b/apps/user_ldap/lib/Mapping/GroupMapping.php diff --git a/apps/user_ldap/lib/mapping/usermapping.php b/apps/user_ldap/lib/Mapping/UserMapping.php index b39f738ea8c..b39f738ea8c 100644 --- a/apps/user_ldap/lib/mapping/usermapping.php +++ b/apps/user_ldap/lib/Mapping/UserMapping.php diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/Proxy.php index 7002aaadaa5..ce1a67b29de 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -26,9 +26,8 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; -use OCA\user_ldap\lib\Access; use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\GroupMapping; diff --git a/apps/user_ldap/lib/user/deletedusersindex.php b/apps/user_ldap/lib/User/DeletedUsersIndex.php index 48daeb9b8bc..7a9823786dd 100644 --- a/apps/user_ldap/lib/user/deletedusersindex.php +++ b/apps/user_ldap/lib/User/DeletedUsersIndex.php @@ -21,7 +21,7 @@ * */ -namespace OCA\user_ldap\lib\user; +namespace OCA\User_LDAP\User; use OCA\User_LDAP\Mapping\UserMapping; @@ -63,7 +63,7 @@ class DeletedUsersIndex { /** * reads LDAP users marked as deleted from the database - * @return \OCA\user_ldap\lib\user\OfflineUser[] + * @return \OCA\User_LDAP\User\OfflineUser[] */ private function fetchDeletedUsers() { $deletedUsers = $this->config->getUsersForUserValue( @@ -80,7 +80,7 @@ class DeletedUsersIndex { /** * returns all LDAP users that are marked as deleted - * @return \OCA\user_ldap\lib\user\OfflineUser[] + * @return \OCA\User_LDAP\User\OfflineUser[] */ public function getUsers() { if(is_array($this->deletedUsers)) { diff --git a/apps/user_ldap/lib/user/iusertools.php b/apps/user_ldap/lib/User/IUserTools.php index b0eb9e1ffb3..747b46ec68a 100644 --- a/apps/user_ldap/lib/user/iusertools.php +++ b/apps/user_ldap/lib/User/IUserTools.php @@ -20,7 +20,7 @@ * */ -namespace OCA\user_ldap\lib\user; +namespace OCA\User_LDAP\User; /** * IUserTools diff --git a/apps/user_ldap/lib/user/manager.php b/apps/user_ldap/lib/User/Manager.php index dc12ebd6e9d..d97112e43c7 100644 --- a/apps/user_ldap/lib/user/manager.php +++ b/apps/user_ldap/lib/User/Manager.php @@ -23,13 +23,10 @@ * */ -namespace OCA\user_ldap\lib\user; +namespace OCA\User_LDAP\User; -use OCA\user_ldap\lib\user\IUserTools; -use OCA\user_ldap\lib\user\User; -use OCA\user_ldap\lib\LogWrapper; -use OCA\user_ldap\lib\FilesystemHelper; -use OCA\user_ldap\lib\user\OfflineUser; +use OCA\User_LDAP\LogWrapper; +use OCA\User_LDAP\FilesystemHelper; use OCP\IAvatarManager; use OCP\IConfig; use OCP\IDBConnection; @@ -65,8 +62,8 @@ class Manager { protected $avatarManager; /** - * array['byDN'] \OCA\user_ldap\lib\User[] - * ['byUid'] \OCA\user_ldap\lib\User[] + * array['byDN'] \OCA\User_LDAP\User\User[] + * ['byUid'] \OCA\User_LDAP\User\User[] * @var array $users */ protected $users = array( @@ -76,9 +73,9 @@ class Manager { /** * @param IConfig $ocConfig - * @param \OCA\user_ldap\lib\FilesystemHelper $ocFilesystem object that + * @param \OCA\User_LDAP\FilesystemHelper $ocFilesystem object that * gives access to necessary functions from the OC filesystem - * @param \OCA\user_ldap\lib\LogWrapper $ocLog + * @param \OCA\User_LDAP\LogWrapper $ocLog * @param IAvatarManager $avatarManager * @param Image $image an empty image instance * @param IDBConnection $db @@ -112,7 +109,7 @@ class Manager { * property array * @param string $dn the DN of the user * @param string $uid the internal (owncloud) username - * @return \OCA\user_ldap\lib\User\User + * @return \OCA\User_LDAP\User\User */ private function createAndCache($dn, $uid) { $this->checkAccess(); @@ -187,7 +184,7 @@ class Manager { /** * creates and returns an instance of OfflineUser for the specified user * @param string $id - * @return \OCA\user_ldap\lib\user\OfflineUser + * @return \OCA\User_LDAP\User\OfflineUser */ public function getDeletedUser($id) { return new OfflineUser( @@ -200,7 +197,7 @@ class Manager { /** * @brief returns a User object by it's ownCloud username * @param string $id the DN or username of the user - * @return \OCA\user_ldap\lib\user\User|\OCA\user_ldap\lib\user\OfflineUser|null + * @return \OCA\User_LDAP\User\User|\OCA\User_LDAP\User\OfflineUser|null */ protected function createInstancyByUserName($id) { //most likely a uid. Check whether it is a deleted user @@ -217,7 +214,7 @@ class Manager { /** * @brief returns a User object by it's DN or ownCloud username * @param string $id the DN or username of the user - * @return \OCA\user_ldap\lib\user\User|\OCA\user_ldap\lib\user\OfflineUser|null + * @return \OCA\User_LDAP\User\User|\OCA\User_LDAP\User\OfflineUser|null * @throws \Exception when connection could not be established */ public function get($id) { diff --git a/apps/user_ldap/lib/user/offlineuser.php b/apps/user_ldap/lib/User/OfflineUser.php index aee1a137a96..a3a9995490d 100644 --- a/apps/user_ldap/lib/user/offlineuser.php +++ b/apps/user_ldap/lib/User/OfflineUser.php @@ -21,7 +21,7 @@ * */ -namespace OCA\user_ldap\lib\user; +namespace OCA\User_LDAP\User; use OCA\User_LDAP\Mapping\UserMapping; diff --git a/apps/user_ldap/lib/user/user.php b/apps/user_ldap/lib/User/User.php index 4da8ae5f098..8f7666790c1 100644 --- a/apps/user_ldap/lib/user/user.php +++ b/apps/user_ldap/lib/User/User.php @@ -22,11 +22,11 @@ * */ -namespace OCA\user_ldap\lib\user; +namespace OCA\User_LDAP\User; -use OCA\user_ldap\lib\Connection; -use OCA\user_ldap\lib\FilesystemHelper; -use OCA\user_ldap\lib\LogWrapper; +use OCA\User_LDAP\Connection; +use OCA\User_LDAP\FilesystemHelper; +use OCA\User_LDAP\LogWrapper; use OCP\IAvatarManager; use OCP\IConfig; use OCP\Image; @@ -464,7 +464,7 @@ class User { } } if(!is_null($quota)) { - $user = $this->userManager->get($this->uid)->setQuota($quota); + $this->userManager->get($this->uid)->setQuota($quota); } } @@ -502,16 +502,13 @@ class User { */ private function setOwnCloudAvatar() { if(!$this->image->valid()) { - $this->log->log('user_ldap', 'jpegPhoto data invalid for '.$this->dn, - \OCP\Util::ERROR); + $this->log->log('jpegPhoto data invalid for '.$this->dn, \OCP\Util::ERROR); return; } //make sure it is a square and not bigger than 128x128 $size = min(array($this->image->width(), $this->image->height(), 128)); if(!$this->image->centerCrop($size)) { - $this->log->log('user_ldap', - 'croping image for avatar failed for '.$this->dn, - \OCP\Util::ERROR); + $this->log->log('croping image for avatar failed for '.$this->dn, \OCP\Util::ERROR); return; } diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/lib/User_LDAP.php index d6b345faf4b..87c603fc753 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -29,16 +29,14 @@ * */ -namespace OCA\user_ldap; +namespace OCA\User_LDAP; use OC\User\NoUserException; -use OCA\user_ldap\lib\BackendUtility; -use OCA\user_ldap\lib\Access; -use OCA\user_ldap\lib\user\OfflineUser; -use OCA\User_LDAP\lib\User\User; +use OCA\User_LDAP\User\OfflineUser; +use OCA\User_LDAP\User\User; use OCP\IConfig; -class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserInterface { +class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserInterface { /** @var string[] $homesToKill */ protected $homesToKill = array(); @@ -46,7 +44,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn protected $ocConfig; /** - * @param \OCA\user_ldap\lib\Access $access + * @param Access $access * @param \OCP\IConfig $ocConfig */ public function __construct(Access $access, IConfig $ocConfig) { @@ -100,7 +98,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn public function getLDAPUserByLoginName($loginName) { //find out dn of the user name $attrs = $this->access->userManager->getAttributes(); - $users = $this->access->fetchUsersByLoginName($loginName, $attrs, 1); + $users = $this->access->fetchUsersByLoginName($loginName, $attrs); if(count($users) < 1) { throw new \Exception('No user available for the given login name on ' . $this->access->connection->ldapHost . ':' . $this->access->connection->ldapPort); @@ -201,7 +199,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn /** * checks whether a user is still available on LDAP * - * @param string|\OCA\User_LDAP\lib\user\User $user either the ownCloud user + * @param string|\OCA\User_LDAP\User\User $user either the ownCloud user * name or an instance of that user * @return bool * @throws \Exception diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/lib/User_Proxy.php index 9ea0b6dd235..800d1d36c16 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -24,14 +24,12 @@ * */ -namespace OCA\user_ldap; +namespace OCA\User_LDAP; -use OCA\user_ldap\lib\ILDAPWrapper; -use OCA\User_LDAP\lib\User\User; -use \OCA\user_ldap\User_LDAP; +use OCA\User_LDAP\User\User; use OCP\IConfig; -class User_Proxy extends lib\Proxy implements \OCP\IUserBackend, \OCP\UserInterface { +class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface { private $backends = array(); private $refBackend = null; @@ -162,7 +160,7 @@ class User_Proxy extends lib\Proxy implements \OCP\IUserBackend, \OCP\UserInterf /** * check if a user exists on LDAP - * @param string|\OCA\User_LDAP\lib\User\User $user either the ownCloud user + * @param string|\OCA\User_LDAP\User\User $user either the ownCloud user * name or an instance of that user * @return boolean */ diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/Wizard.php index 0b475ee7143..f71d5af2c49 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -29,11 +29,12 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; use OC\ServerNotAvailableException; class Wizard extends LDAPUtility { + /** @var \OCP\IL10N */ static protected $l; protected $access; protected $cr; @@ -58,6 +59,7 @@ class Wizard extends LDAPUtility { * Constructor * @param Configuration $configuration an instance of Configuration * @param ILDAPWrapper $ldap an instance of ILDAPWrapper + * @param Access $access */ public function __construct(Configuration $configuration, ILDAPWrapper $ldap, Access $access) { parent::__construct($ldap); @@ -1032,12 +1034,12 @@ class Wizard extends LDAPUtility { $host = $this->configuration->ldapHost; $hostInfo = parse_url($host); if(!$hostInfo) { - throw new \Exception($this->l->t('Invalid Host')); + throw new \Exception(self::$l->t('Invalid Host')); } \OCP\Util::writeLog('user_ldap', 'Wiz: Attempting to connect ', \OCP\Util::DEBUG); $cr = $this->ldap->connect($host, $port); if(!is_resource($cr)) { - throw new \Exception($this->l->t('Invalid Host')); + throw new \Exception(self::$l->t('Invalid Host')); } \OCP\Util::writeLog('user_ldap', 'Wiz: Setting LDAP Options ', \OCP\Util::DEBUG); diff --git a/apps/user_ldap/lib/wizardresult.php b/apps/user_ldap/lib/WizardResult.php index 54f01cf59b8..1adce9a1389 100644 --- a/apps/user_ldap/lib/wizardresult.php +++ b/apps/user_ldap/lib/WizardResult.php @@ -23,7 +23,7 @@ * */ -namespace OCA\user_ldap\lib; +namespace OCA\User_LDAP; class WizardResult { protected $changes = array(); diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index 9d54684685a..40d02dfaa14 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -31,7 +31,7 @@ OC_Util::checkAdminUser(); // fill template $tmpl = new OCP\Template('user_ldap', 'settings'); -$helper = new \OCA\user_ldap\lib\Helper(); +$helper = new \OCA\User_LDAP\Helper(); $prefixes = $helper->getServerConfigurationPrefixes(); $hosts = $helper->getServerConfigurationHosts(); @@ -67,7 +67,7 @@ $tmpl->assign('toc', $toc); $tmpl->assign('settingControls', $sControls); // assign default values -$config = new \OCA\user_ldap\lib\Configuration('', false); +$config = new \OCA\User_LDAP\Configuration('', false); $defaults = $config->getDefaults(); foreach($defaults as $key => $default) { $tmpl->assign($key.'_default', $default); diff --git a/apps/user_ldap/tests/access.php b/apps/user_ldap/tests/AccessTest.php index 6d35adf1694..97012f8c720 100644 --- a/apps/user_ldap/tests/access.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -23,39 +23,38 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests; -use \OCA\user_ldap\lib\Access; -use \OCA\user_ldap\lib\Connection; -use \OCA\user_ldap\lib\ILDAPWrapper; +use OCA\User_LDAP\Access; +use OCA\User_LDAP\Connection; /** - * Class Test_Access + * Class AccessTest * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests */ -class Test_Access extends \Test\TestCase { +class AccessTest extends \Test\TestCase { private function getConnectorAndLdapMock() { static $conMethods; static $accMethods; static $umMethods; if(is_null($conMethods) || is_null($accMethods)) { - $conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); - $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); - $umMethods = get_class_methods('\OCA\user_ldap\lib\user\Manager'); + $conMethods = get_class_methods('\OCA\User_LDAP\Connection'); + $accMethods = get_class_methods('\OCA\User_LDAP\Access'); + $umMethods = get_class_methods('\OCA\User_LDAP\User\Manager'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); - $connector = $this->getMock('\OCA\user_ldap\lib\Connection', + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); + $connector = $this->getMock('\OCA\User_LDAP\Connection', $conMethods, array($lw, null, null)); - $um = $this->getMock('\OCA\user_ldap\lib\user\Manager', + $um = $this->getMock('\OCA\User_LDAP\User\Manager', $umMethods, array( $this->getMock('\OCP\IConfig'), - $this->getMock('\OCA\user_ldap\lib\FilesystemHelper'), - $this->getMock('\OCA\user_ldap\lib\LogWrapper'), + $this->getMock('\OCA\User_LDAP\FilesystemHelper'), + $this->getMock('\OCA\User_LDAP\LogWrapper'), $this->getMock('\OCP\IAvatarManager'), $this->getMock('\OCP\Image'), $this->getMock('\OCP\IDBConnection'), @@ -209,7 +208,7 @@ class Test_Access extends \Test\TestCase { public function testStringResemblesDNLDAPmod() { list($lw, $con, $um) = $this->getConnectorAndLdapMock(); - $lw = new \OCA\user_ldap\lib\LDAP(); + $lw = new \OCA\User_LDAP\LDAP(); $access = new Access($con, $lw, $um); if(!function_exists('ldap_explode_dn')) { @@ -244,7 +243,7 @@ class Test_Access extends \Test\TestCase { ->method('getNameByDN') ->will($this->returnValue('a_username')); - $userMock = $this->getMockBuilder('\OCA\user_ldap\lib\user\User') + $userMock = $this->getMockBuilder('\OCA\User_LDAP\User\User') ->disableOriginalConstructor() ->getMock(); diff --git a/apps/user_ldap/tests/configuration.php b/apps/user_ldap/tests/ConfigurationTest.php index 3b87223b75b..808a4c9ed04 100644 --- a/apps/user_ldap/tests/configuration.php +++ b/apps/user_ldap/tests/ConfigurationTest.php @@ -19,9 +19,9 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests; -class Test_Configuration extends \Test\TestCase { +class ConfigurationTest extends \Test\TestCase { public function configurationDataProvider() { $inputWithDN = array( @@ -89,7 +89,7 @@ class Test_Configuration extends \Test\TestCase { * @dataProvider configurationDataProvider */ public function testSetValue($key, $input, $expected) { - $configuration = new \OCA\user_ldap\lib\Configuration('t01', false); + $configuration = new \OCA\User_LDAP\Configuration('t01', false); $settingsInput = array( 'ldapBaseUsers' => array( diff --git a/apps/user_ldap/tests/connection.php b/apps/user_ldap/tests/ConnectionTest.php index a6ccf4b340b..ad0bed240cc 100644 --- a/apps/user_ldap/tests/connection.php +++ b/apps/user_ldap/tests/ConnectionTest.php @@ -22,18 +22,18 @@ * */ -namespace OCA\user_ldap\tests; -use OCA\user_ldap\lib\Connection; +namespace OCA\User_LDAP\Tests; +use OCA\User_LDAP\Connection; /** * Class Test_Connection * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests */ -class Test_Connection extends \Test\TestCase { - /** @var \OCA\user_ldap\lib\ILDAPWrapper */ +class ConnectionTest extends \Test\TestCase { + /** @var \OCA\User_LDAP\ILDAPWrapper */ protected $ldap; /** @var Connection */ @@ -42,9 +42,9 @@ class Test_Connection extends \Test\TestCase { public function setUp() { parent::setUp(); - $this->ldap = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $this->ldap = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); // we use a mock here to replace the cache mechanism, due to missing DI in LDAP backend. - $this->connection = $this->getMockBuilder('OCA\user_ldap\lib\Connection') + $this->connection = $this->getMockBuilder('OCA\User_LDAP\Connection') ->setMethods(['getFromCache', 'writeToCache']) ->setConstructorArgs([$this->ldap, '', null]) ->getMock(); @@ -58,7 +58,7 @@ class Test_Connection extends \Test\TestCase { //background: upon login a bind is done with the user credentials //which is valid for the whole LDAP resource. It needs to be reset //to the agent's credentials - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $connection = new Connection($lw, '', null); $agent = array( diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/Group_LDAPTest.php index 51bb1d84732..bf9f40a1b2f 100644 --- a/apps/user_ldap/tests/group_ldap.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -24,37 +24,36 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests; -use \OCA\user_ldap\GROUP_LDAP as GroupLDAP; -use \OCA\user_ldap\lib\Access; -use \OCA\user_ldap\lib\Connection; -use \OCA\user_ldap\lib\ILDAPWrapper; +use OCA\User_LDAP\Group_LDAP as GroupLDAP; +use OCA\User_LDAP\Access; +use OCA\User_LDAP\Connection; /** - * Class Test_Group_Ldap + * Class GroupLDAPTest * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests */ -class Test_Group_Ldap extends \Test\TestCase { +class Group_LDAPTest extends \Test\TestCase { private function getAccessMock() { static $conMethods; static $accMethods; if(is_null($conMethods) || is_null($accMethods)) { - $conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); - $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); + $conMethods = get_class_methods('\OCA\User_LDAP\Connection'); + $accMethods = get_class_methods('\OCA\User_LDAP\Access'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); - $connector = $this->getMock('\OCA\user_ldap\lib\Connection', + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); + $connector = $this->getMock('\OCA\User_LDAP\Connection', $conMethods, array($lw, null, null)); - $um = $this->getMockBuilder('\OCA\user_ldap\lib\user\Manager') + $um = $this->getMockBuilder('\OCA\User_LDAP\User\Manager') ->disableOriginalConstructor() ->getMock(); - $access = $this->getMock('\OCA\user_ldap\lib\Access', + $access = $this->getMock('\OCA\User_LDAP\Access', $accMethods, array($connector, $lw, $um)); @@ -325,7 +324,7 @@ class Test_Group_Ldap extends \Test\TestCase { * tests that a user listing is complete, if all it's members have the group * as their primary. */ - public function testUsersInGroupPrimaryMembersOnly() { + public function testUsersInGroupPrimaryMembersOnly() { $access = $this->getAccessMock(); $this->enableGroups($access); @@ -360,7 +359,7 @@ class Test_Group_Ldap extends \Test\TestCase { * tests that a user counting is complete, if all it's members have the group * as their primary. */ - public function testCountUsersInGroupPrimaryMembersOnly() { + public function testCountUsersInGroupPrimaryMembersOnly() { $access = $this->getAccessMock(); $this->enableGroups($access); diff --git a/apps/user_ldap/tests/integration/abstractintegrationtest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php index 10ce7378830..a736956ebf2 100644 --- a/apps/user_ldap/tests/integration/abstractintegrationtest.php +++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php @@ -19,12 +19,12 @@ * */ -namespace OCA\user_ldap\tests\integration; +namespace OCA\User_LDAP\Tests\Integration; -use OCA\user_ldap\lib\Access; -use OCA\user_ldap\lib\Connection; -use OCA\user_ldap\lib\LDAP; -use OCA\user_ldap\lib\user\Manager; +use OCA\User_LDAP\Access; +use OCA\User_LDAP\Connection; +use OCA\User_LDAP\LDAP; +use OCA\User_LDAP\User\Manager; abstract class AbstractIntegrationTest { /** @var LDAP */ diff --git a/apps/user_ldap/tests/integration/exceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php index 4813bd9ff5e..06c2585fb0b 100644 --- a/apps/user_ldap/tests/integration/exceptionOnLostConnection.php +++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php @@ -19,8 +19,11 @@ * */ +namespace OCA\User_LDAP\Tests\Integration; + + use OC\ServerNotAvailableException; -use OCA\user_ldap\lib\LDAP; +use OCA\User_LDAP\LDAP; /** * Class ExceptionOnLostConnection @@ -51,7 +54,7 @@ class ExceptionOnLostConnection { /** @var string */ private $ldapHost; - /** @var OCA\user_ldap\lib\LDAP */ + /** @var \OCA\User_LDAP\LDAP */ private $ldap; /** @var bool */ @@ -86,7 +89,7 @@ class ExceptionOnLostConnection { * the LDAP backend, as well as getting information about toxiproxy. * Also creates an instance of the LDAP class, the testee * - * @throws Exception + * @throws \Exception */ public function setUp() { require_once __DIR__ . '/../../../../lib/base.php'; @@ -142,7 +145,7 @@ class ExceptionOnLostConnection { * * @param resource $ch * @param mixed $result - * @throws Exception + * @throws \Exception */ private function checkCurlResult($ch, $result) { if($result === false) { @@ -156,7 +159,7 @@ class ExceptionOnLostConnection { * enables or disabled the LDAP proxy service in toxiproxy * * @param bool $isEnabled whether is should be enabled or disables - * @throws Exception + * @throws \Exception */ private function setProxyState($isEnabled) { if(!is_bool($isEnabled)) { diff --git a/apps/user_ldap/tests/integration/fakemanager.php b/apps/user_ldap/tests/Integration/FakeManager.php index 7d6ea0f3c13..11f270dba01 100644 --- a/apps/user_ldap/tests/integration/fakemanager.php +++ b/apps/user_ldap/tests/Integration/FakeManager.php @@ -19,16 +19,16 @@ * */ -namespace OCA\user_ldap\tests\integration; +namespace OCA\User_LDAP\Tests\Integration; /** * Class FakeManager * - * this is a mock of \OCA\user_ldap\lib\user\Manager which is a dependency of + * this is a mock of \OCA\User_LDAP\User\Manager which is a dependency of * Access, that pulls plenty more things in. Because it is not needed in the * scope of these tests, we replace it with a mock. */ -class FakeManager extends \OCA\user_ldap\lib\user\Manager { +class FakeManager extends \OCA\User_LDAP\User\Manager { public function __construct() { $this->ocConfig = \OC::$server->getConfig(); $this->image = new \OCP\Image(); diff --git a/apps/user_ldap/tests/integration/lib/IntegrationTestAccessGroupsMatchFilter.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestAccessGroupsMatchFilter.php index af553c01728..d058540bd4c 100644 --- a/apps/user_ldap/tests/integration/lib/IntegrationTestAccessGroupsMatchFilter.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestAccessGroupsMatchFilter.php @@ -19,10 +19,10 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\Connection; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; + +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; require_once __DIR__ . '/../../../../../lib/base.php'; diff --git a/apps/user_ldap/tests/integration/lib/integrationtestbackupserver.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestBackupServer.php index 4faf173af11..6c3907eb062 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestbackupserver.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestBackupServer.php @@ -19,20 +19,19 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\user\Manager as LDAPUserManager; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\USER_LDAP; +use OCA\User_LDAP\User_LDAP; require_once __DIR__ . '/../../../../../lib/base.php'; -class IntegrationBackupServer extends AbstractIntegrationTest { +class IntegrationTestBackupServer extends AbstractIntegrationTest { /** @var UserMapping */ protected $mapping; - /** @var USER_LDAP */ + /** @var User_LDAP */ protected $backend; /** @@ -113,6 +112,6 @@ class IntegrationBackupServer extends AbstractIntegrationTest { } require_once(__DIR__ . '/../setup-scripts/config.php'); -$test = new IntegrationBackupServer($host, $port, $adn, $apwd, $bdn); +$test = new IntegrationTestBackupServer($host, $port, $adn, $apwd, $bdn); $test->init(); $test->run(); diff --git a/apps/user_ldap/tests/integration/lib/integrationtestbatchapplyuserattributes.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php index 587811eb13c..89afcaa4b90 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestbatchapplyuserattributes.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php @@ -19,10 +19,10 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; require_once __DIR__ . '/../../../../../lib/base.php'; diff --git a/apps/user_ldap/tests/integration/lib/integrationtestconnect.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestConnect.php index ad4d0a3da7e..fb6886189a6 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestconnect.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestConnect.php @@ -19,20 +19,19 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\user\Manager as LDAPUserManager; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\USER_LDAP; +use OCA\User_LDAP\User_LDAP; require_once __DIR__ . '/../../../../../lib/base.php'; -class IntegrationConnect extends AbstractIntegrationTest { +class IntegrationTestConnect extends AbstractIntegrationTest { /** @var UserMapping */ protected $mapping; - /** @var USER_LDAP */ + /** @var User_LDAP */ protected $backend; /** @var string */ @@ -161,6 +160,6 @@ class IntegrationConnect extends AbstractIntegrationTest { } require_once(__DIR__ . '/../setup-scripts/config.php'); -$test = new IntegrationConnect($host, $port, $adn, $apwd, $bdn); +$test = new IntegrationTestConnect($host, $port, $adn, $apwd, $bdn); $test->init(); $test->run(); diff --git a/apps/user_ldap/tests/integration/lib/integrationtestcountusersbyloginname.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestCountUsersByLoginName.php index 861638e25bd..5a49ed165ab 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestcountusersbyloginname.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestCountUsersByLoginName.php @@ -19,16 +19,13 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\user\Manager as LDAPUserManager; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; -use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\USER_LDAP; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; require_once __DIR__ . '/../../../../../lib/base.php'; -class IntegrationTestUserHome extends AbstractIntegrationTest { +class IntegrationTestCountUsersByLoginName extends AbstractIntegrationTest { /** * prepares the LDAP environment and sets up a test configuration for @@ -63,6 +60,6 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { } require_once(__DIR__ . '/../setup-scripts/config.php'); -$test = new IntegrationTestUserHome($host, $port, $adn, $apwd, $bdn); +$test = new IntegrationTestCountUsersByLoginName($host, $port, $adn, $apwd, $bdn); $test->init(); $test->run(); diff --git a/apps/user_ldap/tests/integration/lib/integrationtestfetchusersbyloginname.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php index fb2cb45e9e7..06aa2cea8fc 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestfetchusersbyloginname.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestFetchUsersByLoginName.php @@ -19,20 +19,19 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\user\Manager as LDAPUserManager; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\USER_LDAP; +use OCA\User_LDAP\User_LDAP; require_once __DIR__ . '/../../../../../lib/base.php'; -class IntegrationTestUserHome extends AbstractIntegrationTest { +class IntegrationTestFetchUsersByLoginName extends AbstractIntegrationTest { /** @var UserMapping */ protected $mapping; - /** @var USER_LDAP */ + /** @var User_LDAP */ protected $backend; /** @@ -46,7 +45,7 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $this->backend = new \OCA\user_ldap\USER_LDAP($this->access, \OC::$server->getConfig()); + $this->backend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); } /** @@ -74,6 +73,6 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { } require_once(__DIR__ . '/../setup-scripts/config.php'); -$test = new IntegrationTestUserHome($host, $port, $adn, $apwd, $bdn); +$test = new IntegrationTestFetchUsersByLoginName($host, $port, $adn, $apwd, $bdn); $test->init(); $test->run(); diff --git a/apps/user_ldap/tests/integration/lib/integrationtestpaging.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php index 94f7d7fd0f5..72cc3e459b7 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestpaging.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestPaging.php @@ -19,12 +19,11 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\user\Manager as LDAPUserManager; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\USER_LDAP; +use OCA\User_LDAP\User_LDAP; require_once __DIR__ . '/../../../../../lib/base.php'; @@ -32,7 +31,7 @@ class IntegrationTestPaging extends AbstractIntegrationTest { /** @var UserMapping */ protected $mapping; - /** @var USER_LDAP */ + /** @var User_LDAP */ protected $backend; /** @@ -43,7 +42,7 @@ class IntegrationTestPaging extends AbstractIntegrationTest { require(__DIR__ . '/../setup-scripts/createExplicitUsers.php'); parent::init(); - $this->backend = new \OCA\user_ldap\USER_LDAP($this->access, \OC::$server->getConfig()); + $this->backend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); } /** diff --git a/apps/user_ldap/tests/integration/lib/integrationtestuserhome.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php index 8d36e1f2dfe..8538fd2f964 100644 --- a/apps/user_ldap/tests/integration/lib/integrationtestuserhome.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php @@ -19,12 +19,12 @@ * */ -namespace OCA\user_ldap\tests\integration\lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; -use OCA\user_ldap\lib\user\Manager as LDAPUserManager; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\User\Manager as LDAPUserManager; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\USER_LDAP; +use OCA\User_LDAP\User_LDAP; require_once __DIR__ . '/../../../../../lib/base.php'; @@ -32,7 +32,7 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { /** @var UserMapping */ protected $mapping; - /** @var USER_LDAP */ + /** @var User_LDAP */ protected $backend; /** @@ -46,7 +46,7 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $this->backend = new \OCA\user_ldap\USER_LDAP($this->access, \OC::$server->getConfig()); + $this->backend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); } /** @@ -66,11 +66,12 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { protected function initUserManager() { $this->userManager = new LDAPUserManager( \OC::$server->getConfig(), - new \OCA\user_ldap\lib\FilesystemHelper(), - new \OCA\user_ldap\lib\LogWrapper(), + new \OCA\User_LDAP\FilesystemHelper(), + new \OCA\User_LDAP\LogWrapper(), \OC::$server->getAvatarManager(), new \OCP\Image(), - \OC::$server->getDatabaseConnection() + \OC::$server->getDatabaseConnection(), + \OC::$server->getUserManager() ); } @@ -82,7 +83,7 @@ class IntegrationTestUserHome extends AbstractIntegrationTest { */ protected function case1() { \OC::$server->getConfig()->setAppValue('user_ldap', 'enforce_home_folder_naming_rule', false); - $userManager = \oc::$server->getUserManager(); + $userManager = \OC::$server->getUserManager(); $userManager->clearBackends(); $userManager->registerBackend($this->backend); $users = $userManager->search('', 5, 0); diff --git a/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php index fd53838df19..5f555956ea2 100644 --- a/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php @@ -20,9 +20,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -use OCA\user_ldap\lib\user\User; + +namespace OCA\User_LDAP\Tests\Integration\Lib\User; + +use OCA\User_LDAP\User\User; use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; require_once __DIR__ . '/../../../../../../lib/base.php'; @@ -40,7 +43,7 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest { $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $userBackend = new OCA\user_ldap\USER_LDAP($this->access, \OC::$server->getConfig()); + $userBackend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); \OC_User::useBackend($userBackend); } @@ -118,10 +121,10 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest { } protected function initUserManager() { - $this->userManager = new \OCA\user_ldap\lib\user\Manager( + $this->userManager = new \OCA\User_LDAP\User\Manager( \OC::$server->getConfig(), - new \OCA\user_ldap\lib\FilesystemHelper(), - new \OCA\user_ldap\lib\LogWrapper(), + new \OCA\User_LDAP\FilesystemHelper(), + new \OCA\User_LDAP\LogWrapper(), \OC::$server->getAvatarManager(), new \OCP\Image(), \OC::$server->getDatabaseConnection(), diff --git a/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserDisplayName.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php index f82afe9009d..07ab2e287ca 100644 --- a/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserDisplayName.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php @@ -18,9 +18,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -use OCA\user_ldap\lib\user\User; + +namespace OCA\User_LDAP\Tests\Integration\Lib\User; + use OCA\User_LDAP\Mapping\UserMapping; -use OCA\user_ldap\tests\integration\AbstractIntegrationTest; +use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; require_once __DIR__ . '/../../../../../../lib/base.php'; @@ -38,7 +40,7 @@ class IntegrationTestUserDisplayName extends AbstractIntegrationTest { $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $userBackend = new OCA\user_ldap\USER_LDAP($this->access, \OC::$server->getConfig()); + $userBackend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); \OC_User::useBackend($userBackend); } diff --git a/apps/user_ldap/tests/integration/data/avatar-invalid.gif b/apps/user_ldap/tests/Integration/data/avatar-invalid.gif Binary files differindex 000108834d8..000108834d8 100644 --- a/apps/user_ldap/tests/integration/data/avatar-invalid.gif +++ b/apps/user_ldap/tests/Integration/data/avatar-invalid.gif diff --git a/apps/user_ldap/tests/integration/data/avatar-valid.jpg b/apps/user_ldap/tests/Integration/data/avatar-valid.jpg Binary files differindex 61b5ec2e730..61b5ec2e730 100644 --- a/apps/user_ldap/tests/integration/data/avatar-valid.jpg +++ b/apps/user_ldap/tests/Integration/data/avatar-valid.jpg diff --git a/apps/user_ldap/tests/integration/readme.md b/apps/user_ldap/tests/Integration/readme.md index e20efef8fdc..e20efef8fdc 100644 --- a/apps/user_ldap/tests/integration/readme.md +++ b/apps/user_ldap/tests/Integration/readme.md diff --git a/apps/user_ldap/tests/integration/run-test.sh b/apps/user_ldap/tests/Integration/run-test.sh index 7a29db25670..7a29db25670 100755 --- a/apps/user_ldap/tests/integration/run-test.sh +++ b/apps/user_ldap/tests/Integration/run-test.sh diff --git a/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php b/apps/user_ldap/tests/Integration/setup-scripts/createExplicitGroups.php index 57a304be057..57a304be057 100644 --- a/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php +++ b/apps/user_ldap/tests/Integration/setup-scripts/createExplicitGroups.php diff --git a/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroupsDifferentOU.php b/apps/user_ldap/tests/Integration/setup-scripts/createExplicitGroupsDifferentOU.php index 62480c5160c..62480c5160c 100644 --- a/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroupsDifferentOU.php +++ b/apps/user_ldap/tests/Integration/setup-scripts/createExplicitGroupsDifferentOU.php diff --git a/apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php b/apps/user_ldap/tests/Integration/setup-scripts/createExplicitUsers.php index fb5609865c4..fb5609865c4 100644 --- a/apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php +++ b/apps/user_ldap/tests/Integration/setup-scripts/createExplicitUsers.php diff --git a/apps/user_ldap/tests/integration/setup-scripts/createUsersWithoutDisplayName.php b/apps/user_ldap/tests/Integration/setup-scripts/createUsersWithoutDisplayName.php index 687b1da91e1..687b1da91e1 100644 --- a/apps/user_ldap/tests/integration/setup-scripts/createUsersWithoutDisplayName.php +++ b/apps/user_ldap/tests/Integration/setup-scripts/createUsersWithoutDisplayName.php diff --git a/apps/user_ldap/tests/jobs/cleanup.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php index 4c6893b19cf..24f646bd90f 100644 --- a/apps/user_ldap/tests/jobs/cleanup.php +++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php @@ -20,22 +20,22 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests\Jobs; -class Test_CleanUp extends \PHPUnit_Framework_TestCase { +class CleanUpTest extends \Test\TestCase { public function getMocks() { $mocks = array(); $mocks['userBackend'] = - $this->getMockBuilder('\OCA\user_ldap\User_Proxy') + $this->getMockBuilder('\OCA\User_LDAP\User_Proxy') ->disableOriginalConstructor() ->getMock(); $mocks['deletedUsersIndex'] = - $this->getMockBuilder('\OCA\user_ldap\lib\user\deletedUsersIndex') + $this->getMockBuilder('\OCA\User_LDAP\User\DeletedUsersIndex') ->disableOriginalConstructor() ->getMock(); $mocks['ocConfig'] = $this->getMock('\OCP\IConfig'); $mocks['db'] = $this->getMock('\OCP\IDBConnection'); - $mocks['helper'] = $this->getMock('\OCA\user_ldap\lib\Helper'); + $mocks['helper'] = $this->getMock('\OCA\User_LDAP\Helper'); return $mocks; } diff --git a/apps/user_ldap/tests/mapping/abstractmappingtest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php index a931a07a44c..b800862d2c1 100644 --- a/apps/user_ldap/tests/mapping/abstractmappingtest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php @@ -20,7 +20,7 @@ * */ -namespace OCA\user_ldap\tests\mapping; +namespace OCA\User_LDAP\Tests\Mapping; abstract class AbstractMappingTest extends \Test\TestCase { abstract public function getMapper(\OCP\IDBConnection $dbMock); diff --git a/apps/user_ldap/tests/mapping/groupmapping.php b/apps/user_ldap/tests/Mapping/GroupMappingTest.php index e25fae9329f..5cdb9d463b2 100644 --- a/apps/user_ldap/tests/mapping/groupmapping.php +++ b/apps/user_ldap/tests/Mapping/GroupMappingTest.php @@ -21,18 +21,18 @@ * */ -namespace OCA\user_ldap\tests\mapping; +namespace OCA\User_LDAP\Tests\Mapping; use OCA\User_LDAP\Mapping\GroupMapping; /** - * Class Test_GroupMapping + * Class GroupMappingTest * * @group DB * - * @package OCA\user_ldap\tests\mapping + * @package OCA\User_LDAP\Tests\Mapping */ -class Test_GroupMapping extends AbstractMappingTest { +class GroupMappingTest extends AbstractMappingTest { public function getMapper(\OCP\IDBConnection $dbMock) { return new GroupMapping($dbMock); } diff --git a/apps/user_ldap/tests/mapping/usermapping.php b/apps/user_ldap/tests/Mapping/UserMappingTest.php index 6138740b81a..90618962393 100644 --- a/apps/user_ldap/tests/mapping/usermapping.php +++ b/apps/user_ldap/tests/Mapping/UserMappingTest.php @@ -21,18 +21,18 @@ * */ -namespace OCA\user_ldap\tests\mapping; +namespace OCA\User_LDAP\Tests\Mapping; use OCA\User_LDAP\Mapping\UserMapping; /** - * Class Test_UserMapping + * Class UserMappingTest * * @group DB * - * @package OCA\user_ldap\tests\mapping + * @package OCA\User_LDAP\Tests\Mapping */ -class Test_UserMapping extends AbstractMappingTest { +class UserMappingTest extends AbstractMappingTest { public function getMapper(\OCP\IDBConnection $dbMock) { return new UserMapping($dbMock); } diff --git a/apps/user_ldap/tests/user/manager.php b/apps/user_ldap/tests/User/ManagerTest.php index c4af1009df8..848918729d7 100644 --- a/apps/user_ldap/tests/user/manager.php +++ b/apps/user_ldap/tests/User/ManagerTest.php @@ -23,31 +23,31 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests\User; -use OCA\user_ldap\lib\user\Manager; +use OCA\User_LDAP\User\Manager; /** * Class Test_User_Manager * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests\User */ -class Test_User_Manager extends \Test\TestCase { +class ManagerTest extends \Test\TestCase { private function getTestInstances() { - $access = $this->getMock('\OCA\user_ldap\lib\user\IUserTools'); + $access = $this->getMock('\OCA\User_LDAP\User\IUserTools'); $config = $this->getMock('\OCP\IConfig'); - $filesys = $this->getMock('\OCA\user_ldap\lib\FilesystemHelper'); - $log = $this->getMock('\OCA\user_ldap\lib\LogWrapper'); + $filesys = $this->getMock('\OCA\User_LDAP\FilesystemHelper'); + $log = $this->getMock('\OCA\User_LDAP\LogWrapper'); $avaMgr = $this->getMock('\OCP\IAvatarManager'); $image = $this->getMock('\OCP\Image'); $dbc = $this->getMock('\OCP\IDBConnection'); $userMgr = $this->getMock('\OCP\IUserManager'); - $connection = new \OCA\user_ldap\lib\Connection( - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'), + $connection = new \OCA\User_LDAP\Connection( + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'), '', null ); @@ -87,7 +87,7 @@ class Test_User_Manager extends \Test\TestCase { // runtime caching the manager is broken. $user = $manager->get($inputDN); - $this->assertInstanceOf('\OCA\user_ldap\lib\user\User', $user); + $this->assertInstanceOf('\OCA\User_LDAP\User\User', $user); } public function testGetByEDirectoryDN() { @@ -114,7 +114,7 @@ class Test_User_Manager extends \Test\TestCase { $manager->setLdapAccess($access); $user = $manager->get($inputDN); - $this->assertInstanceOf('\OCA\user_ldap\lib\user\User', $user); + $this->assertInstanceOf('\OCA\User_LDAP\User\User', $user); } public function testGetByExoticDN() { @@ -141,7 +141,7 @@ class Test_User_Manager extends \Test\TestCase { $manager->setLdapAccess($access); $user = $manager->get($inputDN); - $this->assertInstanceOf('\OCA\user_ldap\lib\user\User', $user); + $this->assertInstanceOf('\OCA\User_LDAP\User\User', $user); } public function testGetByDNNotExisting() { @@ -200,7 +200,7 @@ class Test_User_Manager extends \Test\TestCase { // runtime caching the manager is broken. $user = $manager->get($uid); - $this->assertInstanceOf('\OCA\user_ldap\lib\user\User', $user); + $this->assertInstanceOf('\OCA\User_LDAP\User\User', $user); } public function testGetByUidNotExisting() { diff --git a/apps/user_ldap/tests/user/user.php b/apps/user_ldap/tests/User/UserTest.php index ed04520aa74..7362348c326 100644 --- a/apps/user_ldap/tests/user/user.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -22,25 +22,25 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests\User; -use OCA\user_ldap\lib\user\User; +use OCA\User_LDAP\User\User; use OCP\IUserManager; /** - * Class Test_User_User + * Class UserTest * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests\User */ -class Test_User_User extends \Test\TestCase { +class UserTest extends \Test\TestCase { private function getTestInstances() { - $access = $this->getMock('\OCA\user_ldap\lib\user\IUserTools'); + $access = $this->getMock('\OCA\User_LDAP\User\IUserTools'); $config = $this->getMock('\OCP\IConfig'); - $filesys = $this->getMock('\OCA\user_ldap\lib\FilesystemHelper'); - $log = $this->getMock('\OCA\user_ldap\lib\LogWrapper'); + $filesys = $this->getMock('\OCA\User_LDAP\FilesystemHelper'); + $log = $this->getMock('\OCA\User_LDAP\LogWrapper'); $avaMgr = $this->getMock('\OCP\IAvatarManager'); $image = $this->getMock('\OCP\Image'); $dbc = $this->getMock('\OCP\IDBConnection'); @@ -55,22 +55,22 @@ class Test_User_User extends \Test\TestCase { static $umMethods; if(is_null($conMethods) || is_null($accMethods)) { - $conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); - $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); + $conMethods = get_class_methods('\OCA\User_LDAP\Connection'); + $accMethods = get_class_methods('\OCA\User_LDAP\Access'); //getConnection shall not be replaced unset($accMethods[array_search('getConnection', $accMethods)]); - $umMethods = get_class_methods('\OCA\user_ldap\lib\user\Manager'); + $umMethods = get_class_methods('\OCA\User_LDAP\User\Manager'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); $im = $this->getMock('\OCP\Image'); if (is_null($userMgr)) { $userMgr = $this->getMock('\OCP\IUserManager'); } - $um = $this->getMock('\OCA\user_ldap\lib\user\Manager', + $um = $this->getMock('\OCA\User_LDAP\User\Manager', $umMethods, array($cfMock, $fsMock, $logMock, $avaMgr, $im, $dbc, $userMgr)); - $connector = $this->getMock('\OCA\user_ldap\lib\Connection', + $connector = $this->getMock('\OCA\User_LDAP\Connection', $conMethods, array($lw, null, null)); - $access = $this->getMock('\OCA\user_ldap\lib\Access', + $access = $this->getMock('\OCA\User_LDAP\Access', $accMethods, array($connector, $lw, $um)); return array($access, $connector); @@ -763,7 +763,7 @@ class Test_User_User extends \Test\TestCase { 'updateAvatar' ); - $userMock = $this->getMockBuilder('OCA\user_ldap\lib\user\User') + $userMock = $this->getMockBuilder('OCA\User_LDAP\User\User') ->setConstructorArgs(array($uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr)) ->setMethods($requiredMethods) ->getMock(); diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/User_LDAPTest.php index 0ae18a2aa96..b4d346470d3 100644 --- a/apps/user_ldap/tests/user_ldap.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -25,21 +25,20 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests; -use \OCA\user_ldap\USER_LDAP as UserLDAP; -use \OCA\user_ldap\lib\Access; -use \OCA\user_ldap\lib\Connection; -use \OCA\user_ldap\lib\ILDAPWrapper; +use OCA\User_LDAP\User_LDAP as UserLDAP; +use \OCA\User_LDAP\Access; +use \OCA\User_LDAP\Connection; /** * Class Test_User_Ldap_Direct * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests */ -class Test_User_Ldap_Direct extends \Test\TestCase { +class User_LDAPTest extends \Test\TestCase { protected $backend; protected $access; protected $configMock; @@ -57,31 +56,31 @@ class Test_User_Ldap_Direct extends \Test\TestCase { static $uMethods; if(is_null($conMethods) || is_null($accMethods)) { - $conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); - $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); + $conMethods = get_class_methods('\OCA\User_LDAP\Connection'); + $accMethods = get_class_methods('\OCA\User_LDAP\Access'); unset($accMethods[array_search('getConnection', $accMethods)]); - $uMethods = get_class_methods('\OCA\user_ldap\lib\user\User'); + $uMethods = get_class_methods('\OCA\User_LDAP\User\User'); unset($uMethods[array_search('getUsername', $uMethods)]); unset($uMethods[array_search('getDN', $uMethods)]); unset($uMethods[array_search('__construct', $uMethods)]); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); - $connector = $this->getMock('\OCA\user_ldap\lib\Connection', + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); + $connector = $this->getMock('\OCA\User_LDAP\Connection', $conMethods, array($lw, null, null)); $this->configMock = $this->getMock('\OCP\IConfig'); - $offlineUser = $this->getMockBuilder('\OCA\user_ldap\lib\user\OfflineUser') + $offlineUser = $this->getMockBuilder('\OCA\User_LDAP\User\OfflineUser') ->disableOriginalConstructor() ->getMock(); - $um = $this->getMockBuilder('\OCA\user_ldap\lib\user\Manager') + $um = $this->getMockBuilder('\OCA\User_LDAP\User\Manager') ->setMethods(['getDeletedUser']) ->setConstructorArgs([ $this->configMock, - $this->getMock('\OCA\user_ldap\lib\FilesystemHelper'), - $this->getMock('\OCA\user_ldap\lib\LogWrapper'), + $this->getMock('\OCA\User_LDAP\FilesystemHelper'), + $this->getMock('\OCA\User_LDAP\LogWrapper'), $this->getMock('\OCP\IAvatarManager'), $this->getMock('\OCP\Image'), $this->getMock('\OCP\IDBConnection'), @@ -93,7 +92,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { ->method('getDeletedUser') ->will($this->returnValue($offlineUser)); - $access = $this->getMock('\OCA\user_ldap\lib\Access', + $access = $this->getMock('\OCA\User_LDAP\Access', $accMethods, array($connector, $lw, $um)); @@ -127,8 +126,8 @@ class Test_User_Ldap_Direct extends \Test\TestCase { /** * Prepares the Access mock for checkPassword tests - * @param \OCA\user_ldap\lib\Access $access mock - * @param bool noDisplayName + * @param \OCA\User_LDAP\Access $access mock + * @param bool $noDisplayName * @return void */ private function prepareAccessForCheckPassword(&$access, $noDisplayName = false) { @@ -296,7 +295,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { /** * Prepares the Access mock for getUsers tests - * @param \OCA\user_ldap\lib\Access $access mock + * @param \OCA\User_LDAP\Access $access mock * @return void */ private function prepareAccessForGetUsers(&$access) { diff --git a/apps/user_ldap/tests/wizard.php b/apps/user_ldap/tests/WizardTest.php index 33fb2712e23..7a4a478d43a 100644 --- a/apps/user_ldap/tests/wizard.php +++ b/apps/user_ldap/tests/WizardTest.php @@ -23,23 +23,18 @@ * */ -namespace OCA\user_ldap\tests; +namespace OCA\User_LDAP\Tests; -use \OCA\user_ldap\lib\Wizard; - -// use \OCA\user_ldap\USER_LDAP as UserLDAP; -// use \OCA\user_ldap\lib\Access; -// use \OCA\user_ldap\lib\Configuration; -// use \OCA\user_ldap\lib\ILDAPWrapper; +use \OCA\User_LDAP\Wizard; /** * Class Test_Wizard * * @group DB * - * @package OCA\user_ldap\tests + * @package OCA\User_LDAP\Tests */ -class Test_Wizard extends \Test\TestCase { +class WizardTest extends \Test\TestCase { protected function setUp() { parent::setUp(); //we need to make sure the consts are defined, otherwise tests will fail @@ -59,21 +54,21 @@ class Test_Wizard extends \Test\TestCase { static $accMethods; if(is_null($confMethods)) { - $confMethods = get_class_methods('\OCA\user_ldap\lib\Configuration'); - $connMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); - $accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); + $confMethods = get_class_methods('\OCA\User_LDAP\Configuration'); + $connMethods = get_class_methods('\OCA\User_LDAP\Connection'); + $accMethods = get_class_methods('\OCA\User_LDAP\Access'); } - $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); - $conf = $this->getMock('\OCA\user_ldap\lib\Configuration', + $lw = $this->getMock('\OCA\User_LDAP\ILDAPWrapper'); + $conf = $this->getMock('\OCA\User_LDAP\Configuration', $confMethods, array($lw, null, null)); - $connector = $this->getMock('\OCA\user_ldap\lib\Connection', + $connector = $this->getMock('\OCA\User_LDAP\Connection', $connMethods, array($lw, null, null)); - $um = $this->getMockBuilder('\OCA\user_ldap\lib\user\Manager') + $um = $this->getMockBuilder('\OCA\User_LDAP\User\Manager') ->disableOriginalConstructor() ->getMock(); - $access = $this->getMock('\OCA\user_ldap\lib\Access', + $access = $this->getMock('\OCA\User_LDAP\Access', $accMethods, array($connector, $lw, $um)); return array(new Wizard($conf, $lw, $access), $conf, $lw, $access); diff --git a/lib/private/Repair/DropOldJobs.php b/lib/private/Repair/DropOldJobs.php index c040aa03961..f0ebf29065d 100644 --- a/lib/private/Repair/DropOldJobs.php +++ b/lib/private/Repair/DropOldJobs.php @@ -73,8 +73,12 @@ class DropOldJobs implements IRepairStep { ['class' => 'OC_Cache_FileGlobalGC', 'arguments' => null], ['class' => 'OC\Cache\FileGlobalGC', 'arguments' => null], ['class' => 'OCA\Files\BackgroundJob\DeleteOrphanedTagsJob', 'arguments' => null], + ['class' => 'OCA\Files_sharing\Lib\DeleteOrphanedSharesJob', 'arguments' => null], ['class' => 'OCA\Files_sharing\ExpireSharesJob', 'arguments' => null], + + ['class' => 'OCA\user_ldap\lib\Jobs', 'arguments' => null], + ['class' => '\OCA\User_LDAP\Jobs\CleanUp', 'arguments' => null], ]; } diff --git a/settings/users.php b/settings/users.php index 347cad21a2b..fe20b0e84f0 100644 --- a/settings/users.php +++ b/settings/users.php @@ -46,8 +46,8 @@ $sortGroupsBy = \OC\Group\MetaData::SORT_USERCOUNT; if (\OC_App::isEnabled('user_ldap')) { $isLDAPUsed = - $groupManager->isBackendUsed('\OCA\user_ldap\GROUP_LDAP') - || $groupManager->isBackendUsed('\OCA\user_ldap\Group_Proxy'); + $groupManager->isBackendUsed('\OCA\User_LDAP\Group_LDAP') + || $groupManager->isBackendUsed('\OCA\User_LDAP\Group_Proxy'); if ($isLDAPUsed) { // LDAP user count can be slow, so we sort by group name here $sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME; diff --git a/tests/apps.php b/tests/apps.php index f13a996772f..63895cbd569 100644 --- a/tests/apps.php +++ b/tests/apps.php @@ -10,6 +10,9 @@ function loadDirectory($path) { if (strpos($path, 'integration')) { return; } + if (strpos($path, 'Integration')) { + return; + } if ($dh = opendir($path)) { while ($name = readdir($dh)) { if ($name[0] !== '.') { |