dolibarr/htdocs/core/modules/modLdap.class.php

93 lines
3.5 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* 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
*/
/**
* \defgroup ldap Module ldap
2011-08-31 12:27:17 +02:00
* \brief Module to manage LDAP interfaces with contacts or users
* \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
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
2004-01-23 13:53:56 +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
{
/**
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
*/
function __construct($db)
{
2012-01-04 21:23:50 +01:00
$this->db = $db;
$this->numero = 200;
2008-10-01 21:10:17 +02: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)
$this->name = preg_replace('/^mod/i','',get_class($this));
$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';
$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
// Data directories to create when module is enabled
$this->dirs = array("/ldap/temp");
2008-10-01 21:10:17 +02:00
// Config pages
$this->config_page_url = array("ldap.php");
2008-10-01 21:10:17 +02:00
// Dependancies
$this->depends = array();
$this->requiredby = array();
2008-10-01 21:10:17 +02:00
// Constants
2009-08-12 14:12:15 +02:00
$this->const = array(
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),
2009-08-12 14:12:15 +02:00
);
2015-09-07 15:46:57 +02:00
// Boxes
$this->boxes = array();
2008-10-01 21:10:17 +02:00
// Permissions
$this->rights = array();
$this->rights_class = 'ldap';
}
2004-01-23 13:53:56 +01:00
}