From 32fb6beac3fe9b202ed4a52f3a2bfede72cbc19b Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Jul 2016 15:10:35 +0800 Subject: [PATCH] final changes --- apps/user_ldap/appinfo/update.php | 1 - apps/user_ldap/lib/IUserLDAP.php | 3 +-- apps/user_ldap/lib/LDAPProvider.php | 23 +++++++++++----------- apps/user_ldap/lib/LDAPProviderFactory.php | 1 - apps/user_ldap/tests/Jobs/CleanUpTest.php | 2 +- lib/public/LDAP/IDeletionFlagSupport.php | 5 ++--- lib/public/LDAP/ILDAPProvider.php | 17 ++++++++-------- lib/public/LDAP/ILDAPProviderFactory.php | 1 - 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/apps/user_ldap/appinfo/update.php b/apps/user_ldap/appinfo/update.php index f816a7ec9c6..b1bbbaec142 100644 --- a/apps/user_ldap/appinfo/update.php +++ b/apps/user_ldap/appinfo/update.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/apps/user_ldap/lib/IUserLDAP.php b/apps/user_ldap/lib/IUserLDAP.php index c04e2ddffe7..2151795b647 100644 --- a/apps/user_ldap/lib/IUserLDAP.php +++ b/apps/user_ldap/lib/IUserLDAP.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify @@ -42,7 +41,7 @@ interface IUserLDAP { /** * Return the username for the given LDAP DN, if available. * @param string $dn - * @return string|false with the name to use in ownCloud + * @return string|false with the username */ public function dn2UserName($dn); } diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 8d6b5600596..c4bb29452c2 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify @@ -58,8 +57,8 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } /** - * Translate an ownCloud user id to LDAP DN - * @param string $uid ownCloud user id + * Translate an user id to LDAP DN + * @param string $uid user id * @return string with the LDAP DN * @throws \Exception if translation was unsuccessful */ @@ -75,16 +74,16 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } /** - * Translate a LDAP DN to an ownCloud user name. If there is no mapping between + * Translate a LDAP DN to an internal user name. If there is no mapping between * the DN and the user name, a new one will be created. * @param string $dn LDAP DN - * @return string with the ownCloud user name + * @return string with the internal user name * @throws \Exception if translation was unsuccessful */ public function getUserName($dn) { $result = $this->backend->dn2UserName($dn); if(!$result){ - throw new \Exception('Translation to ownCloud user name unsuccessful'); + throw new \Exception('Translation to internal user name unsuccessful'); } return $result; } @@ -110,7 +109,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Return a new LDAP connection resource for the specified user. * The connection must be closed manually. - * @param string $uid ownCloud user id + * @param string $uid user id * @return resource of the LDAP connection * @throws \Exception if user id was not found in LDAP */ @@ -123,7 +122,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Get the LDAP base for users. - * @param string $uid ownCloud user id + * @param string $uid user id * @return string the base for users * @throws \Exception if user id was not found in LDAP */ @@ -136,7 +135,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Get the LDAP base for groups. - * @param string $uid ownCloud user id + * @param string $uid user id * @return string the base for groups * @throws \Exception if user id was not found in LDAP */ @@ -149,7 +148,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Clear the cache if a cache is used, otherwise do nothing. - * @param string $uid ownCloud user id + * @param string $uid user id * @throws \Exception if user id was not found in LDAP */ public function clearCache($uid) { @@ -171,7 +170,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Flag record for deletion. - * @param string $uid ownCloud user id + * @param string $uid user id */ public function flagRecord($uid) { $this->deletedUsersIndex->markUser($uid); @@ -179,7 +178,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Unflag record for deletion. - * @param string $uid ownCloud user id + * @param string $uid user id */ public function unflagRecord($uid) { //do nothing diff --git a/apps/user_ldap/lib/LDAPProviderFactory.php b/apps/user_ldap/lib/LDAPProviderFactory.php index 6525d14d3fd..c956f9d957a 100644 --- a/apps/user_ldap/lib/LDAPProviderFactory.php +++ b/apps/user_ldap/lib/LDAPProviderFactory.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php index 4785a227d26..45e7998da01 100644 --- a/apps/user_ldap/tests/Jobs/CleanUpTest.php +++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php @@ -37,7 +37,7 @@ class CleanUpTest extends \Test\TestCase { ->getMock(); $mocks['ocConfig'] = $this->getMock('\OCP\IConfig'); $mocks['db'] = $this->getMock('\OCP\IDBConnection'); - $mocks['helper'] = new \OCA\User_LDAP\Helper(); + $mocks['helper'] = $this->getMock('\OCA\User_LDAP\Helper'); return $mocks; } diff --git a/lib/public/LDAP/IDeletionFlagSupport.php b/lib/public/LDAP/IDeletionFlagSupport.php index ca272d7aa79..60ec82f662d 100644 --- a/lib/public/LDAP/IDeletionFlagSupport.php +++ b/lib/public/LDAP/IDeletionFlagSupport.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify @@ -30,14 +29,14 @@ namespace OCP\LDAP; interface IDeletionFlagSupport { /** * Flag record for deletion. - * @param string $uid ownCloud user id + * @param string $uid user id * @since 9.2.0 */ public function flagRecord($uid); /** * Unflag record for deletion. - * @param string $uid ownCloud user id + * @param string $uid user id * @since 9.2.0 */ public function unflagRecord($uid); diff --git a/lib/public/LDAP/ILDAPProvider.php b/lib/public/LDAP/ILDAPProvider.php index 44f7d88c946..576032cfaaf 100644 --- a/lib/public/LDAP/ILDAPProvider.php +++ b/lib/public/LDAP/ILDAPProvider.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify @@ -29,17 +28,17 @@ namespace OCP\LDAP; */ interface ILDAPProvider { /** - * Translate an ownCloud username to LDAP DN. - * @param string $uid ownCloud user id + * Translate a user id to LDAP DN. + * @param string $uid user id * @return string * @since 9.2.0 */ public function getUserDN($uid); /** - * Translate a LDAP DN to an ownCloud user name. + * Translate a LDAP DN to an internal user name. * @param string $dn LDAP DN - * @return string with the ownCloud user name + * @return string with the internal user name * @throws \Exception if translation was unsuccessful * @since 9.2.0 */ @@ -63,7 +62,7 @@ interface ILDAPProvider { /** * Return a new LDAP connection resource for the specified user. - * @param string $uid ownCloud user id + * @param string $uid user id * @return resource of the LDAP connection * @since 9.2.0 */ @@ -71,7 +70,7 @@ interface ILDAPProvider { /** * Get the LDAP base for users. - * @param string $uid ownCloud user id + * @param string $uid user id * @return string the base for users * @throws \Exception if user id was not found in LDAP * @since 9.2.0 @@ -80,7 +79,7 @@ interface ILDAPProvider { /** * Get the LDAP base for groups. - * @param string $uid ownCloud user id + * @param string $uid user id * @return string the base for groups * @throws \Exception if user id was not found in LDAP * @since 9.2.0 @@ -97,7 +96,7 @@ interface ILDAPProvider { /** * Clear the cache if a cache is used, otherwise do nothing. - * @param string $uid ownCloud user id + * @param string $uid user id * @since 9.2.0 */ public function clearCache($uid); diff --git a/lib/public/LDAP/ILDAPProviderFactory.php b/lib/public/LDAP/ILDAPProviderFactory.php index 3e1242e33db..6204f73b072 100644 --- a/lib/public/LDAP/ILDAPProviderFactory.php +++ b/lib/public/LDAP/ILDAPProviderFactory.php @@ -2,7 +2,6 @@ /** * @author Roger Szabo * - * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify -- 2.39.5