<para>La configuration des déclencheurs se fait dans la définition des
&LSattributes;. Par exemple, pour définir les fonctions à exécuter après la
modification de la valeur de l'attribut <emphasis>mail</emphasis> du type de
- &LSobject; <emphasis>LSeepeople</emphasis>, c'est à dire lors de leur évenement
+ &LSobject; <emphasis>LSpeople</emphasis>, c'est à dire lors de leur évenement
<literal>after_modify</literal>, il faut définir la variable suivante :
- <programlisting linenumbering="unnumbered"><![CDATA[$GLOBALS['LSobjects']['LSeepeople']['attrs']['mail']['after_modify']]]></programlisting>
+ <programlisting linenumbering="unnumbered"><![CDATA[$GLOBALS['LSobjects']['LSpeople']['attrs']['mail']['after_modify']]]></programlisting>
Cette variable peut contenir soit une chaine de caractères correspondant au
nom de la fonction à exécuter, soit un tableau de chaînes de caractères
correspondant aux noms des fonctions à exécuter.</para>
<title>Configuration</title>
<para>La configuration des déclencheurs se fait dans la définition des types
d'&LSobjects;. Par exemple, pour définir les fonctions à exécuter après la
- modification des LSobjects de type <emphasis>LSeepeople</emphasis>, c'est à
+ modification des LSobjects de type <emphasis>LSpeople</emphasis>, c'est à
dire lors de leur évènement <literal>after_modify</literal>, il faut définir
la variable suivante :
<programlisting linenumbering="unnumbered"><![CDATA[$GLOBALS['LSobjects']['[nom du type d'LSobject]']['after_modify']]]></programlisting>
<programlisting>class.LSobjects.[nom du type d'LSobject].php</programlisting>
Le plus simple pour cette étape est de recopier un des fichiers d'exemple et
de l'adapter en changeant le nom du type d'objet dans l'ensemble du fichier.
- Pour cela, le fichier de classe du type <emphasis>LSeepeople</emphasis> est
+ Pour cela, le fichier de classe du type <emphasis>LSpeople</emphasis> est
le plus simple car il ne contient que le strict minimum.</para></listitem>
<listitem><simpara>Configurer vos LSobject : Cette partie est certainement la
<listitem><simpara>Configurer si nécessaire les relations entre les objets
appelés &LSrelations;. Cette opération consiste dans un premier temps à écrire
les méthodes PHP nécessaires pour gérer ces relations : pour cela regardez le
- fichier de classe du type <emphasis>LSeegroup</emphasis>. Il faudra ensuite
+ fichier de classe du type <emphasis>LSgroup</emphasis>. Il faudra ensuite
déclarer ces relations dans la configuration des types d'LSobjects : Pour plus
de détails, reportez-vous à <link linkend="config-LSobject-LSrelation">la
section concernée</link>.</simpara>
class.LSobjects.[nom du type d'LSobject].php
- Le plus simple pour cette étape est de recopier un des fichiers d'exemple et de l'adapter en changeant le nom du type d'objet dans l'ensemble du fichier. Pour cela, le fichier de classe du type LSeepeople est le plus simple car il ne contient que le strict minimum.
+ Le plus simple pour cette étape est de recopier un des fichiers d'exemple et de l'adapter en changeant le nom du type d'objet dans l'ensemble du fichier. Pour cela, le fichier de classe du type LSpeople est le plus simple car il ne contient que le strict minimum.
2. Configurer vos LSobject : Cette partie est certainement la plus longue et consiste à déclarer l'ensemble des informations relatives aux types des objets LDAP manipulés. Les fichiers d'exemples fournis vous seront certainement d'une aide précieuse. Pour plus de détails, consulter la documentation du projet. [1]
- 3. Configurer si nécessaire les relations entre les objets appelés LSrelations. Cette opération consiste dans un premier temps à écrire les méthodes PHP nécessaires pour gérer ces relations : pour cela regardez le fichier de classe du type LSeegroup. Il faudra ensuite déclarer ces relations dans la configuration des types d'LSobjects : Pour plus de détails, consulter la documentation du projet. [1]
+ 3. Configurer si nécessaire les relations entre les objets appelés LSrelations. Cette opération consiste dans un premier temps à écrire les méthodes PHP nécessaires pour gérer ces relations : pour cela regardez le fichier de classe du type LSgroup. Il faudra ensuite déclarer ces relations dans la configuration des types d'LSobjects : Pour plus de détails, consulter la documentation du projet. [1]
4. Personnaliser l'interface : Il est possible de personnaliser à votre goût l'interface en écrivant votre template ou en modifiant simplement les fichiers CSS. Une partie de cette documentation concernera bientôt cette problématique. Patience...
--- /dev/null
+<?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.
+
+******************************************************************************/
+
+$GLOBALS['LSobjects']['LScompany'] = array (
+ 'objectclass' => array(
+ 'top',
+ 'lscompany'
+ ),
+ 'rdn' => 'ou',
+ 'orderby' => 'displayName', // possible cases : 'displayName' ou 'subDn'
+ 'container_dn' => 'ou=companies',
+ 'display_name_format' => '%{ou}',
+ 'label' => 'Companies',
+
+ 'attrs' => array (
+
+ /* ----------- start -----------*/
+ 'ou' => array (
+ 'label' => 'Name',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'check_data' => array (
+ 'alphanumeric' => NULL
+ ),
+ 'view' => 1,
+ 'rights' => array(
+ 'user' => 'r',
+ 'admin' => 'w'
+ ),
+ 'form' => array (
+ 'modify' => 0,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'description' => array (
+ 'label' => 'Description',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'textarea',
+ 'required' => 0,
+ 'rights' => array(
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'lsGodfatherDn' => array (
+ 'label' => 'Accountable(s)',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'select_object',
+ 'html_options' => array(
+ 'selectable_object' => array(
+ 'object_type' => 'LSpeople',
+ 'value_attribute' => '%{dn}'
+ )
+ ),
+ 'validation' => array (
+ array (
+ 'basedn' => '%{val}',
+ 'result' => 1,
+ 'msg' => "One or several of these users don't exist."
+ )
+ ),
+ 'multiple' => 1,
+ 'rights' => array(
+ 'admin' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ )
+ /* ----------- end -----------*/
+ )
+);
+?>
+++ /dev/null
-<?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.
-
-******************************************************************************/
-
-$GLOBALS['LSobjects']['LSeecompany'] = array (
- 'objectclass' => array(
- 'top',
- 'lscompany'
- ),
- 'rdn' => 'ou',
- 'orderby' => 'displayName', // possible cases : 'displayName' ou 'subDn'
- 'container_dn' => 'ou=companies',
- 'display_name_format' => '%{ou}',
- 'label' => 'Companies',
-
- 'attrs' => array (
-
- /* ----------- start -----------*/
- 'ou' => array (
- 'label' => 'Name',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'check_data' => array (
- 'alphanumeric' => NULL
- ),
- 'view' => 1,
- 'rights' => array(
- 'user' => 'r',
- 'admin' => 'w'
- ),
- 'form' => array (
- 'modify' => 0,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'description' => array (
- 'label' => 'Description',
- 'ldap_type' => 'ascii',
- 'html_type' => 'textarea',
- 'required' => 0,
- 'rights' => array(
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'lsGodfatherDn' => array (
- 'label' => 'Accountable(s)',
- 'ldap_type' => 'ascii',
- 'html_type' => 'select_object',
- 'html_options' => array(
- 'selectable_object' => array(
- 'object_type' => 'LSeepeople',
- 'value_attribute' => '%{dn}'
- )
- ),
- 'validation' => array (
- array (
- 'basedn' => '%{val}',
- 'result' => 1,
- 'msg' => "One or several of these users don't exist."
- )
- ),
- 'multiple' => 1,
- 'rights' => array(
- 'admin' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- )
- /* ----------- end -----------*/
- )
-);
-?>
+++ /dev/null
-<?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.
-
-******************************************************************************/
-
-$GLOBALS['LSobjects']['LSeegroup'] = array (
- 'objectclass' => array(
- 'lsgroup',
- 'posixGroup'
- ),
- 'rdn' => 'cn',
- 'orderby' => 'displayName', // Valeurs possibles : 'displayName' ou 'subDn'
- 'container_dn' => 'ou=groups',
- 'container_auto_create' => array(
- 'objectclass' => array(
- 'top',
- 'organizationalUnit'
- ),
- 'attrs' => array(
- 'ou' => 'groups'
- )
- ),
- 'display_name_format' => '%{cn}',
- 'label' => 'Groups',
- 'attrs' => array (
-
- /* ----------- start -----------*/
- 'cn' => array (
- 'label' => 'Name',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'check_data' => array (
- 'alphanumeric' => array(
- 'msg' => 'Name must contain alphanumeric values only.'
- ),
- ),
- 'validation' => array (
- array (
- 'filter' => 'cn=%{val}',
- 'result' => 0
- )
- ),
- 'view' => 1,
- 'rights' => array(
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'r'
- ),
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'gidNumber' => array (
- 'label' => 'Identifier',
- 'ldap_type' => 'numeric',
- 'html_type' => 'text',
- 'required' => 1,
- 'generate_function' => 'generate_gidNumber_withSambaDomainObject',
- 'validation' => array (
- array (
- 'filter' => 'gidNumber=%{val}',
- 'result' => 0
- )
- ),
- 'view' => 1,
- 'rights' => array(
- 'user' => 'r',
- 'admin' => 'w'
- ),
- 'form' => array (
- 'modify' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'uniqueMember' => array (
- 'label' => 'Members',
- 'ldap_type' => 'ascii',
- 'html_type' => 'select_object',
- 'html_options' => array(
- 'selectable_object' => array(
- 'object_type' => 'LSeepeople', // Nom de l'objet à lister
- 'display_name_format' => '%{cn} (%{uidNumber})', // 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',
- 'godfather' => 'w'
- ),
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'description' => array (
- 'label' => 'Description',
- 'ldap_type' => 'ascii',
- 'html_type' => 'textarea',
- 'multiple' => 1,
- 'rights' => array(
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'r'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'lsGodfatherDn' => array (
- 'label' => 'Accountable(s)',
- 'ldap_type' => 'ascii',
- 'html_type' => 'select_object',
- 'html_options' => array (
- 'selectable_object' => array(
- 'object_type' => 'LSeepeople',
- 'value_attribute' => 'dn'
- ),
- ),
- 'validation' => array (
- array (
- 'basedn' => '%{val}',
- 'result' => 1,
- 'msg' => "One or several of these users don't exist."
- )
- ),
- 'multiple' => 1,
- 'rights' => array(
- 'admin' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- )
-);
-?>
+++ /dev/null
-<?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.
-
-******************************************************************************/
-
-$GLOBALS['LSobjects']['LSeepeople'] = array (
- 'objectclass' => array(
- 'top',
- 'lspeople',
- 'posixAccount',
- 'sambaSamAccount',
- ),
- 'orderby' => 'displayName', // Valeurs possibles : 'displayName' ou 'subDn'
- 'rdn' => 'uid',
- 'container_dn' => 'ou=people',
-
- 'container_auto_create' => array(
- 'objectclass' => array(
- 'top',
- 'organizationalUnit'
- ),
- 'attrs' => array(
- 'ou' => 'people'
- )
- ),
-
- 'before_modify' => 'valid',
- 'after_modify' => 'valid',
- //'after_create' => 'createMaildirByFTP',
- //'after_delete' => 'removeMaildirByFTP',
- 'display_name_format' => '%{cn}',
- 'label' => 'Users',
-
- // LSrelation
- 'LSrelation' => array(
- 'groups' => array(
- 'label' => 'Belongs to groups ...',
- 'emptyText' => "Doesn't belong to any group.",
- 'LSobject' => 'LSeegroup',
- 'list_function' => 'listUserGroups',
- 'getkeyvalue_function' => 'getMemberKeyValue',
- 'update_function' => 'updateUserGroups',
- 'remove_function' => 'deleteOneMember',
- 'rename_function' => 'renameOneMember',
- 'rights' => array(
- 'self' => 'r',
- 'admin' => 'w'
- )
- )
- ),
-
- // LSform
- 'LSform' => array (
- 'ajaxSubmit' => 1,
- // Layout
- 'layout' => array (
- 'Civilite' => array(
- 'label' => 'Civility',
- 'img' => 1,
- 'args' => array (
- 'uid',
- 'personalTitle',
- 'givenName',
- 'sn',
- 'cn',
- 'mail',
- 'userPassword',
- 'description',
- 'jpegPhoto',
- 'lsGodfatherDn'
- )
- ),
- 'Posix' => array (
- 'label' => 'Posix',
- 'args' => array (
- 'uidNumber',
- 'gidNumber',
- 'loginShell',
- 'homeDirectory'
- )
- ),
- 'Samba' => array (
- 'label' => 'Samba',
- 'args' => array (
- 'sambaSID',
- 'sambaLMPassword',
- 'sambaNTPassword'
- )
- )
- ) // fin Layout
- ), // fin LSform
-
- 'LSsearch' => array (
- 'attrs' => array (
- 'givenName',
- 'sn',
- 'cn',
- 'uid',
- 'mail'
- ),
- 'recursive' => true
- ),
-
- // Attributes
- 'attrs' => array (
-
- /* ----------- start -----------*/
- 'uid' => array (
- 'label' => 'Identifier',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'html_options' => array(
- 'generate_value_format' => '%{givenName:1}.%{sn}',
- 'autoGenerateOnModify' => true, // default : false
- 'withoutAccent' => 1,
- 'replaceSpaces' => '.',
- 'lowerCase' => 1
- ),
- 'required' => 1,
- 'check_data' => array (
- 'regex' => array(
- 'msg' => "Identifier must contain alphanumeric values, dots (.) and dashes (-) only.",
- 'params' => array('regex' => '/^[a-zA-Z0-9-_\.]*$/')
- ),
- ),
- 'validation' => array (
- array (
- 'filter' => 'uid=%{val}',
- 'result' => 0,
- 'msg' => 'This identifier is already used.'
- )
- ),
- 'rights' => array(
- 'self' => 'r',
- 'admin' => 'w',
- 'godfather' => 'r'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- ),
- 'dependAttrs' => array(
- 'homeDirectory'
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'uidNumber' => array (
- 'label' => 'Numeric identifier',
- 'ldap_type' => 'numeric',
- 'html_type' => 'text',
- 'required' => 1,
- 'generate_function' => 'generate_uidNumber_withSambaDomainObject',
- 'check_data' => array (
- 'numeric' => array(
- 'msg' => "The numeric identifier must be an integer."
- ),
- ),
- 'validation' => array (
- array (
- 'filter' => 'uidNumber=%{val}',
- 'result' => 0,
- 'msg' => 'This uid is already used.'
- )
- ),
- 'rights' => array(
- 'admin' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 0,
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'givenName' => array (
- 'label' => 'First Name',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'default_value' => 'toto',
- 'check_data' => array (
- 'alphanumeric' => array(
- 'msg' => 'The first name must contain alphanumeric values only.'
- ),
- ),
- 'rights' => array(
- 'self' => 'r',
- 'users' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- ),
- 'onDisplay' => 'return_data'
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'sn' => array (
- 'label' => 'Last Name',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'rights' => array(
- 'self' => 'r',
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'cn' => array (
- 'label' => 'Full Name',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'html_options' => array(
- 'generate_value_format' => '%{givenName} %{sn}',
- 'autoGenerateOnModify' => true, // default : false
- 'autoGenerateOnCreate' => true // default : false
- ),
- 'required' => 1,
- 'validation' => 'valid',
- 'rights' => array(
- 'self' => 'r',
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'gidNumber' => array (
- 'label' => 'Main group',
- 'ldap_type' => 'numeric',
- 'html_type' => 'select_list',
- 'html_options' => array (
- 'possible_values' => array(
- 'OTHER_OBJECT' => array(
- 'object_type' => 'LSeegroup', // Nom de l'objet à lister
- 'display_name_format' => '%{cn} (%{gidNumber})', // 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' => 'gidNumber', // Spécifie le attributs dont la valeur sera retournée par
- /*'filter' => // le formulaire spécifie les filtres de recherche pour
- array ( // l'établissement de la liste d'objets :
- array( // Premier filtre
- 'filter' => 'cn=*a*',
- //'basedn' => 'o=company',
- 'scope' => 'sub',
- )
- )*/
- )
- )
- ),
- 'multiple' => false,
- 'required' => 1,
- 'validation' => array (
- array (
- 'msg' => "This group doesn't exist.",
- 'object_type' => 'LSeegroup', // 'object_type' : Permet definir le type d'objet recherchés
- //'basedn' => 'o=company', // et d'utiliser les objectClass définis dans le fichier de configuration
- 'filter' => '(gidNumber=%{val})', // pour la recherche
- 'result' => 1
- )
- ),
- 'rights' => array(
- 'admin' => 'w',
- 'godfather' => 'r'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'loginShell' => array (
- 'label' => 'Command shell',
- 'help_info' => "Allow user to connect a POSIX system.",
- 'ldap_type' => 'boolean',
- 'ldap_options' => array (
- 'true_value' => '/bin/bash',
- 'false_value' => '/bin/false'
- ),
- 'html_type' => 'boolean',
- 'required' => 1,
- 'default_value' => 'no',
- 'rights' => array(
- 'admin' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'sambaSID' => array (
- 'label' => 'Samba Identifier',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'generate_function' => 'generate_sambaUserSID',
- 'rights' => array(
- 'admin' => 'r'
- ),
- 'form' => array (
- 'modify' => 0
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'homeDirectory' => array (
- 'label' => 'Home Directory',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'generate_function' => 'generate_homeDirectory',
- 'rights' => array(
- 'admin' => 'r'
- ),
- 'view' => 1
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'mail' => array (
- 'label' => 'E-mail address',
- 'ldap_type' => 'ascii',
- 'html_type' => 'mail',
- 'html_options' => array(
- 'generate_value_format' => '%{givenName}.%{sn}@ls.com',
- 'withoutAccent' => 1,
- 'replaceSpaces' => '.',
- 'lowerCase' => 1
- ),
- 'required' => 1,
- 'check_data' => array (
- 'email' => array(
- 'msg' => "Given email address is invalid.",
- 'params' => array('checkDomain' => false)
- ),
- ),
- 'rights' => array(
- 'self' => 'r',
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'personalTitle' => array (
- 'label' => 'Civility',
- 'ldap_type' => 'ascii',
- 'html_type' => 'select_list',
- 'html_options' => array (
- 'possible_values' => array(
- 'M.' => 'M.',
- 'Mme' => 'Mme',
- 'Mlle' => 'Mlle'
- )
- ),
- 'required' => 1,
- 'default_value' => 'M.',
- 'rights' => array(
- 'self' => 'r',
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'description' => array (
- 'label' => 'Description',
- 'ldap_type' => 'ascii',
- 'html_type' => 'textarea',
- 'multiple' => 1,
- 'rights' => array(
- 'self' => 'r',
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'userPassword' => array (
- 'label' => 'Password',
- 'ldap_type' => 'password',
- 'ldap_options' => array (
- 'encode' => 'md5'
- ),
- 'html_type' => 'password',
- 'html_options' => array(
- 'generationTool' => true,
- 'autoGenerate' => false,
- 'lenght' => 8,
- 'chars' => array (
- array(
- 'nb' => 3,
- 'chars' => 'abcdefijklmnopqrstuvwxyz'
- ),
- '0123456789',
- '*$.:/_-[]{}=~'
- ),
- 'mail' => array(
- 'send' => 1,
- 'ask' => 1,
- 'subject' => "LSexample : Your new credentials.",
- 'msg' => "Your password has been changed.\nNew password : %{mdp}",
- 'mail_attr' => 'mail'
- )
- ),
- 'check_data' => array(
- 'password' => array(
- 'msg' => 'Your password must contain from 8 to 10 characters.',
- 'params' => array(
- 'minLength' => 8,
- 'maxLength' => 10
- )
- )
- ),
- 'required' => 1,
- 'rights' => array(
- 'self' => 'w',
- 'admin' => 'w'
- ),
- 'dependAttrs' => array(
- 'sambaLMPassword',
- 'sambaNTPassword'
- ),
- 'form' => array (
- 'modify' => 1,
- 'create' => 1,
- 'lostPassword' => 1
- ),
- 'after_modify' => 'valid'
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'lsRecoveryHash' => array (
- 'label' => 'Password recovery hash',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 0,
- 'form' => array (
- 'lostPassword' => 1
- ),
- 'rights' => array(
- 'self' => 'w',
- 'admin' => 'w'
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'sambaLMPassword' => array (
- 'label' => 'Samba Password (LM)',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'generate_function' => 'generate_sambaLMPassword',
- 'form' => array (
- 'modify' => 0
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'sambaNTPassword' => array (
- 'label' => 'Samba Password (NT)',
- 'ldap_type' => 'ascii',
- 'html_type' => 'text',
- 'required' => 1,
- 'generate_function' => 'generate_sambaNTPassword',
- 'form' => array (
- 'modify' => 0
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'jpegPhoto' => array (
- 'label' => 'Picture',
- 'ldap_type' => 'image',
- 'html_type' => 'image',
- 'required' => 0,
- 'view' => 1,
- 'check_data' => array (
- 'imagesize' => array(
- 'msg' => "Picture size is not valid.",
- 'params' => array(
- 'maxWidth' => 2000
- )
- ),
- 'filesize' => array(
- 'msg' => "File size is not valid.",
- 'params' => array(
- 'maxSize' => 3000000 // taille du fichier en octets
- )
- ),
- 'imagefile' => array(
- 'msg' => "File type is not valid."
- )
- ),
- 'form' => array (
- 'modify' => 1
- ),
- 'rights' => array(
- 'self' => 'w',
- 'user' => 'r',
- 'admin' => 'w',
- 'godfather' => 'w'
- )
- ),
- /* ----------- end -----------*/
-
- /* ----------- start -----------*/
- 'lsGodfatherDn' => array (
- 'label' => 'Accountable(s)',
- 'ldap_type' => 'ascii',
- 'html_type' => 'select_object',
- 'html_options' => array (
- 'selectable_object' => array(
- 'object_type' => 'LSeepeople',
- 'value_attribute' => '%{dn}'
- ),
- ),
- 'validation' => array (
- array (
- 'basedn' => '%{val}',
- 'result' => 1,
- 'msg' => "One or several users don't exist."
- )
- ),
- 'multiple' => 1,
- 'rights' => array(
- 'admin' => 'w'
- ),
- 'view' => 1,
- 'form' => array (
- 'modify' => 1,
- 'create' => 1
- )
- ),
- /* ----------- end -----------*/
-
- ) // Fin args
-);
-?>
--- /dev/null
+<?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.
+
+******************************************************************************/
+
+$GLOBALS['LSobjects']['LSgroup'] = array (
+ 'objectclass' => array(
+ 'lsgroup',
+ 'posixGroup'
+ ),
+ 'rdn' => 'cn',
+ 'orderby' => 'displayName', // Valeurs possibles : 'displayName' ou 'subDn'
+ 'container_dn' => 'ou=groups',
+ 'container_auto_create' => array(
+ 'objectclass' => array(
+ 'top',
+ 'organizationalUnit'
+ ),
+ 'attrs' => array(
+ 'ou' => 'groups'
+ )
+ ),
+ 'display_name_format' => '%{cn}',
+ 'label' => 'Groups',
+ 'attrs' => array (
+
+ /* ----------- start -----------*/
+ 'cn' => array (
+ 'label' => 'Name',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'check_data' => array (
+ 'alphanumeric' => array(
+ 'msg' => 'Name must contain alphanumeric values only.'
+ ),
+ ),
+ 'validation' => array (
+ array (
+ 'filter' => 'cn=%{val}',
+ 'result' => 0
+ )
+ ),
+ 'view' => 1,
+ 'rights' => array(
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'r'
+ ),
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'gidNumber' => array (
+ 'label' => 'Identifier',
+ 'ldap_type' => 'numeric',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'generate_function' => 'generate_gidNumber_withSambaDomainObject',
+ 'validation' => array (
+ array (
+ 'filter' => 'gidNumber=%{val}',
+ 'result' => 0
+ )
+ ),
+ 'view' => 1,
+ 'rights' => array(
+ 'user' => 'r',
+ 'admin' => 'w'
+ ),
+ 'form' => array (
+ 'modify' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'uniqueMember' => array (
+ 'label' => 'Members',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'select_object',
+ 'html_options' => array(
+ 'selectable_object' => array(
+ 'object_type' => 'LSpeople', // Nom de l'objet à lister
+ 'display_name_format' => '%{cn} (%{uidNumber})', // 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',
+ 'godfather' => 'w'
+ ),
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'description' => array (
+ 'label' => 'Description',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'textarea',
+ 'multiple' => 1,
+ 'rights' => array(
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'r'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'lsGodfatherDn' => array (
+ 'label' => 'Accountable(s)',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'select_object',
+ 'html_options' => array (
+ 'selectable_object' => array(
+ 'object_type' => 'LSpeople',
+ 'value_attribute' => 'dn'
+ ),
+ ),
+ 'validation' => array (
+ array (
+ 'basedn' => '%{val}',
+ 'result' => 1,
+ 'msg' => "One or several of these users don't exist."
+ )
+ ),
+ 'multiple' => 1,
+ 'rights' => array(
+ 'admin' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ )
+);
+?>
--- /dev/null
+<?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.
+
+******************************************************************************/
+
+$GLOBALS['LSobjects']['LSpeople'] = array (
+ 'objectclass' => array(
+ 'top',
+ 'lspeople',
+ 'posixAccount',
+ 'sambaSamAccount',
+ ),
+ 'orderby' => 'displayName', // Valeurs possibles : 'displayName' ou 'subDn'
+ 'rdn' => 'uid',
+ 'container_dn' => 'ou=people',
+
+ 'container_auto_create' => array(
+ 'objectclass' => array(
+ 'top',
+ 'organizationalUnit'
+ ),
+ 'attrs' => array(
+ 'ou' => 'people'
+ )
+ ),
+
+ 'before_modify' => 'valid',
+ 'after_modify' => 'valid',
+ //'after_create' => 'createMaildirByFTP',
+ //'after_delete' => 'removeMaildirByFTP',
+ 'display_name_format' => '%{cn}',
+ 'label' => 'Users',
+
+ // LSrelation
+ 'LSrelation' => array(
+ 'groups' => array(
+ 'label' => 'Belongs to groups ...',
+ 'emptyText' => "Doesn't belong to any group.",
+ 'LSobject' => 'LSgroup',
+ 'list_function' => 'listUserGroups',
+ 'getkeyvalue_function' => 'getMemberKeyValue',
+ 'update_function' => 'updateUserGroups',
+ 'remove_function' => 'deleteOneMember',
+ 'rename_function' => 'renameOneMember',
+ 'rights' => array(
+ 'self' => 'r',
+ 'admin' => 'w'
+ )
+ )
+ ),
+
+ // LSform
+ 'LSform' => array (
+ 'ajaxSubmit' => 1,
+ // Layout
+ 'layout' => array (
+ 'Civilite' => array(
+ 'label' => 'Civility',
+ 'img' => 1,
+ 'args' => array (
+ 'uid',
+ 'personalTitle',
+ 'givenName',
+ 'sn',
+ 'cn',
+ 'mail',
+ 'userPassword',
+ 'description',
+ 'jpegPhoto',
+ 'lsGodfatherDn'
+ )
+ ),
+ 'Posix' => array (
+ 'label' => 'Posix',
+ 'args' => array (
+ 'uidNumber',
+ 'gidNumber',
+ 'loginShell',
+ 'homeDirectory'
+ )
+ ),
+ 'Samba' => array (
+ 'label' => 'Samba',
+ 'args' => array (
+ 'sambaSID',
+ 'sambaLMPassword',
+ 'sambaNTPassword'
+ )
+ )
+ ) // fin Layout
+ ), // fin LSform
+
+ 'LSsearch' => array (
+ 'attrs' => array (
+ 'givenName',
+ 'sn',
+ 'cn',
+ 'uid',
+ 'mail'
+ ),
+ 'recursive' => true
+ ),
+
+ // Attributes
+ 'attrs' => array (
+
+ /* ----------- start -----------*/
+ 'uid' => array (
+ 'label' => 'Identifier',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'html_options' => array(
+ 'generate_value_format' => '%{givenName:1}.%{sn}',
+ 'autoGenerateOnModify' => true, // default : false
+ 'withoutAccent' => 1,
+ 'replaceSpaces' => '.',
+ 'lowerCase' => 1
+ ),
+ 'required' => 1,
+ 'check_data' => array (
+ 'regex' => array(
+ 'msg' => "Identifier must contain alphanumeric values, dots (.) and dashes (-) only.",
+ 'params' => array('regex' => '/^[a-zA-Z0-9-_\.]*$/')
+ ),
+ ),
+ 'validation' => array (
+ array (
+ 'filter' => 'uid=%{val}',
+ 'result' => 0,
+ 'msg' => 'This identifier is already used.'
+ )
+ ),
+ 'rights' => array(
+ 'self' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'r'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ ),
+ 'dependAttrs' => array(
+ 'homeDirectory'
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'uidNumber' => array (
+ 'label' => 'Numeric identifier',
+ 'ldap_type' => 'numeric',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'generate_function' => 'generate_uidNumber_withSambaDomainObject',
+ 'check_data' => array (
+ 'numeric' => array(
+ 'msg' => "The numeric identifier must be an integer."
+ ),
+ ),
+ 'validation' => array (
+ array (
+ 'filter' => 'uidNumber=%{val}',
+ 'result' => 0,
+ 'msg' => 'This uid is already used.'
+ )
+ ),
+ 'rights' => array(
+ 'admin' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 0,
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'givenName' => array (
+ 'label' => 'First Name',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'default_value' => 'toto',
+ 'check_data' => array (
+ 'alphanumeric' => array(
+ 'msg' => 'The first name must contain alphanumeric values only.'
+ ),
+ ),
+ 'rights' => array(
+ 'self' => 'r',
+ 'users' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ ),
+ 'onDisplay' => 'return_data'
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'sn' => array (
+ 'label' => 'Last Name',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'rights' => array(
+ 'self' => 'r',
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'cn' => array (
+ 'label' => 'Full Name',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'html_options' => array(
+ 'generate_value_format' => '%{givenName} %{sn}',
+ 'autoGenerateOnModify' => true, // default : false
+ 'autoGenerateOnCreate' => true // default : false
+ ),
+ 'required' => 1,
+ 'validation' => 'valid',
+ 'rights' => array(
+ 'self' => 'r',
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'gidNumber' => array (
+ 'label' => 'Main group',
+ 'ldap_type' => 'numeric',
+ 'html_type' => 'select_list',
+ 'html_options' => array (
+ 'possible_values' => array(
+ 'OTHER_OBJECT' => array(
+ 'object_type' => 'LSgroup', // Nom de l'objet à lister
+ 'display_name_format' => '%{cn} (%{gidNumber})', // 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' => 'gidNumber', // Spécifie le attributs dont la valeur sera retournée par
+ /*'filter' => // le formulaire spécifie les filtres de recherche pour
+ array ( // l'établissement de la liste d'objets :
+ array( // Premier filtre
+ 'filter' => 'cn=*a*',
+ //'basedn' => 'o=company',
+ 'scope' => 'sub',
+ )
+ )*/
+ )
+ )
+ ),
+ 'multiple' => false,
+ 'required' => 1,
+ 'validation' => array (
+ array (
+ 'msg' => "This group doesn't exist.",
+ 'object_type' => 'LSgroup', // 'object_type' : Permet definir le type d'objet recherchés
+ //'basedn' => 'o=company', // et d'utiliser les objectClass définis dans le fichier de configuration
+ 'filter' => '(gidNumber=%{val})', // pour la recherche
+ 'result' => 1
+ )
+ ),
+ 'rights' => array(
+ 'admin' => 'w',
+ 'godfather' => 'r'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'loginShell' => array (
+ 'label' => 'Command shell',
+ 'help_info' => "Allow user to connect a POSIX system.",
+ 'ldap_type' => 'boolean',
+ 'ldap_options' => array (
+ 'true_value' => '/bin/bash',
+ 'false_value' => '/bin/false'
+ ),
+ 'html_type' => 'boolean',
+ 'required' => 1,
+ 'default_value' => 'no',
+ 'rights' => array(
+ 'admin' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'sambaSID' => array (
+ 'label' => 'Samba Identifier',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'generate_function' => 'generate_sambaUserSID',
+ 'rights' => array(
+ 'admin' => 'r'
+ ),
+ 'form' => array (
+ 'modify' => 0
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'homeDirectory' => array (
+ 'label' => 'Home Directory',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'generate_function' => 'generate_homeDirectory',
+ 'rights' => array(
+ 'admin' => 'r'
+ ),
+ 'view' => 1
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'mail' => array (
+ 'label' => 'E-mail address',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'mail',
+ 'html_options' => array(
+ 'generate_value_format' => '%{givenName}.%{sn}@ls.com',
+ 'withoutAccent' => 1,
+ 'replaceSpaces' => '.',
+ 'lowerCase' => 1
+ ),
+ 'required' => 1,
+ 'check_data' => array (
+ 'email' => array(
+ 'msg' => "Given email address is invalid.",
+ 'params' => array('checkDomain' => false)
+ ),
+ ),
+ 'rights' => array(
+ 'self' => 'r',
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'personalTitle' => array (
+ 'label' => 'Civility',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'select_list',
+ 'html_options' => array (
+ 'possible_values' => array(
+ 'M.' => 'M.',
+ 'Mme' => 'Mme',
+ 'Mlle' => 'Mlle'
+ )
+ ),
+ 'required' => 1,
+ 'default_value' => 'M.',
+ 'rights' => array(
+ 'self' => 'r',
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'description' => array (
+ 'label' => 'Description',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'textarea',
+ 'multiple' => 1,
+ 'rights' => array(
+ 'self' => 'r',
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'userPassword' => array (
+ 'label' => 'Password',
+ 'ldap_type' => 'password',
+ 'ldap_options' => array (
+ 'encode' => 'md5'
+ ),
+ 'html_type' => 'password',
+ 'html_options' => array(
+ 'generationTool' => true,
+ 'autoGenerate' => false,
+ 'lenght' => 8,
+ 'chars' => array (
+ array(
+ 'nb' => 3,
+ 'chars' => 'abcdefijklmnopqrstuvwxyz'
+ ),
+ '0123456789',
+ '*$.:/_-[]{}=~'
+ ),
+ 'mail' => array(
+ 'send' => 1,
+ 'ask' => 1,
+ 'subject' => "LSexample : Your new credentials.",
+ 'msg' => "Your password has been changed.\nNew password : %{mdp}",
+ 'mail_attr' => 'mail'
+ )
+ ),
+ 'check_data' => array(
+ 'password' => array(
+ 'msg' => 'Your password must contain from 8 to 10 characters.',
+ 'params' => array(
+ 'minLength' => 8,
+ 'maxLength' => 10
+ )
+ )
+ ),
+ 'required' => 1,
+ 'rights' => array(
+ 'self' => 'w',
+ 'admin' => 'w'
+ ),
+ 'dependAttrs' => array(
+ 'sambaLMPassword',
+ 'sambaNTPassword'
+ ),
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1,
+ 'lostPassword' => 1
+ ),
+ 'after_modify' => 'valid'
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'lsRecoveryHash' => array (
+ 'label' => 'Password recovery hash',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 0,
+ 'form' => array (
+ 'lostPassword' => 1
+ ),
+ 'rights' => array(
+ 'self' => 'w',
+ 'admin' => 'w'
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'sambaLMPassword' => array (
+ 'label' => 'Samba Password (LM)',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'generate_function' => 'generate_sambaLMPassword',
+ 'form' => array (
+ 'modify' => 0
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'sambaNTPassword' => array (
+ 'label' => 'Samba Password (NT)',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'text',
+ 'required' => 1,
+ 'generate_function' => 'generate_sambaNTPassword',
+ 'form' => array (
+ 'modify' => 0
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'jpegPhoto' => array (
+ 'label' => 'Picture',
+ 'ldap_type' => 'image',
+ 'html_type' => 'image',
+ 'required' => 0,
+ 'view' => 1,
+ 'check_data' => array (
+ 'imagesize' => array(
+ 'msg' => "Picture size is not valid.",
+ 'params' => array(
+ 'maxWidth' => 2000
+ )
+ ),
+ 'filesize' => array(
+ 'msg' => "File size is not valid.",
+ 'params' => array(
+ 'maxSize' => 3000000 // taille du fichier en octets
+ )
+ ),
+ 'imagefile' => array(
+ 'msg' => "File type is not valid."
+ )
+ ),
+ 'form' => array (
+ 'modify' => 1
+ ),
+ 'rights' => array(
+ 'self' => 'w',
+ 'user' => 'r',
+ 'admin' => 'w',
+ 'godfather' => 'w'
+ )
+ ),
+ /* ----------- end -----------*/
+
+ /* ----------- start -----------*/
+ 'lsGodfatherDn' => array (
+ 'label' => 'Accountable(s)',
+ 'ldap_type' => 'ascii',
+ 'html_type' => 'select_object',
+ 'html_options' => array (
+ 'selectable_object' => array(
+ 'object_type' => 'LSpeople',
+ 'value_attribute' => '%{dn}'
+ ),
+ ),
+ 'validation' => array (
+ array (
+ 'basedn' => '%{val}',
+ 'result' => 1,
+ 'msg' => "One or several users don't exist."
+ )
+ ),
+ 'multiple' => 1,
+ 'rights' => array(
+ 'admin' => 'w'
+ ),
+ 'view' => 1,
+ 'form' => array (
+ 'modify' => 1,
+ 'create' => 1
+ )
+ ),
+ /* ----------- end -----------*/
+
+ ) // Fin args
+);
+?>
'ou=people,o=ls' => array (
'cn=adminldap,ou=groups,o=ls' => array (
'attr' => 'uniqueMember',
- 'LSobject' => 'LSeegroup'
+ 'LSobject' => 'LSgroup'
)
)
),
'godfather' => array (
'LSobjects' => array (
- 'LSeepeople' => array (
+ 'LSpeople' => array (
'attr' => 'lsGodfatherDn',
'attr_value' => '%{dn}',
'basedn' => 'ou=people,o=ls'
),
- 'LSeegroup' => array (
+ 'LSgroup' => array (
'filter' => 'lsGodfatherDn=%{dn}'
)
)
),
'cacheLSprofiles' => true,
'cacheSearch' => true,
- 'authObjectType' => 'LSeepeople',
+ 'authObjectType' => 'LSpeople',
'authObjectFilter' => '(|(uid=%{user})(mail=%{user}))',
'authObjectTypeAttrPwd' => 'userPassword',
'LSaccess' => array(
- 'LSeepeople',
- 'LSeegroup'
+ 'LSpeople',
+ 'LSgroup'
),
'recoverPassword' => array(
'mailAttr' => 'mail',
'uid=eeggs,ou=people,o=ls' => NULL,
'cn=adminldap,ou=groups,o=ls' => array (
'attr' => 'uniqueMember',
- 'LSobject' => 'LSeegroup'
+ 'LSobject' => 'LSgroup'
)
)
)
),
- 'authObjectType' => 'LSeepeople',
+ 'authObjectType' => 'LSpeople',
'subDnLabel' => 'Company',
'subDn' => array(
'== All ==' => array(
'dn' => 'o=ls',
'LSobjects' => array(
- 'LSeepeople',
- 'LSeegroup',
- 'LSeecompany'
+ 'LSpeople',
+ 'LSgroup',
+ 'LScompany'
)
),
'LSobject' => array(
- 'LSeecompany' => array(
+ 'LScompany' => array(
'LSobjects' => array(
- 'LSeepeople',
- 'LSeegroup'
+ 'LSpeople',
+ 'LSgroup'
)
)
)
--- /dev/null
+<?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.
+
+******************************************************************************/
+
+/**
+ * Objet Ldap company
+ *
+ * @author Benjamin Renard <brenard@easter-eggs.com>
+ */
+class LScompany extends LSldapObject {
+ // ~
+}
+
+?>
+++ /dev/null
-<?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.
-
-******************************************************************************/
-
-/**
- * Objet Ldap eecompany
- *
- * @author Benjamin Renard <brenard@easter-eggs.com>
- */
-class LSeecompany extends LSldapObject {
- // ~
-}
-
-?>
+++ /dev/null
-<?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.
-
-******************************************************************************/
-
-/**
- * Objet Ldap eegroup
- *
- * @author Benjamin Renard <brenard@easter-eggs.com>
- */
-class LSeegroup extends LSldapObject {
-
- var $userObjectType = 'LSeepeople';
- var $memberAttr = 'uniqueMember';
-
- /* ========== 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 LSeegroup correspondant aux groupes
- * auxquels appartient un utilisateur
- *
- * @param[in] $userObject Un object user (type : $this -> userObjectType)
- *
- * @retval Array of LSeegroup Les groupes de l'utilisateur
- **/
- function listUserGroups($userObject) {
- return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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);
- }
-}
-
-?>
+++ /dev/null
-<?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.
-
-******************************************************************************/
-
-/**
- * Objet Ldap eepeople
- *
- * @author Benjamin Renard <brenard@easter-eggs.com>
- */
-class LSeepeople extends LSldapObject {
- // ~
-}
-
-?>
--- /dev/null
+<?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.
+
+******************************************************************************/
+
+/**
+ * Objet Ldap group
+ *
+ * @author Benjamin Renard <brenard@easter-eggs.com>
+ */
+class LSgroup extends LSldapObject {
+
+ var $userObjectType = 'LSpeople';
+ var $memberAttr = 'uniqueMember';
+
+ /* ========== 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 LSgroup correspondant aux groupes
+ * auxquels appartient un utilisateur
+ *
+ * @param[in] $userObject Un object user (type : $this -> userObjectType)
+ *
+ * @retval Array of LSgroup Les groupes de l'utilisateur
+ **/
+ function listUserGroups($userObject) {
+ return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * 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);
+ }
+}
+
+?>
--- /dev/null
+<?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.
+
+******************************************************************************/
+
+/**
+ * Objet Ldap people
+ *
+ * @author Benjamin Renard <brenard@easter-eggs.com>
+ */
+class LSpeople extends LSldapObject {
+ // ~
+}
+
+?>
/**
* Chargement d'une classe d'LdapSaisie
*
- * @param[in] $class Nom de la classe à charger (Exemple : LSeepeople)
+ * @param[in] $class Nom de la classe à charger (Exemple : LSpeople)
* @param[in] $type (Optionnel) Type de classe à charger (Exemple : LSobjects)
*
* @author Benjamin Renard <brenard@easter-eggs.com