From affb7a1c53ac758f31c4921dd8c16aff62d18064 Mon Sep 17 00:00:00 2001 From: Daniel Lindner Date: Thu, 13 Jul 2017 11:18:44 +0200 Subject: [PATCH] Make anonymous bind to LDAP possible --- inc/SP/Auth/Ldap/LdapBase.class.php | 6 +++--- inc/SP/Controller/ChecksController.class.php | 4 ++-- inc/SP/Controller/ConfigActionController.class.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/SP/Auth/Ldap/LdapBase.class.php b/inc/SP/Auth/Ldap/LdapBase.class.php index fed253e4..34e74330 100644 --- a/inc/SP/Auth/Ldap/LdapBase.class.php +++ b/inc/SP/Auth/Ldap/LdapBase.class.php @@ -120,7 +120,7 @@ abstract class LdapBase implements LdapInterface, AuthInterface { $this->LogMessage->setAction(__FUNCTION__); - if (!$this->searchBase || !$this->server || !$this->bindDn || !$this->bindPass) { + if (!$this->searchBase || !$this->server) { $this->LogMessage->addDescription(__('Los parámetros de LDAP no están configurados', false)); $this->writeLog(); @@ -449,7 +449,7 @@ abstract class LdapBase implements LdapInterface, AuthInterface $this->bindPass = Config::getConfig()->getLdapBindPass(); $this->group = Config::getConfig()->getLdapGroup(); - if (!$this->searchBase || !$this->server || !$this->bindDn || !$this->bindPass) { + if (!$this->searchBase || !$this->server) { $this->LogMessage->setAction(__FUNCTION__); $this->LogMessage->addDescription(__('Los parámetros de LDAP no están configurados', false)); $this->writeLog(); @@ -705,4 +705,4 @@ abstract class LdapBase implements LdapInterface, AuthInterface ]; return preg_replace($chars, '\\\$1', $dn); } -} \ No newline at end of file +} diff --git a/inc/SP/Controller/ChecksController.class.php b/inc/SP/Controller/ChecksController.class.php index e45873fa..9e917bd0 100644 --- a/inc/SP/Controller/ChecksController.class.php +++ b/inc/SP/Controller/ChecksController.class.php @@ -88,7 +88,7 @@ class ChecksController implements ItemControllerInterface $ldapBindUser = Request::analyze('ldap_binduser'); $ldapBindPass = Request::analyzeEncrypted('ldap_bindpass'); - if (!$ldapServer || !$ldapBase || !$ldapBindUser || !$ldapBindPass) { + if (!$ldapServer || !$ldapBase) { $this->JsonResponse->setDescription(__('Los parámetros de LDAP no están configurados', false)); return; } @@ -142,4 +142,4 @@ class ChecksController implements ItemControllerInterface $this->JsonResponse->addMessage(__('Revise el registro de eventos para más detalles', false)); } } -} \ No newline at end of file +} diff --git a/inc/SP/Controller/ConfigActionController.class.php b/inc/SP/Controller/ConfigActionController.class.php index 742bd100..67a10cbf 100644 --- a/inc/SP/Controller/ConfigActionController.class.php +++ b/inc/SP/Controller/ConfigActionController.class.php @@ -396,7 +396,7 @@ class ConfigActionController implements ItemControllerInterface $ldapBindPass = Request::analyzeEncrypted('ldap_bindpass'); // Valores para la configuración de LDAP - if ($ldapEnabled && (!$ldapServer || !$ldapBase || !$ldapBindUser)) { + if ($ldapEnabled && (!$ldapServer || !$ldapBase)) { $this->JsonResponse->setDescription(__('Faltan parámetros de LDAP')); return; } @@ -743,4 +743,4 @@ class ConfigActionController implements ItemControllerInterface $this->JsonResponse->setDescription(__('Proceso de backup finalizado', false)); $this->JsonResponse->setStatus(0); } -} \ No newline at end of file +}