ajout configuration ldapsaisie

This commit is contained in:
Benjamin Dauvergne 2016-09-05 01:10:18 +02:00
parent f09b230786
commit d6893e5617
12 changed files with 1533 additions and 0 deletions

View File

@ -0,0 +1,130 @@
<?php
$GLOBALS['LSobjects']['cfdtApplication'] = array (
'objectclass' => array(
'cfdtApplication'
),
'rdn' => 'cn',
'container_dn' => 'ou=applications,ou=groupes',
'label' => 'Application',
'display_name_format' => '%{cn}',
'displayAttrName' => true,
'LSform' => array (
'layout' => array(
'role' => array(
'label' => 'Rôle',
'args' => array(
'cn',
'description',
'labeledURI',
'cfdtAuthorizedRole',
)
)
)
), // fin LSform
// LSsearch
'LSsearch' => array (
'attrs' => array(
'cn',
)
), // fin LSsearch
// Attributs
'attrs' => array (
/* ----------- start -----------*/
'cn' => array (
'label' => 'Identifiant',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'validation' => array (
array (
'filter' => 'cn=%{val}',
'result' => 0,
'msg' => 'Cet identifiant est déjà utilisé.'
)
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'description' => array (
'label' => 'Description/Commentaire',
'ldap_type' => 'ascii',
'html_type' => 'textarea',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'labeledURI' => array (
'label' => 'URL',
'ldap_type' => 'ascii',
'html_type' => 'url',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtAuthorizedRole' => array (
'label' => 'Membres',
'ldap_type' => 'ascii',
'html_type' => 'select_object',
'html_options' => array(
'selectable_object' => array(
'object_type' => 'cfdtRole', // Nom de l'objet à lister
'display_name_format' => '%{cn}', // Spécifie le attributs à lister pour le choix,
// si non définie => utilisation du 'display_name_format'
// de la définition de l'objet
'value_attribute' => 'dn', // Spécifie le attributs dont la valeur sera retournée par
)
),
'required' => 0,
'multiple' => 1,
'validation' => array (
array (
'basedn' => '%{val}',
'result' => 1
)
),
'view' => 1,
'rights' => array(
'admin' => 'w',
),
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
)
);

View File

@ -0,0 +1,112 @@
<?php
$GLOBALS['LSobjects']['cfdtFederation'] = array (
'objectclass' => array(
'cfdtFederation'
),
'rdn' => 'cn',
'container_dn' => 'ou=federations,ou=groupes',
'label' => 'Fédération',
'display_name_format' => '%{cn}',
'displayAttrName' => true,
'LSform' => array (
'layout' => array(
'role' => array(
'label' => 'Rôle',
'args' => array(
'cn',
'description',
'member',
)
)
)
), // fin LSform
// LSsearch
'LSsearch' => array (
'attrs' => array(
'cn',
)
), // fin LSsearch
// Attributs
'attrs' => array (
/* ----------- start -----------*/
'cn' => array (
'label' => 'Identifiant',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'validation' => array (
array (
'filter' => 'cn=%{val}',
'result' => 0,
'msg' => 'Cet identifiant est déjà utilisé.'
)
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'description' => array (
'label' => 'Description/Commentaire',
'ldap_type' => 'ascii',
'html_type' => 'textarea',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'member' => array (
'label' => 'Membres',
'ldap_type' => 'ascii',
'html_type' => 'select_object',
'html_options' => array(
'selectable_object' => array(
'object_type' => 'cfdtUtilisateur', // Nom de l'objet à lister
'display_name_format' => '%{givenName} %{sn} (%{uid})', // Spécifie le attributs à lister pour le choix,
// si non définie => utilisation du 'display_name_format'
// de la définition de l'objet
'value_attribute' => 'dn', // Spécifie le attributs dont la valeur sera retournée par
)
),
'required' => 0,
'multiple' => 1,
'validation' => array (
array (
'basedn' => '%{val}',
'result' => 1
)
),
'view' => 1,
'rights' => array(
'admin' => 'w',
),
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
)
);

View File

@ -0,0 +1,112 @@
<?php
$GLOBALS['LSobjects']['cfdtRegion'] = array (
'objectclass' => array(
'cfdtRegion'
),
'rdn' => 'cn',
'container_dn' => 'ou=regions,ou=groupes',
'label' => 'Région',
'display_name_format' => '%{cn}',
'displayAttrName' => true,
'LSform' => array (
'layout' => array(
'role' => array(
'label' => 'Rôle',
'args' => array(
'cn',
'description',
'member',
)
)
)
), // fin LSform
// LSsearch
'LSsearch' => array (
'attrs' => array(
'cn',
)
), // fin LSsearch
// Attributs
'attrs' => array (
/* ----------- start -----------*/
'cn' => array (
'label' => 'Identifiant',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'validation' => array (
array (
'filter' => 'cn=%{val}',
'result' => 0,
'msg' => 'Cet identifiant est déjà utilisé.'
)
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'description' => array (
'label' => 'Description/Commentaire',
'ldap_type' => 'ascii',
'html_type' => 'textarea',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'member' => array (
'label' => 'Membres',
'ldap_type' => 'ascii',
'html_type' => 'select_object',
'html_options' => array(
'selectable_object' => array(
'object_type' => 'cfdtUtilisateur', // Nom de l'objet à lister
'display_name_format' => '%{givenName} %{sn} (%{uid})', // Spécifie le attributs à lister pour le choix,
// si non définie => utilisation du 'display_name_format'
// de la définition de l'objet
'value_attribute' => 'dn', // Spécifie le attributs dont la valeur sera retournée par
)
),
'required' => 0,
'multiple' => 1,
'validation' => array (
array (
'basedn' => '%{val}',
'result' => 1
)
),
'view' => 1,
'rights' => array(
'admin' => 'w',
),
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
)
);

View File

@ -0,0 +1,131 @@
<?php
$GLOBALS['LSobjects']['cfdtRole'] = array (
'objectclass' => array(
'cfdtRole'
),
'rdn' => 'cn',
'container_dn' => 'ou=roles,ou=groupes',
'label' => 'Rôle',
'display_name_format' => '%{cn}',
'displayAttrName' => true,
'LSform' => array (
'layout' => array(
'role' => array(
'label' => 'Rôle',
'args' => array(
'cn',
'description',
'member',
)
)
)
), // fin LSform
// LSsearch
'LSsearch' => array (
'attrs' => array(
'cn',
)
), // fin LSsearch
'LSrelation' => array(
'applications' => array(
'label' => 'A accès aux applications...',
'emptyText' => "N'a accés à aucune application",
'LSobject' => 'cfdtApplication',
'list_function' => 'listUserGroups',
'getkeyvalue_function' => 'getMemberKeyValue',
'update_function' => 'updateUserGroups',
'remove_function' => 'deleteOneMember',
'rename_function' => 'renameOneMember',
'canEdit_function' => 'canEditGroupRelation',
'canEdit_attribute' => 'member',
'rights' => array(
'self' => 'r',
'admin' => 'w',
)
),
),
// Attributs
'attrs' => array (
/* ----------- start -----------*/
'cn' => array (
'label' => 'Identifiant',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'validation' => array (
array (
'filter' => 'cn=%{val}',
'result' => 0,
'msg' => 'Cet identifiant est déjà utilisé.'
)
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'description' => array (
'label' => 'Description/Commentaire',
'ldap_type' => 'ascii',
'html_type' => 'textarea',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'member' => array (
'label' => 'Membres',
'ldap_type' => 'ascii',
'html_type' => 'select_object',
'html_options' => array(
'selectable_object' => array(
'object_type' => 'cfdtUtilisateur', // Nom de l'objet à lister
'display_name_format' => '%{givenName} %{sn} (%{uid})', // Spécifie le attributs à lister pour le choix,
// si non définie => utilisation du 'display_name_format'
// de la définition de l'objet
'value_attribute' => 'dn', // Spécifie le attributs dont la valeur sera retournée par
)
),
'required' => 0,
'multiple' => 1,
'validation' => array (
array (
'basedn' => '%{val}',
'result' => 1
)
),
'view' => 1,
'rights' => array(
'admin' => 'w',
),
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
)
);

View File

@ -0,0 +1,359 @@
<?php
$GLOBALS['LSobjects']['cfdtUtilisateur'] = array (
'objectclass' => array(
'cfdtUtilisateur'
),
'rdn' => 'uid',
'container_dn' => 'ou=personnes',
'label' => 'Utilisateur',
'display_name_format' => '%{givenName} %{sn}',
'displayAttrName' => true,
// LSform
'LSform' => array (
'layout' => array(
'user' => array(
'label' => 'Utilisateur',
'args' => array(
'uid',
'givenName',
'sn',
'cfdtNPA',
'mail',
'cfdtEmail',
'cfdtIdentifiantCompteMDM',
'cfdtUserPasswordHistorique',
'description',
'cfdtDateDeCreation',
'cfdtDateDActivation',
'cfdtUserStatus',
)
)
)
), // fin LSform
// LSrelation
'LSrelation' => array(
'roles' => array(
'label' => 'Est membre des rôles...',
'emptyText' => "N'est membre d'aucun rôle",
'LSobject' => 'cfdtRole',
'list_function' => 'listUserGroups',
'getkeyvalue_function' => 'getMemberKeyValue',
'update_function' => 'updateUserGroups',
'remove_function' => 'deleteOneMember',
'rename_function' => 'renameOneMember',
'canEdit_function' => 'canEditGroupRelation',
'canEdit_attribute' => 'member',
'rights' => array(
'self' => 'r',
'admin' => 'w',
)
),
'federations' => array(
'label' => 'Est membre des fédérations...',
'emptyText' => "N'est membre d'aucune fédération",
'LSobject' => 'cfdtFederation',
'list_function' => 'listUserGroups',
'getkeyvalue_function' => 'getMemberKeyValue',
'update_function' => 'updateUserGroups',
'remove_function' => 'deleteOneMember',
'rename_function' => 'renameOneMember',
'canEdit_function' => 'canEditGroupRelation',
'canEdit_attribute' => 'member',
'rights' => array(
'self' => 'r',
'admin' => 'w',
)
),
'regions' => array(
'label' => 'Est membre des régions...',
'emptyText' => "N'est membre d'aucune région",
'LSobject' => 'cfdtRegion',
'list_function' => 'listUserGroups',
'getkeyvalue_function' => 'getMemberKeyValue',
'update_function' => 'updateUserGroups',
'remove_function' => 'deleteOneMember',
'rename_function' => 'renameOneMember',
'canEdit_function' => 'canEditGroupRelation',
'canEdit_attribute' => 'member',
'rights' => array(
'self' => 'r',
'admin' => 'w',
)
),
),
// LSsearch
'LSsearch' => array (
'attrs' => array(
'givenName',
'sn',
'uid',
'mail',
'cfdtEmail',
'cfdtNPA',
'cfdtIdentifiantCompteMDM'
)
), // fin LSsearch
// Attributs
'attrs' => array (
/* ----------- start -----------*/
'uid' => array (
'label' => 'Identifiant',
'help_info' => 'L\'identifiant ne doit contenir que des lettres , des chiffres, des tirets, des underscores ou des points.',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'check_data' => array (
'regex' => array(
'msg' => "L'identifiant ne doit contenir que des lettres , des chiffres, des tirets, des underscores ou des points.",
'params' => array(
'regex' => '/^[-_.a-zA-Z0-9]+$/',
),
),
),
'validation' => array (
array (
'filter' => 'uid=%{val}',
'result' => 0,
'msg' => 'Cet identifiant est déjà utilisé.'
)
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'userPassword' => array (
'label' => 'Password',
'help_info' => 'Le mot de passe doit faire plus de 8 caractères.',
'ldap_type' => 'password',
'html_type' => 'password',
'html_options' => array(
'generationTool' => true,
'autoGenerate' => false,
'lenght' => 8,
'chars' => array (
array (
'chars' => '23456789abcdefjkpqrstwxyzABCDEFJKPQRSTWXYZ',
'nb' => 6
)
),
),
'check_data' => array(
'password' => array(
'msg' => 'Le mot de passe doit faire plus de 8 caractères.',
'params' => array(
'minLength' => 8,
)
)
),
'required' => 1,
'rights' => array(
'self' => 'w',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1,
'lostPassword' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'givenName' => array (
'label' => 'Prénom',
'ldap_type' => 'ascii',
'html_type' => 'text',
'rights' => array(
'self' => 'r',
'admin' => 'w',
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'sn' => array (
'label' => 'Nom',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtNPA' => array (
'label' => 'Identifiant CFDT',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'mail' => array (
'label' => 'E-mail',
'ldap_type' => 'ascii',
'html_type' => 'mail',
'check_data' => array (
'email' => array(
'msg' => "Cette adresse est invalide.",
),
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtEmail' => array (
'label' => 'E-mail CFDT',
'ldap_type' => 'ascii',
'html_type' => 'mail',
'check_data' => array (
'email' => array(
'msg' => "Cette adresse est invalide.",
),
),
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtIdentifiantCompteMDM' => array (
'label' => 'Identifiant MDM',
'ldap_type' => 'ascii',
'html_type' => 'text',
'required' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
),
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'description' => array (
'label' => 'Description/Commentaire',
'ldap_type' => 'ascii',
'html_type' => 'textarea',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtDateDeCreation' => array (
'label' => 'Date de création',
'ldap_type' => 'date',
'html_type' => 'date',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtDateDActivation' => array (
'label' => 'Date d\'activation',
'ldap_type' => 'date',
'html_type' => 'date',
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
/* ----------- start -----------*/
'cfdtUserStatus' => array (
'label' => 'Statut',
'ldap_type' => 'ascii',
'html_type' => 'select_box',
'html_options' => array(
'possibles_values' => array(
'statut1',
'statut2',
'statut3',
)
),
'multiple' => 1,
'rights' => array(
'self' => 'r',
'admin' => 'w'
),
'view' => 1,
'form' => array (
'modify' => 1,
'create' => 1
)
),
/* ----------- end -----------*/
)
);

View File

@ -0,0 +1,207 @@
<?php
/*******************************************************************************
* Copyright (C) 2007 Easter-eggs
* http://ldapsaisie.labs.libre-entreprise.org
*
* Author: See AUTHORS file in top-level directory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* 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.
******************************************************************************/
// Configuration LDAP Saisie :
$GLOBALS['LSconfig'] = array(
'NetLDAP2' => '/usr/share/php/Net/LDAP2.php',
'Smarty' => '/usr/share/php/smarty3/Smarty.class.php',
'lang' => 'fr_FR',
'encoding' => 'UTF8',
'cacheLSprofiles' => true,
'cacheSubDn' => true,
'cacheSearch' => true,
'keepLSsessionActive' => true,
'ldap_servers' => array (
array (
'name' => 'LSexample',
'ldap_config'=> array(
'host' => '127.0.0.1',
'port' => 389,
'version' => 3,
'starttls' => false,
'binddn' => 'uid=ldapsaisie,ou=sysaccounts,o=ls',
'bindpw' => 'toto',
'basedn' => 'o=ls',
'options' => array(),
'filter' => '(objectClass=*)',
'scope' => 'sub'
),
/*
'LSauth' => array (
'method' => 'HTTP'
),
*/
'LSprofiles' => array (
'admin' => array (
'o=ls' => array (
'uid=eeggs,ou=people,o=ls' => NULL
),
'ou=people,o=ls' => array (
'cn=adminldap,ou=groups,o=ls' => array (
'attr' => 'uniqueMember',
'LSobject' => 'LSgroup'
)
)
),
'godfather' => array (
'LSobjects' => array (
'LSpeople' => array (
'attr' => 'lsGodfatherDn',
'attr_value' => '%{dn}',
'basedn' => 'ou=people,o=ls'
),
'LSgroup' => array (
'filter' => '(lsGodfatherDn=%{dn})'
)
)
)
),
'cacheLSprofiles' => true,
'cacheSearch' => true,
'authObjectType' => 'LSpeople',
'authObjectFilter' => '(|(uid=%{user})(mail=%{user}))',
'authObjectTypeAttrPwd' => 'userPassword',
'LSaccess' => array(
'LSpeople',
'LSgroup'
),
'recoverPassword' => array(
'mailAttr' => 'mail',
'recoveryHashAttr' => 'lsRecoveryHash',
'recoveryEmailSender' => 'noreply-recover@ls.com',
'recoveryHashMail' => array(
'subject' => 'LSexample : Recovering your password.',
'msg' => "To proceed password recovery procedure, please follow that link:\n%{url}"
),
'newPasswordMail' => array(
'subject' => 'LSexample : Your new credentials.',
'msg' => "Your new password : %{mdp}"
)
),
'emailSender' => 'noreply@ls.com'
),
array (
'name' => 'LSexample - multi-company',
'ldap_config'=> array(
'host' => '127.0.0.1',
'port' => 389,
'version' => 3,
'starttls' => false,
'binddn' => 'uid=ldapsaisie,ou=sysaccounts,o=ls',
'bindpw' => 'toto',
'basedn' => 'o=ls',
'options' => array(),
'filter' => '(objectClass=*)',
'scope' => 'sub'
),
'LSprofiles' => array(
'admin' => array (
'o=ls' => array (
'uid=eeggs,ou=people,o=ls' => NULL,
'cn=adminldap,ou=groups,o=ls' => array (
'attr' => 'uniqueMember',
'LSobject' => 'LSgroup'
)
)
),
'admingroup' => array (
'ou=company1,ou=companies,o=ls' => array (
'uid=user1,ou=people,ou=company1,ou=companies,o=ls' => NULL
)
)
),
'authObjectType' => 'LSpeople',
'subDnLabel' => 'Company',
'subDn' => array(
'== All ==' => array(
'dn' => 'o=ls',
'LSobjects' => array(
'LSpeople',
'LSgroup',
'LScompany'
)
),
'LSobject' => array(
'LScompany' => array(
'LSobjects' => array(
'LSpeople',
'LSgroup'
)
)
)
),
'cacheLSprofiles' => true,
'cacheSearch' => true,
'authObjectTypeAttrPwd' => 'userPassword',
'recoverPassword' => array(
'mailAttr' => 'mail',
'recoveryHashAttr' => 'lsRecoveryHash',
'recoveryEmailSender' => 'noreply-recover@lsexample.net',
'recoveryHashMail' => array(
'subject' => 'LSexample : Recovering your password.',
'msg' => "To proceed password recovery procedure, please follow that link:\n%{url}"
),
'newPasswordMail' => array(
'subject' => 'LSexample : Your new credentials.',
'msg' => "Your new password : %{mdp}"
)
),
'emailSender' => 'noreply@lsexample.net'
)
)
);
// Interface
// Theme Black
//define('LS_THEME','black');
//define('LS_TEMPLATES_DIR', 'templates/default');
// Theme Default
define('LS_THEME','default');
define('LS_TEMPLATES_DIR', 'templates');
define('LS_IMAGES_DIR', 'images');
define('LS_CSS_DIR', 'css');
//Debug
define('LSdebug',false);
// Logs
$GLOBALS['LSlog']['filename'] = '/var/log/ldapsaisie/ldapsaisie.log';
$GLOBALS['LSlog']['enable'] = true;
define('NB_LSOBJECT_LIST',20);
define('NB_LSOBJECT_LIST_SELECT',11);
define('MAX_SEND_FILE_SIZE',2000000);
// Javascript
$GLOBALS['defaultJSscipts']=array(
'mootools-core.js',
'mootools-more.js',
'functions.js',
'LSdefault.js',
'LSinfosBox.js'
);
// CSS
$GLOBALS['defaultCSSfiles']=array();

View File

@ -0,0 +1,104 @@
<?php
/*******************************************************************************
* Copyright (C) 2007 Easter-eggs
* http://ldapsaisie.labs.libre-entreprise.org
*
* Author: See AUTHORS file in top-level directory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* 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.
******************************************************************************/
// Configuration LDAP Saisie :
$GLOBALS['LSconfig'] = array(
'NetLDAP2' => '/usr/share/php/Net/LDAP2.php',
'Smarty' => '/usr/share/php/smarty3/Smarty.class.php',
'lang' => 'fr_FR',
'encoding' => 'UTF8',
'cacheLSprofiles' => true,
'cacheSubDn' => true,
'cacheSearch' => false,
'keepLSsessionActive' => true,
'ldap_servers' => array (
array (
'name' => 'LSexample',
'ldap_config'=> array(
'host' => '127.0.0.1',
'port' => 389,
'version' => 3,
'starttls' => false,
'binddn' => 'cn=admin,dc=cfdt,dc=fr',
'bindpw' => 'FIXME',
'basedn' => 'dc=cfdt,dc=fr',
'options' => array(),
'filter' => '(objectClass=*)',
'scope' => 'sub'
),
'LSprofiles' => array (
'admin' => array(
'dc=cfdt,dc=fr' => 'uid=admin,ou=personnes,dc=cfdt,dc=fr',
)
),
'cacheLSprofiles' => true,
'cacheSearch' => true,
'authObjectType' => 'cfdtUtilisateur',
'authObjectFilter' => '(|(uid=%{user})(cfdtEmail=%{user})(mail=%{user}))',
'authObjectTypeAttrPwd' => 'userPassword',
'LSaccess' => array(
'cfdtUtilisateur',
'cfdtRole',
'cfdtApplication',
'cfdtFederation',
'cfdtRegion',
),
'emailSender' => 'noreply@cfdt.fr'
),
)
);
// Interface
// Theme Black
//define('LS_THEME','black');
//define('LS_TEMPLATES_DIR', 'templates/default');
// Theme Default
define('LS_THEME','default');
define('LS_TEMPLATES_DIR', 'templates');
define('LS_IMAGES_DIR', 'images');
define('LS_CSS_DIR', 'css');
//Debug
define('LSdebug',false);
// Logs
$GLOBALS['LSlog']['filename'] = '/var/log/ldapsaisie/ldapsaisie.log';
$GLOBALS['LSlog']['enable'] = true;
define('NB_LSOBJECT_LIST',20);
define('NB_LSOBJECT_LIST_SELECT',11);
define('MAX_SEND_FILE_SIZE',2000000);
// Javascript
$GLOBALS['defaultJSscipts']=array(
'mootools-core.js',
'mootools-more.js',
'functions.js',
'LSdefault.js',
'LSinfosBox.js'
);
// CSS
$GLOBALS['defaultCSSfiles']=array();

View File

@ -0,0 +1,93 @@
<?php
class cfdtApplication extends LSldapObject {
var $userObjectType = 'cfdtRole';
var $memberAttr = 'cfdtAuthorizedRole';
var $memberAttrValue = 'dn';
/* ========== Members ========== */
/**
* Retourne la valeur clef d'un membre
*
* @param[in] $object Un object utilisateur
*
* @retval Mixed La valeur clef d'un membre
**/
function getMemberKeyValue($object) {
return $this -> getObjectKeyValueInRelation($object,$this -> memberAttr,$this -> userObjectType);
}
/**
* Retourne la liste des groupes pour utilisateur
*
* Retourne un tableau de LSsupannGroup correspondant aux groupes
* auxquels appartient un utilisateur
*
* @param[in] $userObject Un object user (type : $this -> userObjectType)
*
* @retval Array of LSsupannGroup Les groupes de l'utilisateur
**/
function listUserGroups($userObject) {
return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Ajoute un utilisateur au groupe
*
* @param[in] $object Un object user ($this -> userObjectType) : l'utilisateur à ajouter
*
* @retval boolean true si l'utilisateur à été ajouté, False sinon
**/
function addOneMember($object) {
return $this -> addOneObjectInRelation($object,$this -> memberAttr, $this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Supprime un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à supprimer
*
* @retval boolean true si l'utilisateur à été supprimé, False sinon
**/
function deleteOneMember($object) {
return $this -> deleteOneObjectInRelation($object,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Renome un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à renomer
* @param[in] $oldDn string L'ancien DN de l'utilisateur
*
* @retval boolean True en cas de succès, False sinon
*/
function renameOneMember($object,$oldDn) {
return $this -> renameOneObjectInRelation($object,$oldDn,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Met à jour les groupes d'un utilisateur
*
* @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
* @param[in] $listDns Array(string) Un tableau des DNs des groupes de l'utilisateur
*
* @retval boolean true si tout c'est bien passé, False sinon
**/
function updateUserGroups($object,$listDns) {
return $this -> updateObjectsInRelation($object,$listDns,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Test si l'utilisateur peut d'editer la relation avec ce groupe
*
* @retval boolean true si tout l'utilisateur peut éditer la relation, False sinon
**/
function canEditGroupRelation($dn=NULL) {
if (!$dn) {
$dn=$this -> dn;
}
return LSsession :: canEdit($this -> type_name,$this -> dn,$this -> memberAttr);
}
}
?>

View File

@ -0,0 +1,93 @@
<?php
class cfdtFederation extends LSldapObject {
var $userObjectType = 'cfdtUtilisateur';
var $memberAttr = 'member';
var $memberAttrValue = 'dn';
/* ========== Members ========== */
/**
* Retourne la valeur clef d'un membre
*
* @param[in] $object Un object utilisateur
*
* @retval Mixed La valeur clef d'un membre
**/
function getMemberKeyValue($object) {
return $this -> getObjectKeyValueInRelation($object,$this -> memberAttr,$this -> userObjectType);
}
/**
* Retourne la liste des groupes pour utilisateur
*
* Retourne un tableau de LSsupannGroup correspondant aux groupes
* auxquels appartient un utilisateur
*
* @param[in] $userObject Un object user (type : $this -> userObjectType)
*
* @retval Array of LSsupannGroup Les groupes de l'utilisateur
**/
function listUserGroups($userObject) {
return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Ajoute un utilisateur au groupe
*
* @param[in] $object Un object user ($this -> userObjectType) : l'utilisateur à ajouter
*
* @retval boolean true si l'utilisateur à été ajouté, False sinon
**/
function addOneMember($object) {
return $this -> addOneObjectInRelation($object,$this -> memberAttr, $this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Supprime un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à supprimer
*
* @retval boolean true si l'utilisateur à été supprimé, False sinon
**/
function deleteOneMember($object) {
return $this -> deleteOneObjectInRelation($object,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Renome un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à renomer
* @param[in] $oldDn string L'ancien DN de l'utilisateur
*
* @retval boolean True en cas de succès, False sinon
*/
function renameOneMember($object,$oldDn) {
return $this -> renameOneObjectInRelation($object,$oldDn,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Met à jour les groupes d'un utilisateur
*
* @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
* @param[in] $listDns Array(string) Un tableau des DNs des groupes de l'utilisateur
*
* @retval boolean true si tout c'est bien passé, False sinon
**/
function updateUserGroups($object,$listDns) {
return $this -> updateObjectsInRelation($object,$listDns,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Test si l'utilisateur peut d'editer la relation avec ce groupe
*
* @retval boolean true si tout l'utilisateur peut éditer la relation, False sinon
**/
function canEditGroupRelation($dn=NULL) {
if (!$dn) {
$dn=$this -> dn;
}
return LSsession :: canEdit($this -> type_name,$this -> dn,$this -> memberAttr);
}
}
?>

View File

@ -0,0 +1,93 @@
<?php
class cfdtRegion extends LSldapObject {
var $userObjectType = 'cfdtUtilisateur';
var $memberAttr = 'member';
var $memberAttrValue = 'dn';
/* ========== Members ========== */
/**
* Retourne la valeur clef d'un membre
*
* @param[in] $object Un object utilisateur
*
* @retval Mixed La valeur clef d'un membre
**/
function getMemberKeyValue($object) {
return $this -> getObjectKeyValueInRelation($object,$this -> memberAttr,$this -> userObjectType);
}
/**
* Retourne la liste des groupes pour utilisateur
*
* Retourne un tableau de LSsupannGroup correspondant aux groupes
* auxquels appartient un utilisateur
*
* @param[in] $userObject Un object user (type : $this -> userObjectType)
*
* @retval Array of LSsupannGroup Les groupes de l'utilisateur
**/
function listUserGroups($userObject) {
return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Ajoute un utilisateur au groupe
*
* @param[in] $object Un object user ($this -> userObjectType) : l'utilisateur à ajouter
*
* @retval boolean true si l'utilisateur à été ajouté, False sinon
**/
function addOneMember($object) {
return $this -> addOneObjectInRelation($object,$this -> memberAttr, $this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Supprime un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à supprimer
*
* @retval boolean true si l'utilisateur à été supprimé, False sinon
**/
function deleteOneMember($object) {
return $this -> deleteOneObjectInRelation($object,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Renome un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à renomer
* @param[in] $oldDn string L'ancien DN de l'utilisateur
*
* @retval boolean True en cas de succès, False sinon
*/
function renameOneMember($object,$oldDn) {
return $this -> renameOneObjectInRelation($object,$oldDn,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Met à jour les groupes d'un utilisateur
*
* @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
* @param[in] $listDns Array(string) Un tableau des DNs des groupes de l'utilisateur
*
* @retval boolean true si tout c'est bien passé, False sinon
**/
function updateUserGroups($object,$listDns) {
return $this -> updateObjectsInRelation($object,$listDns,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Test si l'utilisateur peut d'editer la relation avec ce groupe
*
* @retval boolean true si tout l'utilisateur peut éditer la relation, False sinon
**/
function canEditGroupRelation($dn=NULL) {
if (!$dn) {
$dn=$this -> dn;
}
return LSsession :: canEdit($this -> type_name,$this -> dn,$this -> memberAttr);
}
}
?>

View File

@ -0,0 +1,93 @@
<?php
class cfdtRole extends LSldapObject {
var $userObjectType = 'cfdtUtilisateur';
var $memberAttr = 'member';
var $memberAttrValue = 'dn';
/* ========== Members ========== */
/**
* Retourne la valeur clef d'un membre
*
* @param[in] $object Un object utilisateur
*
* @retval Mixed La valeur clef d'un membre
**/
function getMemberKeyValue($object) {
return $this -> getObjectKeyValueInRelation($object,$this -> memberAttr,$this -> userObjectType);
}
/**
* Retourne la liste des groupes pour utilisateur
*
* Retourne un tableau de LSsupannGroup correspondant aux groupes
* auxquels appartient un utilisateur
*
* @param[in] $userObject Un object user (type : $this -> userObjectType)
*
* @retval Array of LSsupannGroup Les groupes de l'utilisateur
**/
function listUserGroups($userObject) {
return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Ajoute un utilisateur au groupe
*
* @param[in] $object Un object user ($this -> userObjectType) : l'utilisateur à ajouter
*
* @retval boolean true si l'utilisateur à été ajouté, False sinon
**/
function addOneMember($object) {
return $this -> addOneObjectInRelation($object,$this -> memberAttr, $this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Supprime un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à supprimer
*
* @retval boolean true si l'utilisateur à été supprimé, False sinon
**/
function deleteOneMember($object) {
return $this -> deleteOneObjectInRelation($object,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Renome un utilisateur du groupe
*
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à renomer
* @param[in] $oldDn string L'ancien DN de l'utilisateur
*
* @retval boolean True en cas de succès, False sinon
*/
function renameOneMember($object,$oldDn) {
return $this -> renameOneObjectInRelation($object,$oldDn,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
}
/**
* Met à jour les groupes d'un utilisateur
*
* @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
* @param[in] $listDns Array(string) Un tableau des DNs des groupes de l'utilisateur
*
* @retval boolean true si tout c'est bien passé, False sinon
**/
function updateUserGroups($object,$listDns) {
return $this -> updateObjectsInRelation($object,$listDns,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
}
/**
* Test si l'utilisateur peut d'editer la relation avec ce groupe
*
* @retval boolean true si tout l'utilisateur peut éditer la relation, False sinon
**/
function canEditGroupRelation($dn=NULL) {
if (!$dn) {
$dn=$this -> dn;
}
return LSsession :: canEdit($this -> type_name,$this -> dn,$this -> memberAttr);
}
}
?>

View File

@ -0,0 +1,6 @@
<?php
class cfdtUtilisateur extends LSldapObject {
}
?>