dolibarr-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-cvs] dolibarr/htdocs adminldap.php lib/ldap.lib.php


From: Regis Houssin
Subject: [Dolibarr-cvs] dolibarr/htdocs adminldap.php lib/ldap.lib.php
Date: Mon, 12 Jun 2006 14:05:23 +0000

CVSROOT:        /cvsroot/dolibarr
Module name:    dolibarr
Changes by:     Regis Houssin <hregis>  06/06/12 14:05:23

Modified files:
        htdocs/admin   : ldap.php 
        htdocs/lib     : ldap.lib.php 

Log message:
        début amélioration LDAP

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/admin/ldap.php?cvsroot=dolibarr&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/lib/ldap.lib.php?cvsroot=dolibarr&r1=1.30&r2=1.31

Patches:
Index: admin/ldap.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/admin/ldap.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- admin/ldap.php      12 Jun 2006 13:14:02 -0000      1.45
+++ admin/ldap.php      12 Jun 2006 14:05:23 -0000      1.46
@@ -19,7 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: ldap.php,v 1.45 2006/06/12 13:14:02 hregis Exp $
+ * $Id: ldap.php,v 1.46 2006/06/12 14:05:23 hregis Exp $
  * $Source: /cvsroot/dolibarr/dolibarr/htdocs/admin/ldap.php,v $
  */
  
@@ -27,7 +27,7 @@
        \file       htdocs/admin/ldap.php
                \ingroup    ldap
                \brief      Page d'administration/configuration du module Ldap
-               \version    $Revision: 1.45 $
+               \version    $Revision: 1.46 $
         \remarks    Exemple configuration :
                     LDAP_SERVER_HOST    Serveur LDAP                 
192.168.1.50
                     LDAP_SERVER_PORT    Port LDAP             389
@@ -261,8 +261,9 @@
        
        if ($conf->global->LDAP_SERVER_HOST && $conf->global->LDAP_ADMIN_DN && 
$conf->global->LDAP_ADMIN_PASS && $_GET["action"] == 'test')
        {
+               $ldap = new Ldap();
                // Test ldap_connect
-               $ds = dolibarr_ldap_connect();
+               $ds = $ldap->dolibarr_ldap_connect();
                if ($ds)
                {
                        print img_picto('','info');
@@ -280,7 +281,7 @@
                if ($ds)
                {
                        // Test ldap_getversion
-                       if ((dolibarr_ldap_getversion($ds) == 3))
+                       if (($ldap->dolibarr_ldap_getversion($ds) == 3))
                        {
                                print img_picto('','info');
                                print 
$langs->trans("LDAPSetupForVersion3").'<br>';
@@ -292,7 +293,7 @@
                        }
        
                  // Test ldap_bind
-                       $bind = @dolibarr_ldap_bind($ds);
+                       $bind = $ldap->dolibarr_ldap_bind($ds);
                        
                        if ($bind)
                        {
@@ -308,9 +309,9 @@
                        }
 
                  // Test ldap_unbind
-                 $unbind = @dolibarr_ldap_unbind($ds);
+                 $unbind = $ldap->dolibarr_ldap_unbind($ds);
                  
-                 if ($bind)
+                 if ($unbind)
                  {
                        print img_picto('','info');
                        print "Déconnection du dn $dn réussi<br>";
@@ -327,6 +328,6 @@
 
 $db->close();
 
-llxFooter('$Date: 2006/06/12 13:14:02 $ - $Revision: 1.45 $');
+llxFooter('$Date: 2006/06/12 14:05:23 $ - $Revision: 1.46 $');
 
 ?>

Index: lib/ldap.lib.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/lib/ldap.lib.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- lib/ldap.lib.php    12 Jun 2006 13:14:02 -0000      1.30
+++ lib/ldap.lib.php    12 Jun 2006 14:05:23 -0000      1.31
@@ -19,7 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  * or see http://www.gnu.org/
  *
- * $Id: ldap.lib.php,v 1.30 2006/06/12 13:14:02 hregis Exp $
+ * $Id: ldap.lib.php,v 1.31 2006/06/12 14:05:23 hregis Exp $
  * $Source: /cvsroot/dolibarr/dolibarr/htdocs/lib/ldap.lib.php,v $
  */
 
@@ -28,11 +28,24 @@
                \brief          Librairie contenant les fonctions pour accèder 
au serveur ldap.
                \author         Rodolphe Quiedeville.
                \author         Benoit Mortier.
-               \version        $Revision: 1.30 $
+               \version        $Revision: 1.31 $
 
                Ensemble des fonctions permettant d'accèder à un serveur LDAP.
 */
 
+class Ldap
+{
+       var $err; // erreur ldap
+       
+       
+       /**
+       *    \brief  Constructeur de la classe
+       */
+       function Ldap()
+       {
+               $this->err = "";
+       }
+
 
 /**
                \brief          Ouverture d'une connection vers le serveur LDAP
@@ -86,7 +99,7 @@
   }
   else
   {
-       $this->err = ldap_error($ldapbind);
+       $this->err = ldap_error($ds);
   }
 }
 
@@ -149,5 +162,6 @@
        $stu = ereg_replace("ä","a",$stu);
        return $stu;
 }
+}
 
 ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]