src/Authentication/Handlers/HandlerLDAP.php
public function modifyObject($identifier, $attributes) {
		// bind using the modify credentials if anything other than "self"
		// has been set as the method
		if($this->modify_method != "self") {
			$this->bind(
				$this->modify_dn,
				$this->modify_pw
			);
		}

		// if the identifier contains a comma, it's likely a DN
		if(strpos($identifier, ',') !== FALSE) {
			$dn = $identifier;
		}
		else
		{
			// generate the DN from the identifier
			$dn = $this->search_username . '=' . $identifier . ',' .
				$this->modify_base_dn;
		}

		try
		{
			// ensure the node exists before we perform an update since addition
			// of nodes would be handled by addObject() instead
			$node = $this->ldap->getNode($dn);

			// iterate over the attributes and apply the changes. If an
			// attribute already exists, set its value; otherwise, add the
			// new value
			foreach($attributes as $key => $value) {
				if($node->has($key)) {
					// if the value is either null or an empty array, just
					// remove the attribute; otherwise, set it to a value
					$node->get($key)->set($value);
				}
				else
				{
					$node->get($key, true)->add($value);
				}
			}

			// save the node into the store
			$this->ldap->save($node);
			return true;
		}
		catch(NodeNotFoundException $e) {
			// node does not exist
			return false;
		}
	}
public function modifyObject($identifier, $attributes) {
		// bind using the modify credentials if anything other than "self"
		// has been set as the method
		if($this->modify_method != "self") {
			$this->bind(
				$this->modify_dn,
				$this->modify_pw
			);
		}

		// if the identifier contains a comma, it's likely a DN
		if(strpos($identifier, ',') !== FALSE) {
			$dn = $identifier;
		}
		else
		{
			// generate the DN from the identifier
			$dn = $this->search_username . '=' . $identifier . ',' .
				$this->modify_base_dn;
		}

		try
		{
			// ensure the node exists before we perform an update since addition
			// of nodes would be handled by addObject() instead
			$node = $this->ldap->getNode($dn);

			// iterate over the attributes and apply the changes. If an
			// attribute already exists, set its value; otherwise, add the
			// new value
			foreach($attributes as $key => $value) {
				if($node->has($key)) {
					// if the value is either null or an empty array, just
					// remove the attribute; otherwise, set it to a value
					$node->get($key)->set($value);
				}
				else
				{
					$node->get($key, true)->add($value);
				}
			}

			// save the node into the store
			$this->ldap->save($node);
			return true;
		}
		catch(NodeNotFoundException $e) {
			// node does not exist
			return false;
		}
	}
public function modifyObject ( $ identifier , $ attributes ) { // bind using the modify credentials if anything other than "self" // has been set as the method if ( $ this -> modify_method != "self" ) { $ this -> bind ( $ this -> modify_dn , $ this -> modify_pw ) ; } // if the identifier contains a comma, it's likely a DN if ( strpos ( $ identifier , ',' ) !== FALSE ) { $ dn = $ identifier ; } else { // generate the DN from the identifier $ dn = $ this -> search_username . '=' . $ identifier . ',' . $ this -> modify_base_dn ; } try { // ensure the node exists before we perform an update since addition // of nodes would be handled by addObject() instead $ node = $ this -> ldap -> getNode ( $ dn ) ; // iterate over the attributes and apply the changes. If an // attribute already exists, set its value; otherwise, add the // new value foreach ( $ attributes as $ key => $ value ) { if ( $ node -> has ( $ key ) ) { // if the value is either null or an empty array, just // remove the attribute; otherwise, set it to a value $ node -> get ( $ key ) -> set ( $ value ) ; } else { $ node -> get ( $ key , true ) -> add ( $ value ) ; } } // save the node into the store $ this -> ldap -> save ( $ node ) ; return true ; } catch ( NodeNotFoundException $ e ) { // node does not exist return false ; } }
Modifies an object in the modify subtree using the specified identifier
and an associative array of attributes. Returns a boolean describing
whether the operation was successful. Throws an exception if the bind
fails.

@param string $identifier The value to use as the "username" identifier
@param array $attributes Associative array of attributes to modify

@return bool
@throws BindException
Modifies an object in the modify subtree using the specified identifier and an associative array of attributes . Returns a boolean describing whether the operation was successful . Throws an exception if the bind fails .