2004-10-20 00:24:10 +02:00
|
|
|
<?php
|
2006-11-18 22:59:10 +01:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2007-10-10 01:15:25 +02:00
|
|
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
2012-12-30 15:13:49 +01:00
|
|
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
2004-01-23 13:53:56 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-01-23 13:53:56 +01:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-01 01:24:38 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2004-01-23 13:53:56 +01:00
|
|
|
*/
|
2004-08-14 14:21:24 +02:00
|
|
|
|
2010-01-16 19:48:27 +01:00
|
|
|
/**
|
2010-01-05 19:24:29 +01:00
|
|
|
* \defgroup ldap Module ldap
|
2011-08-31 12:27:17 +02:00
|
|
|
* \brief Module to manage LDAP interfaces with contacts or users
|
2011-10-24 14:11:49 +02:00
|
|
|
* \file htdocs/core/modules/modLdap.class.php
|
2009-08-12 14:12:15 +02:00
|
|
|
* \ingroup ldap
|
2011-08-31 12:27:17 +02:00
|
|
|
* \brief File to describe and activate Ldap module
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2012-08-23 02:04:35 +02:00
|
|
|
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
2007-10-10 01:15:25 +02:00
|
|
|
|
2004-01-23 13:53:56 +01:00
|
|
|
|
2010-01-16 19:48:27 +01:00
|
|
|
/**
|
2015-09-07 15:55:26 +02:00
|
|
|
* Class to describe and enable module Ldap
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2004-01-23 13:53:56 +01:00
|
|
|
class modLdap extends DolibarrModules
|
|
|
|
|
{
|
2006-11-18 22:59:10 +01:00
|
|
|
/**
|
2011-09-26 16:22:35 +02:00
|
|
|
* Constructor. Define names, constants, directories, boxes, permissions
|
|
|
|
|
*
|
2012-01-04 21:23:50 +01:00
|
|
|
* @param DoliDB $db Database handler
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2012-07-30 17:17:33 +02:00
|
|
|
function __construct($db)
|
2010-01-16 19:48:27 +01:00
|
|
|
{
|
2012-01-04 21:23:50 +01:00
|
|
|
$this->db = $db;
|
|
|
|
|
$this->numero = 200;
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2018-02-25 10:55:02 +01:00
|
|
|
$this->family = "interface";
|
2008-10-01 21:10:17 +02:00
|
|
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
2009-10-21 15:09:42 +02:00
|
|
|
$this->name = preg_replace('/^mod/i','',get_class($this));
|
2006-11-18 22:59:10 +01:00
|
|
|
$this->description = "Synchronisation Ldap";
|
2017-08-22 18:34:58 +02:00
|
|
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
|
|
|
|
$this->version = 'dolibarr';
|
2008-10-06 09:39:52 +02:00
|
|
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
2010-06-02 21:56:14 +02:00
|
|
|
// Name of image file used for this module.
|
|
|
|
|
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
|
|
|
|
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
|
|
|
|
|
$this->picto = 'technic';
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2009-04-28 22:35:01 +02:00
|
|
|
// Data directories to create when module is enabled
|
2009-05-04 13:40:00 +02:00
|
|
|
$this->dirs = array("/ldap/temp");
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2006-11-18 22:59:10 +01:00
|
|
|
// Config pages
|
2006-12-06 00:20:18 +01:00
|
|
|
$this->config_page_url = array("ldap.php");
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2009-05-04 13:40:00 +02:00
|
|
|
// Dependancies
|
2006-11-18 22:59:10 +01:00
|
|
|
$this->depends = array();
|
|
|
|
|
$this->requiredby = array();
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2009-05-04 13:40:00 +02:00
|
|
|
// Constants
|
2009-08-12 14:12:15 +02:00
|
|
|
$this->const = array(
|
2010-01-05 19:24:29 +01:00
|
|
|
0=>array('LDAP_SERVER_TYPE','chaine','openldap','',0),
|
|
|
|
|
1=>array('LDAP_SERVER_PROTOCOLVERSION','chaine','3','',0),
|
|
|
|
|
2=>array('LDAP_SERVER_HOST','chaine','localhost','',0),
|
2012-10-24 21:19:10 +02:00
|
|
|
3=>array('LDAP_USER_DN','chaine','ou=users,dc=example,dc=com','',0),
|
|
|
|
|
4=>array('LDAP_GROUP_DN','chaine','ou=groups,dc=example,dc=com','',0),
|
|
|
|
|
5=>array('LDAP_FILTER_CONNECTION','chaine','&(objectClass=inetOrgPerson)','',0),
|
2010-01-05 19:24:29 +01:00
|
|
|
6=>array('LDAP_FIELD_LOGIN','chaine','uid','',0),
|
2010-01-16 19:48:27 +01:00
|
|
|
7=>array('LDAP_FIELD_FULLNAME','chaine','cn','',0),
|
|
|
|
|
8=>array('LDAP_FIELD_NAME','chaine','sn','',0),
|
|
|
|
|
9=>array('LDAP_FIELD_FIRSTNAME','chaine','givenname','',0),
|
|
|
|
|
10=>array('LDAP_FIELD_MAIL','chaine','mail','',0),
|
|
|
|
|
11=>array('LDAP_FIELD_PHONE','chaine','telephonenumber','',0),
|
|
|
|
|
12=>array('LDAP_FIELD_FAX','chaine','facsimiletelephonenumber','',0),
|
|
|
|
|
13=>array('LDAP_FIELD_MOBILE','chaine','mobile','',0),
|
2009-08-12 14:12:15 +02:00
|
|
|
);
|
2009-05-04 13:40:00 +02:00
|
|
|
|
2015-09-07 15:46:57 +02:00
|
|
|
// Boxes
|
2006-11-18 22:59:10 +01:00
|
|
|
$this->boxes = array();
|
2008-10-01 21:10:17 +02:00
|
|
|
|
2006-11-18 22:59:10 +01:00
|
|
|
// Permissions
|
|
|
|
|
$this->rights = array();
|
|
|
|
|
$this->rights_class = 'ldap';
|
|
|
|
|
}
|
2004-01-23 13:53:56 +01:00
|
|
|
}
|