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>
|
2018-10-27 14:43:12 +02:00
|
|
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.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
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://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
|
2021-03-20 13:55:43 +01:00
|
|
|
* \brief Description and activation file for the module LDAP
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2020-04-10 10:59:32 +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
|
|
|
*/
|
2019-02-25 20:35:59 +01:00
|
|
|
public 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";
|
2018-11-07 16:33:06 +01:00
|
|
|
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
|
|
|
|
$this->module_position = '30';
|
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)
|
2019-01-27 11:55:16 +01: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
|
|
|
|
2018-07-09 17:22:34 +02:00
|
|
|
// Dependencies
|
2020-04-10 10:59:32 +02:00
|
|
|
$this->hidden = false; // A condition to hide module
|
|
|
|
|
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
|
|
|
|
|
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
|
|
|
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
2021-02-06 13:48:31 +01:00
|
|
|
$this->phpmin = array(5, 6); // Minimum version of PHP required by module
|
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(
|
2020-04-10 10:59:32 +02: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),
|
|
|
|
|
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),
|
|
|
|
|
6=>array('LDAP_FIELD_LOGIN', 'chaine', 'uid', '', 0),
|
|
|
|
|
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),
|
2021-03-05 11:14:21 +01:00
|
|
|
14=>array('LDAP_GROUP_FILTER', 'chaine', '&(objectClass=groupOfNames)', '', 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
|
|
|
}
|