apps/user_ldap/lib/User/User.php
/**
	 * processes results from LDAP for attributes as returned by getAttributesToRead()
	 * @param array $ldapEntry the user entry as retrieved from LDAP
	 */
processes results from LDAP for attributes as returned by getAttributesToRead()
@param array $ldapEntry the user entry as retrieved from LDAP
processes results from LDAP for attributes as returned by getAttributesToRead () @param array $ldapEntry the user entry as retrieved from LDAP
public function processAttributes($ldapEntry) {
		$this->markRefreshTime();
		$attr = strtolower($this->connection->ldapQuotaAttribute);
		if(isset($ldapEntry[$attr])) {
			$this->updateQuota($ldapEntry[$attr][0]);
		} else {
			if ($this->connection->ldapQuotaDefault !== '') {
				$this->updateQuota();
			}
		}
		unset($attr);
		$attr = strtolower($this->connection->ldapEmailAttribute);
		if(isset($ldapEntry[$attr])) {
			$this->updateEmail($ldapEntry[$attr][0]);
		}
		unset($attr);
		$displayName = $displayName2 = '';
		$attr = strtolower($this->connection->ldapUserDisplayName);
		if(isset($ldapEntry[$attr])) {
			$displayName = strval($ldapEntry[$attr][0]);
		}
		$attr = strtolower($this->connection->ldapUserDisplayName2);
		if(isset($ldapEntry[$attr])) {
			$displayName2 = strval($ldapEntry[$attr][0]);
		}
		if ($displayName !== '') {
			$this->composeAndStoreDisplayName($displayName);
			$this->access->cacheUserDisplayName(
				$this->getUsername(),
				$displayName,
				$displayName2
			);
		}
		unset($attr);
		if(isset($ldapEntry['uid'])) {
			$this->storeLDAPUserName($ldapEntry['uid'][0]);
		} else if(isset($ldapEntry['samaccountname'])) {
			$this->storeLDAPUserName($ldapEntry['samaccountname'][0]);
		}
		if(strpos($this->connection->homeFolderNamingRule, 'attr:') === 0) {
			$attr = strtolower(substr($this->connection->homeFolderNamingRule, strlen('attr:')));
			if(isset($ldapEntry[$attr])) {
				$this->access->cacheUserHome(
					$this->getUsername(), $this->getHomePath($ldapEntry[$attr][0]));
			}
		}
		$cacheKey = 'getMemberOf'.$this->getUsername();
		$groups = false;
		if(isset($ldapEntry['memberof'])) {
			$groups = $ldapEntry['memberof'];
		}
		$this->connection->writeToCache($cacheKey, $groups);
		$attrs = array('jpegphoto', 'thumbnailphoto');
		foreach ($attrs as $attr)  {
			if(isset($ldapEntry[$attr])) {
				$this->avatarImage = $ldapEntry[$attr][0];
				\OCP\Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin');
				break;
			}
		}
	}
public function processAttributes ( $ ldapEntry ) { $ this -> markRefreshTime ( ) ; $ attr = strtolower ( $ this -> connection -> ldapQuotaAttribute ) ; if ( isset ( $ ldapEntry [ $ attr ] ) ) { $ this -> updateQuota ( $ ldapEntry [ $ attr ] [ 0 ] ) ; } else { if ( $ this -> connection -> ldapQuotaDefault !== '' ) { $ this -> updateQuota ( ) ; } } unset ( $ attr ) ; $ attr = strtolower ( $ this -> connection -> ldapEmailAttribute ) ; if ( isset ( $ ldapEntry [ $ attr ] ) ) { $ this -> updateEmail ( $ ldapEntry [ $ attr ] [ 0 ] ) ; } unset ( $ attr ) ; $ displayName = $ displayName2 = '' ; $ attr = strtolower ( $ this -> connection -> ldapUserDisplayName ) ; if ( isset ( $ ldapEntry [ $ attr ] ) ) { $ displayName = strval ( $ ldapEntry [ $ attr ] [ 0 ] ) ; } $ attr = strtolower ( $ this -> connection -> ldapUserDisplayName2 ) ; if ( isset ( $ ldapEntry [ $ attr ] ) ) { $ displayName2 = strval ( $ ldapEntry [ $ attr ] [ 0 ] ) ; } if ( $ displayName !== '' ) { $ this -> composeAndStoreDisplayName ( $ displayName ) ; $ this -> access -> cacheUserDisplayName ( $ this -> getUsername ( ) , $ displayName , $ displayName2 ) ; } unset ( $ attr ) ; if ( isset ( $ ldapEntry [ 'uid' ] ) ) { $ this -> storeLDAPUserName ( $ ldapEntry [ 'uid' ] [ 0 ] ) ; } else if ( isset ( $ ldapEntry [ 'samaccountname' ] ) ) { $ this -> storeLDAPUserName ( $ ldapEntry [ 'samaccountname' ] [ 0 ] ) ; } if ( strpos ( $ this -> connection -> homeFolderNamingRule , 'attr:' ) === 0 ) { $ attr = strtolower ( substr ( $ this -> connection -> homeFolderNamingRule , strlen ( 'attr:' ) ) ) ; if ( isset ( $ ldapEntry [ $ attr ] ) ) { $ this -> access -> cacheUserHome ( $ this -> getUsername ( ) , $ this -> getHomePath ( $ ldapEntry [ $ attr ] [ 0 ] ) ) ; } } $ cacheKey = 'getMemberOf' . $ this -> getUsername ( ) ; $ groups = false ; if ( isset ( $ ldapEntry [ 'memberof' ] ) ) { $ groups = $ ldapEntry [ 'memberof' ] ; } $ this -> connection -> writeToCache ( $ cacheKey , $ groups ) ; $ attrs = array ( 'jpegphoto' , 'thumbnailphoto' ) ; foreach ( $ attrs as $ attr ) { if ( isset ( $ ldapEntry [ $ attr ] ) ) { $ this -> avatarImage = $ ldapEntry [ $ attr ] [ 0 ] ; \ OCP \ Util :: connectHook ( 'OC_User' , 'post_login' , $ this , 'updateAvatarPostLogin' ) ; break ; } } }
processes results from LDAP for attributes as returned by getAttributesToRead()
 @param array $ldapEntry the user entry as retrieved from LDAP
processes results from LDAP for attributes as returned by getAttributesToRead () @param array $ldapEntry the user entry as retrieved from LDAP
//Quota //Email //displayName // LDAP Username, needed for s2s sharing //homePath //memberOf groups //Avatar // the call to the method that saves the avatar in the file // system must be postponed after the login. It is to ensure // external mounts are mounted properly (e.g. with login // credentials from the session).