diff --git a/apps/user_ldap/appinfo/update.php b/apps/user_ldap/appinfo/update.php
index f9681e38e6813c38dfa7f2178bc69dd9b03d3890..bc32d4ef4ccc32b3fd70fbb9ab58b7cfe5b162c9 100644
--- a/apps/user_ldap/appinfo/update.php
+++ b/apps/user_ldap/appinfo/update.php
@@ -87,4 +87,8 @@ if(!isset($connector)) {
 }
 //it is required, that connections do have ldap_configuration_active setting stored in the database
 $connector->getConfiguration();
-$connector->saveConfiguration();
\ No newline at end of file
+$connector->saveConfiguration();
+
+// we don't save it anymore, was a well-meant bad idea. Clean up database.
+$query = OC_DB::prepare('DELETE FROM `*PREFIX*preferences` WHERE `appid` = ? AND `configkey` = ?');
+$query->execute(array('user_ldap' , 'homedir'));
diff --git a/apps/user_ldap/appinfo/version b/apps/user_ldap/appinfo/version
index 705e30728e00e9b7a903ac90292ef4270ba7603d..e4d93c8d610789d4b4c12e5f8be7d4c8fc6a489b 100644
--- a/apps/user_ldap/appinfo/version
+++ b/apps/user_ldap/appinfo/version
@@ -1 +1 @@
-0.3.9.0
\ No newline at end of file
+0.3.9.4
\ No newline at end of file
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index f92779b1cada27d8e7012c80e212da1ce9f73aa7..933f2f420749b018fd8c2a6d5bd7df76a6101154 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -294,6 +294,11 @@ class Connection {
 		$params = $this->getConfigTranslationArray();
 
 		foreach($config as $parameter => $value) {
+			if(($parameter == 'homeFolderNamingRule'
+				|| $params[$parameter] == 'homeFolderNamingRule')
+				&& !empty($value)) {
+				$value = 'attr:'.$value;
+			}
 		    if(isset($this->config[$parameter])) {
 				$this->config[$parameter] = $value;
 				if(is_array($setParameters)) {
@@ -324,7 +329,7 @@ class Connection {
 					$value = base64_encode($value);
 					break;
 				case 'homeFolderNamingRule':
-					$value = empty($value) ? 'opt:username' : 'attr:'.$value;
+					$value = empty($value) ? 'opt:username' : $value;
 					break;
 				case 'ldapBase':
 				case 'ldapBaseUsers':
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 6aa8cd9b83cc54b85e630415552e96127ae24152..0962756228c8d193be92f08e7677bfdcf80bdde0 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -171,40 +171,37 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
 	}
 
 	/**
-	* @brief determine the user's home directory
-	* @param string $uid the owncloud username
+	* @brief get the user's home directory
+	* @param string $uid the username
 	* @return boolean
 	*/
-	private function determineHomeDir($uid) {
+	public function getHome($uid) {
+		$cacheKey = 'getHome'.$uid;
+		if($this->connection->isCached($cacheKey)) {
+			return $this->connection->getFromCache($cacheKey);
+		}
 		if(strpos($this->connection->homeFolderNamingRule, 'attr:') === 0) {
 			$attr = substr($this->connection->homeFolderNamingRule, strlen('attr:'));
 			$homedir = $this->readAttribute($this->username2dn($uid), $attr);
-			if($homedir) {
-				$homedir = \OCP\Config::getSystemValue( "datadirectory", \OC::$SERVERROOT."/data" ) . '/' . $homedir[0];
-				\OCP\Config::setUserValue($uid, 'user_ldap', 'homedir', $homedir);
+			if($homedir && isset($homedir[0])) {
+				$path = $homedir[0];
+				//if attribute's value is an absolute path take this, otherwise append it to data dir
+				//check for / at the beginning or pattern c:\ resp. c:/
+				if(
+					'/' == $path[0]
+					|| (3 < strlen($path) && ctype_alpha($path[0]) && $path[1] == ':' && ('\\' == $path[2] || '/' == $path[2]))
+				) {
+					$homedir = $path;
+				} else {
+					$homedir = \OCP\Config::getSystemValue('datadirectory', \OC::$SERVERROOT.'/data' ) . '/' . $homedir[0];
+				}
+				$this->connection->writeToCache($cacheKey, $homedir);
 				return $homedir;
 			}
 		}
 
-		//fallback and default: username
-		$homedir = \OCP\Config::getSystemValue( "datadirectory", \OC::$SERVERROOT."/data" ) . '/' . $uid;
-		\OCP\Config::setUserValue($uid, 'user_ldap', 'homedir', $homedir);
-		return $homedir;
-	}
-
-	/**
-	* @brief get the user's home directory
-	* @param string $uid the username
-	* @return boolean
-	*/
-	public function getHome($uid) {
-		if($this->userExists($uid)) {
-			$homedir = \OCP\Config::getUserValue($uid, 'user_ldap', 'homedir', false);
-			if(!$homedir) {
-				$homedir = $this->determineHomeDir($uid);
-			}
-			return $homedir;
-		}
+		//false will apply default behaviour as defined and done by OC_User
+		$this->connection->writeToCache($cacheKey, false);
 		return false;
 	}
 
diff --git a/lib/user.php b/lib/user.php
index 37b461188896fa85d4af25d38d391ef8d87b031d..f58b6673f7f489423e21a2a41b4c59f8f696a417 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -487,7 +487,7 @@ class OC_User {
 	 */
 	public static function getHome($uid) {
 		foreach(self::$_usedBackends as $backend) {
-			if($backend->implementsActions(OC_USER_BACKEND_GET_HOME)) {
+			if($backend->implementsActions(OC_USER_BACKEND_GET_HOME) && $backend->userExists($uid)) {
 				$result=$backend->getHome($uid);
 				if($result) {
 					return $result;