From b52e046b42b84e5663d1da2d9eead491535ecc26 Mon Sep 17 00:00:00 2001
From: David Surville <david.surville@unicaen.fr>
Date: Wed, 22 Nov 2023 13:14:18 +0100
Subject: [PATCH] Ajout de l'option "useStartTls"

---
 src/UnicaenLdap/Options/ModuleOptions.php | 28 +++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/UnicaenLdap/Options/ModuleOptions.php b/src/UnicaenLdap/Options/ModuleOptions.php
index de4eb67..ec88fbf 100644
--- a/src/UnicaenLdap/Options/ModuleOptions.php
+++ b/src/UnicaenLdap/Options/ModuleOptions.php
@@ -67,6 +67,11 @@ class ModuleOptions extends AbstractOptions
      */
     protected $accountFilterFormat;
 
+    /**
+     * @var bool
+     */
+    protected $useStartTls;
+
 
     public function getIterator() {
         return new \ArrayIterator($this);
@@ -244,7 +249,25 @@ class ModuleOptions extends AbstractOptions
      */
     public function setAccountFilterFormat($accountFilterFormat)
     {
-        $this->accountFilterFormat = (boolean)$accountFilterFormat;
+        $this->accountFilterFormat = (string)$accountFilterFormat;
+        return $this;
+    }
+
+    /**
+     * @return bool
+     */
+    public function getUseStartTls(): bool
+    {
+        return $this->useStartTls;
+    }
+
+    /**
+     * @param bool $useStartTls
+     * @return $this
+     */
+    public function setUseStartTls(bool $useStartTls): ModuleOptions
+    {
+        $this->useStartTls = $useStartTls;
         return $this;
     }
 
@@ -257,11 +280,12 @@ class ModuleOptions extends AbstractOptions
     {
         return array(
             'host'              => $this->getHost(),
-	    'port'		=> $this->getPort(),
+	        'port'		        => $this->getPort(),
             'username'          => $this->getUsername(),
             'password'          => $this->getPassword(),
             'bindRequiresDn'    => $this->getBindRequiresDn(),
             'baseDn'            => $this->getBaseDn(),
+            'useStartTls'       => $this->getUseStartTls(),
         );
     }
 }
\ No newline at end of file
-- 
GitLab