Actualiza una entrada LDAP existente
@return string
558740
public function actualizarObjetoLdap(){
        if ($this->existe) {
            $dn = $this->entrada['dn'];
            $cambios = array();
            foreach ($this->cambios as $atributos) {
                $cambios[$atributos] = $this->entrada[$atributos];
            }
            return $this->modificarEntradaLdap($dn, $cambios);
        }else{
            $this->configurarErrorLdap('Actualizacion', 'Esa entrada no existe');
            return false;
        }
    }
595926
function query() {
    ldap_servers_module_load_include('php', 'ldap_servers', 'LdapServer.class');
    $ldap_server = new LdapServer($this->sid);
    $ldap_server->connect();
    $ldap_server->bind();
    $results = array();

    $count = 0;

    foreach ($this->baseDn as $base_dn) {
      $result = $ldap_server->search($base_dn, $this->filter, $this->attributes, 0, $this->sizelimit, $this->timelimit, $this->deref, $this->scope);
      if ($result !== FALSE && $result['count'] > 0) {
        $count = $count + $result['count'];
        $results = array_merge($results, $result);
      }
    }
    $results['count'] = $count;

    return $results;
  }
260521
public function get()
    {
        $components = [];

        // We'll go through each component type and assemble its RDN.
        foreach ($this->components as $component => $values) {
            array_map(function ($value) use ($component, &$components) {
                // Assemble the component and escape the value.
                $components[] = sprintf('%s=%s', $component, ldap_escape($value, '', 2));
            }, $values);
        }

        return implode(',', $components);
    }
1022654
public function getBinary()
    {
        $sid = explode('-', ltrim($this->value, 'S-'));

        $level = (int) array_shift($sid);

        $authority = (int) array_shift($sid);

        $subAuthorities = array_map('intval', $sid);

        $params = array_merge(
            ['C2xxNV*', $level, count($subAuthorities), $authority],
            $subAuthorities
        );

        return call_user_func_array('pack', $params);
    }
1048233
public function getAgenciaCodigoBeneficiario()
    {
        $agencia = $this->getAgenciaDv() !== null ? $this->getAgencia() . '-' . $this->getAgenciaDv() : $this->getAgencia();
        $conta = $this->getContaDv() !== null ? $this->getConta() . '-' . $this->getContaDv() : $this->getConta();

        return $agencia . ' / ' . $conta;
    }
1013391
private function updateInfo()
    {
        $info = '';
        if (!LOCAL) { // if on union server
            $ds = ldap_connect("addressbook.ic.ac.uk");
            $r = ldap_bind($ds);
            $justthese = array("o");
            $sr = ldap_search(
                $ds,
                "ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk",
                "uid=".$this->getUser(),
                $justthese
            );
            $info = ldap_get_entries($ds, $sr);
            if ($info["count"] > 0) {
                $info = json_encode(explode('|', $info[0]['o'][0]));
                $this->setInfo($info);
            } else {
                return false;
            }
        }
        return $info;
    }
413292
public function getDn()
    {
        if ($this->dn === null) {
            return $this->dn;
        } elseif (empty($this->dn)) {
            return $this->adldap->getBaseDn();
        }

        return $this->dn;
    }
311499
public function getFlagTreeSubordinateEnable() {
		$flagTreeEnable = (bool)$this->getConfig('LdapSync.TreeSubordinate.Enable');
		if (!$flagTreeEnable) {
			return false;
		}

		$ldapFieldsInfo = $this->getLdapFieldsInfo();
		if (!isset($ldapFieldsInfo[CAKE_LDAP_LDAP_ATTRIBUTE_MANAGER])) {
			return false;
		}

		return true;
	}
871181
public function get(){
        $res= FALSE;
        try{
            //Armo y preparo la consulta
            $query= $this->prepareSelect($this->select, $this->from, $this->where, $this->group, $this->having, $this->order, $this->limit);
            //Ejecuto la consulta
            $query->execute($this->where_values);
            //Controlo que este todo bien
            if($this->isOk($query)){
                $res= $query;
            }
            //Limpio las variables del AR
            $this->cleanVars();
        } catch (\PDOException $e) {
            $this->cleanVars();
            throw $e;
        }
        return $res;
    }
358762
public function getAuthority(): string
    {
        if ($this->host == '') {
            return '';
        }

        $authority = $this->host;
        if ($this->user != '') {
            $authority = $this->user.'@'.$authority;
        }

        if ($this->port !== null && !$this->isDefaultPort($this->scheme, $this->port)) {
            $authority .= ':'.$this->port;
        }

        return $authority;
    }
1097583
private function mapa(array $atributos, $entrada){
        $objeto = array('dn'=>ldap_get_dn($this->conexionLdap, $entrada));
        foreach ($atributos as $attr) {
            if (($valor = @ldap_get_values($this->conexionLdap, $entrada, $attr))){
                // Elimino el índice count
                array_pop($valor);
                // $valor es un array.
                // En caso de ser valor único, tomamos el indíce cero, caso contrario 
                // metemos todo el array
                $objeto[$attr] = count($valor)==1 ? $valor[0]:  $valor;
            } // TODO: ¿Un else para configurar un valor por defecto
        }
        return $objeto;
    }
821558
protected function _getLdapGroups(): array
    {
        $result = [];

        $config = (array)Configure::read('Groups.remoteGroups.LDAP');
        if (!empty(array_diff($this->ldapRequiredParams, array_keys($config)))) {
            return $result;
        }

        $connection = $this->_ldapConnect($config);
        if (!is_resource($connection)) {
            return $result;
        }

        $search = ldap_search($connection, $config['baseDn'], $config['groupsFilter'], ['cn']);
        if (!is_resource($search)) {
            Log::critical('Failed to search LDAP');

            return $result;
        }

        $result = ldap_get_entries($connection, $search);

        if (empty($result)) {
            return $result;
        }

        return $this->_normalizeResult($result);
    }
1215184
public function getDotEnvData()
	{
		$fileData = array_filter( explode( "\n", file_get_contents( base_path( '.env' ) ) ) );
		$data = [];
		foreach( $fileData as $keyValuePair ) {
			$split = explode( '=', $keyValuePair, 2 );
			$data[trim($split[0])] = trim($split[1]);
		}
		return $data;
	}
308980
public function getLdapClientOptions()
    {
        $options = $this->getOptions();
        $zendOptions = array_diff_key($options, array_flip($this->permittedEspoOptions));

        return $zendOptions;
    }
1006105
public function getIsAdmin()
	{
		if(!\Yii::$app->user->isGuest)
		{
			if(\Yii::$app->user->identity->role < 2)
			{
				return true;
			}
		}
		return false;
	}
932099
protected function getClientDirectoryName() {
    return strtolower($this->getEnvironment()->getClient()) . '-' . strtolower($this->getEnvironment()->getName()) . '-' . $this->getConfiguration()->getBranch();
  }
233172
protected function borrarObjetoLdap(){
        if ($this->existe) {
            $dn = $this->dnObjeto;
            return $this->borrarEntradaLdap($dn);
        }else{
            $this->configurarErrorLdap('Actualizacion', 'Esa entrada no existe');
            return false;
        }
        
    }