Ver código fonte

Fix ldap_parse_result call

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
tags/v26.0.0beta1
Côme Chilliet 1 ano atrás
pai
commit
81064b3d22
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 13 adições e 4 exclusões
  1. 13
    4
      apps/user_ldap/lib/LDAP.php

+ 13
- 4
apps/user_ldap/lib/LDAP.php Ver arquivo

@@ -86,12 +86,21 @@ class LDAP implements ILDAPWrapper {
$controls = [];
$matchedDn = null;
$referrals = [];
$success = $this->invokeLDAPMethod('parse_result', $link, $result,

/** Cannot use invokeLDAPMethod because arguments are passed by reference */
$this->preFunctionCall('ldap_parse_result', [$link, $result]);
$success = ldap_parse_result($link, $result,
$errorCode,
$matchedDn,
$errorMessage,
$referrals,
$controls);
if ($this->isResultFalse($result)) {
$this->postFunctionCall();
}
if ($this->dataCollector !== null) {
$this->dataCollector->stopLastLdapRequest();
}

$cookie = $controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? '';

@@ -281,11 +290,11 @@ class LDAP implements ILDAPWrapper {
}

/**
* @param array $arguments
* @return mixed
*/
protected function invokeLDAPMethod() {
$arguments = func_get_args();
$func = 'ldap_' . array_shift($arguments);
protected function invokeLDAPMethod(string $func, ...$arguments) {
$func = 'ldap_' . $func;
if (function_exists($func)) {
$this->preFunctionCall($func, $arguments);
$result = call_user_func_array($func, $arguments);

Carregando…
Cancelar
Salvar