[Pkg-owncloud-commits] [owncloud] 22/36: Backport of #16890 to stable7

David Prévot taffit at moszumanska.debian.org
Tue Jun 23 23:12:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 0766a679b40615ce831b903f898647379e6a3c79
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Thu Jun 11 18:24:45 2015 +0200

    Backport of #16890 to stable7
    
    the user is gone, userExists will not bring him back. But the user's folder needs to be deleted anyway
    
    delete user test to take getHome into account to ensure it is also deleted subsequently
    
    Conflicts:
    	apps/user_ldap/tests/user_ldap.php
---
 apps/user_ldap/tests/user_ldap.php |  4 ++++
 apps/user_ldap/user_ldap.php       | 11 ++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php
index 0309bc6..26d48ed 100644
--- a/apps/user_ldap/tests/user_ldap.php
+++ b/apps/user_ldap/tests/user_ldap.php
@@ -241,9 +241,13 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
 
 		$pref = \OC::$server->getConfig();
 		$pref->setUserValue('jeremy', 'user_ldap', 'isDeleted', 1);
+		$pref->setUserValue('jeremy', 'user_ldap', 'homePath', '/var/vhome/jdings/');
 
 		$result = $backend->deleteUser('jeremy');
 		$this->assertTrue($result);
+
+		$home = $backend->getHome('jeremy');
+		$this->assertSame($home, '/var/vhome/jdings/');
 	}
 
 	/**
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 3188a46..e2b295f 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -184,6 +184,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
 		}
 		//getting dn, if false the user does not exist. If dn, he may be mapped only, requires more checking.
 		$user = $this->access->userManager->get($uid);
+
 		if(is_null($user)) {
 			\OCP\Util::writeLog('user_ldap', 'No DN found for '.$uid.' on '.
 				$this->access->connection->ldapHost, \OCP\Util::DEBUG);
@@ -236,16 +237,16 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
 	* @return string|bool
 	*/
 	public function getHome($uid) {
-		// user Exists check required as it is not done in user proxy!
-		if(!$this->userExists($uid)) {
-			return false;
-		}
-
 		if(isset($this->homesToKill[$uid]) && !empty($this->homesToKill[$uid])) {
 			//a deleted user who needs some clean up
 			return $this->homesToKill[$uid];
 		}
 
+		// user Exists check required as it is not done in user proxy!
+		if(!$this->userExists($uid)) {
+			return false;
+		}
+
 		$cacheKey = 'getHome'.$uid;
 		if($this->access->connection->isCached($cacheKey)) {
 			return $this->access->connection->getFromCache($cacheKey);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list