* Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006 Laurent Destailleur * * 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 2 of the License, or * (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 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ */ /** \file htdocs/admin/ldap.php \ingroup ldap \brief Page d'administration/configuration du module Ldap \version $Revision$ \remarks Exemple configuration : LDAP_SERVER_HOST Serveur LDAP 192.168.1.50 LDAP_SERVER_PORT Port LDAP 389 LDAP_ADMIN_DN Administrateur LDAP cn=adminldap,dc=societe,dc=com LDAP_ADMIN_PASS Mot de passe xxxxxxxx LDAP_USER_DN DN des utilisateurs ou=users,dc=societe,dc=com LDAP_GROUP_DN DN des groupes ou=groups,dc=societe,dc=com LDAP_CONTACT_DN DN des contacts ou=contacts,dc=societe,dc=com LDAP_SERVER_TYPE Type Openldap */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/authldap.lib.php"); $langs->load("admin"); if (!$user->admin) accessforbidden(); /* * Actions */ if ($_GET["action"] == 'setvalue' && $user->admin) { if (! dolibarr_set_const($db, 'LDAP_USER_DN',$_POST["user"])) { print $db->error(); } if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',$_POST["group"])) { print $db->error(); } if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN',$_POST["fieldlogin"])) { print $db->error(); } if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',$_POST["filterconnection"])) { print $db->error(); } } /* * Visu */ llxHeader(); print_fiche_titre($langs->trans("LDAPSetup"),'','setup'); // Test si fonction LDAP actives if (! function_exists("ldap_connect")) { $mesg=$langs->trans("LDAPFunctionsNotAvailableOnPHP"); } if ($mesg) print '
'.$mesg.'
'; else print '
'; // Onglets $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/ldap.php"; $head[$h][1] = $langs->trans("LDAPGlobalParameters"); $h++; if ($conf->global->LDAP_SYNCHRO_ACTIVE) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_users.php"; $head[$h][1] = $langs->trans("LDAPUsersAndGroupsSynchro"); $hselected=$h; $h++; } if ($conf->global->LDAP_CONTACT_ACTIVE) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_contacts.php"; $head[$h][1] = $langs->trans("LDAPContactsSynchro"); $h++; } if ($conf->global->LDAP_MEMBERS_ACTIVE) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); $h++; } dolibarr_fiche_head($head, $hselected, $langs->trans("LDAP")); print '
'; print ''; $var=true; $html=new Form($db); print ''; print ''; print "\n"; // DN Pour les utilisateurs $var=!$var; print ''; // DN pour les groupes $var=!$var; print ''; // Filtre de connexion $var=!$var; print ''; // Login unix $var=!$var; print ''; // Login samba $var=!$var; print ''; // Name $var=!$var; print ''; // Firstname $var=!$var; print ''; // Mail $var=!$var; print ''; // Phone $var=!$var; print ''; // Fax $var=!$var; print ''; // Mobile $var=!$var; print ''; print ''; print '
'.$langs->trans("LDAPSynchronizeUsersAndGroup").'
'.$langs->trans("LDAPUserDn").''; print ''; print ''.$langs->trans("LDAPUserDnExample").'
'.$langs->trans("LDAPGroupDn").''; print ''; print ''.$langs->trans("LDAPGroupDnExample").'
'.$langs->trans("LDAPFilterConnection").''; if ($conf->global->LDAP_FILTER_CONNECTION) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFilterConnectionExample").'
'.$langs->trans("LDAPFieldLoginUnix").''; if ($conf->global->LDAP_FIELD_LOGIN) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldLoginExample").'
'.$langs->trans("LDAPFieldLoginSamba").''; if ($conf->global->LDAP_FIELD_LOGIN_SAMBA) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldLoginSambaExample").'
'.$langs->trans("LDAPFieldName").''; if ($conf->global->LDAP_FIELD_NAME) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldNameExample").'
'.$langs->trans("LDAPFieldFirstName").''; if ($conf->global->LDAP_FIELD_FIRSTNAME) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldFirstNameExample").'
'.$langs->trans("LDAPFieldMail").''; if ($conf->global->LDAP_FIELD_MAIL) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldMailExample").'
'.$langs->trans("LDAPFieldPhone").''; if ($conf->global->LDAP_FIELD_PHONE) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldPhoneExample").'
'.$langs->trans("LDAPFieldFax").''; if ($conf->global->LDAP_FIELD_FAX) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldFaxExample").'
'.$langs->trans("LDAPFieldMobile").''; if ($conf->global->LDAP_FIELD_MOBILE) { print ''; } else { print ''; } print ''.$langs->trans("LDAPFieldMobileExample").'
'; print '
'; print ''; $db->close(); llxFooter('$Date$ - $Revision$'); ?>