diff --git a/doc/conf/LSobject/ioFormat.docbook b/doc/conf/LSobject/ioFormat.docbook index 6482b7a5..f85a0bf6 100644 --- a/doc/conf/LSobject/ioFormat.docbook +++ b/doc/conf/LSobject/ioFormat.docbook @@ -43,7 +43,9 @@ création du type d'&LSobject;. En conséquence : return array([...]); }, [...] - ) + ), + 'before_import' => array('function1', 'function2'), + 'after_import' => 'function3', ), [...] );]]> @@ -100,6 +102,24 @@ création du type d'&LSobject;. En conséquence : + + before_import + + Chaîne de caractères (ou tableau de chaîne de caractères) correspondant + au nom d'une ou plusieurs fonctions qui seront exécutées avant chaque import. + Voir la section concernée + + + + + after_import + + Chaîne de caractères (ou tableau de chaîne de caractères) correspondant + au nom d'une ou plusieurs fonctions qui seront exécutées après chaque import. + Voir la section concernée + + + @@ -187,4 +207,125 @@ création du type d'&LSobject;. En conséquence : + + Déclencheurs + Cette section décrit la manière de paramétrer des déclencheurs afin que + &LdapSaisie; exécute durant ses processus, et à des moments bien précis des + traitements d'un &ioFormat;, des fonctions que vous pourrez développer vous + même. De plus, le résultat de l'exécution de vos fonctions pourra influer + sur le déroulement des processus. + + Actuellement, les évenements suivant sont gérés : + + + + + + Nom + Description + Bloquant + + + + + before_import + Avant l'import. + Oui + + + after_import + Après l'import'. + Non + + + + +Si un événement est dit bloquant, lors de +l'exécution des actions liées, si une des fonctions retourne false +, le processus s'arrêtera. + + + Configuration + La configuration des déclencheurs se fait dans la définition des types + d'&ioFormat;. Par exemple, pour définir les fonctions à exécuter après + l'import des LSobjects de type LSpeople avec son LSioFormat + mycsv, c'est à dire lors de leur évènement after_import, il faut + définir la variable suivante : + + 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. Il est également possible de mettre ici directement + des fonctions anonymes. + + + + Ecriture d'une fonction + Une fonction exécutée par un déclencheur d'un ioFormat se déclare de la + manière suivante : + +Cette fonction doit accepter deux paramètres, le LSioFormat sur lequel l'évènement survient et un +tableau des données contextuelles de l'évènement. Elle doit par ailleurs retourner +True si tout s'est bien passé ou False en cas de problème. +Dans le cas d'un événement bloquant, si la fonction retourne False, le processus +est arrêté. + +Les données contextuelles de l'évènement, passées en paramètre, pourront dépendre du contexte +et de l'évènement déclencheur, mais pour les moments, il s'agit toujours d'un tableau telque décrit +ci-dessous : + "[/path/of/import.file]", + 'updateIfExists' => [boolean], + 'justTry' => [boolean], + 'objectsData' => array( + [Données des objets chargés depuis le fichier d'import] + ), + 'return' => array( + 'success' => [boolean], + 'LSobject' => "[nom du type d'LSobject]", + 'ioFormat' => "[nom du type d'ioFormat]", + 'updateIfExists' => [boolean], + 'justTry' => [boolean], + 'imported' => array([objets importés]), + 'updated' => array([objets mis à jour]), + 'errors' => array( + array( + 'data' => [données de l'objet importé ayant déclenché l'erreur], + 'errors' => array ( + 'globals' => array("Erreur 1", [...]), + 'attrs' => array( + 'attr1' => array("Erreur 1", [...]), + [...] + ), + ), + ), + [...] + ), + ), +)]]> +Les clés objectsData et return sont des références. +En cas de modification, cela influencera respectivement sur les données utilisées pour l'import et +sur le résultat de l'import tel qu'affiché dans l'interface. + + + + + diff --git a/src/conf/LSobjects/config.LSobjects.LSpeople.php b/src/conf/LSobjects/config.LSobjects.LSpeople.php index b1f2e085..ee734333 100644 --- a/src/conf/LSobjects/config.LSobjects.LSpeople.php +++ b/src/conf/LSobjects/config.LSobjects.LSpeople.php @@ -85,6 +85,16 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( return array(strval(LS_SAMBA_INFINITY_TIME)); }, ), + 'before_import' => function(&$ioFormat, &$data) { + LSsession::addInfo(htmlentities("$ioFormat: Before import test")); + return true; + }, + 'after_import' => array( + function(&$ioFormat, &$data) { + LSsession::addInfo(htmlentities("$ioFormat: After import test")); + return true; + }, + ), ), 'myfullcsv' => array ( 'label' => 'Complete CSV', diff --git a/src/includes/class/class.LSio.php b/src/includes/class/class.LSio.php index 8b6f48ef..645cd3d6 100644 --- a/src/includes/class/class.LSio.php +++ b/src/includes/class/class.LSio.php @@ -231,6 +231,23 @@ class LSio extends LSlog_staticLoggerClass { // with a minimum of 30 seconds set_time_limit((count($objectsData)>30?count($objectsData):30)); + // Trigger before_import event + if ( + !$ioFormat -> fireEvent( + 'before_import', + array( + 'input_file' => $input_file, + 'updateIfExists' => $updateIfExists, + 'justTry' => $justTry, + 'objectsData' => &$objectsData, + 'return' => &$return, + ) + ) + ) { + LSerror :: addErrorCode('LSio_08'); + return $return; + } + // Browse inputed objects foreach($objectsData as $objData) { $globalErrors = array(); @@ -332,6 +349,22 @@ class LSio extends LSlog_staticLoggerClass { } $return['errors'] = $objectsInError; $return['success'] = empty($objectsInError); + + // Trigger after_import event + if ( + !$ioFormat -> fireEvent( + 'after_import', + array( + 'input_file' => $input_file, + 'updateIfExists' => $updateIfExists, + 'justTry' => $justTry, + 'objectsData' => &$objectsData, + 'return' => &$return, + ) + ) + ) + LSerror :: addErrorCode('LSio_09'); + return $return; } @@ -708,6 +741,12 @@ ___("LSio: Fail to load objects's data to export from LDAP directory.") LSerror :: defineError('LSio_07', ___("LSio: Fail to export objects's data.") ); +LSerror :: defineError('LSio_08', +___("LSio: An error occured running before import hooks. Stop the import.") +); +LSerror :: defineError('LSio_09', +___("LSio: An error occured running after import hooks.") +); // Defined CLI commands functions only on CLI context if (php_sapi_name() != 'cli') diff --git a/src/includes/class/class.LSioFormat.php b/src/includes/class/class.LSioFormat.php index 8fd0baaa..b64200a9 100644 --- a/src/includes/class/class.LSioFormat.php +++ b/src/includes/class/class.LSioFormat.php @@ -29,6 +29,18 @@ LSsession :: loadLSclass('LSlog_staticLoggerClass'); */ class LSioFormat extends LSlog_staticLoggerClass { + /** + * LSobject type name + * @var string + */ + var $LSobject; + + /** + * ioFormat name + * @var string + */ + var $name; + /** * Configuration of the IOformat * (LSobjects..ioFormat.) @@ -56,6 +68,8 @@ class LSioFormat extends LSlog_staticLoggerClass { * @return void **/ public function __construct($LSobject, $ioFormat) { + $this -> LSobject = $LSobject; + $this -> name = $ioFormat; $conf = LSconfig::get('LSobjects.'.$LSobject.".ioFormat.".$ioFormat); if(is_array($conf)) { $this -> config = $conf; @@ -165,6 +179,45 @@ class LSioFormat extends LSlog_staticLoggerClass { return $this -> driver -> exportObjectsData($objects_data, $stream); } + /** + * Trigger action to run to specified event + * + * @param string $event The event name + * @param string $evenData The event context data (optional, default: null) + * + * @return boolean True on success, False otherwise + */ + public function fireEvent($event, $evenData=null) { + self :: log_debug(strval($this)." -> fireEvent($event)"); + $return = true; + if(isset($this -> config[$event])) { + foreach(ensureIsArray($this -> config[$event]) as $func) { + if(is_callable($func)) { + self :: log_debug(strval($this)." -> fireEvent($event): run ".format_callable($func)); + if(!call_user_func_array($func, array(&$this, &$evenData))) { + $return = false; + } + } + else { + self :: log_warning(strval($this)." -> fireEvent($event): function '".format_callable($func)."' doesn't exists."); + $return = false; + } + } + } + else + self :: log_trace(strval($this)." -> fireEvent($event): no configured trigger for this event."); + return $return; + } + + /** + * Allow conversion of LSioFormat to string + * + * @return string The string representation of the LSioFormat + */ + public function __toString() { + return " name." on ".$this -> LSobject.">"; + } + } LSerror :: defineError('LSioFormat_01', diff --git a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo index f7b2fe16..bbea337b 100644 Binary files a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo and b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo differ diff --git a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po index 19d2e02c..1a7c1eff 100644 --- a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po +++ b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LdapSaisie\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-03-28 12:20+0200\n" +"PO-Revision-Date: 2023-05-17 11:36+0200\n" "Last-Translator: Benjamin Renard \n" "Language-Team: LdapSaisie \n" @@ -435,7 +435,7 @@ msgid "Show LdapSaisie modifications" msgstr "Voir les modifications d'LdapSaisie" #: includes/addons/LSaddons.accesslog.php:244 -#: includes/class/class.LSsession.php:1855 includes/routes.php:157 +#: includes/class/class.LSsession.php:1870 includes/routes.php:157 #: includes/routes.php:470 templates/default/select.tpl:29 msgid "Refresh" msgstr "Rafraîchir" @@ -752,82 +752,94 @@ msgstr "Valeur invalide" msgid "LSformRule_%{type}: Parameter %{param} is not found." msgstr "LSformRule_%{type} : Le paramètre %{param} n'est pas défini." -#: includes/class/class.LSio.php:244 +#: includes/class/class.LSio.php:261 msgid "Failed to set post data on creation form." msgstr "Impossible de définir les données dans le formulaire de création." -#: includes/class/class.LSio.php:250 +#: includes/class/class.LSio.php:267 msgid "Error validating creation form." msgstr "Une erreur est survenue en validant le formulaire de création." -#: includes/class/class.LSio.php:255 +#: includes/class/class.LSio.php:272 msgid "Failed to validate object data." msgstr "Impossible de valider les données de l'objet." -#: includes/class/class.LSio.php:262 +#: includes/class/class.LSio.php:279 msgid "Failed to generate DN for this object." msgstr "Impossible de générer le DN de cet objet." -#: includes/class/class.LSio.php:276 +#: includes/class/class.LSio.php:293 msgid "Error creating object on LDAP server." msgstr "Une erreur est survenue en création cet objet dans l'annuaire LDAP." -#: includes/class/class.LSio.php:282 +#: includes/class/class.LSio.php:299 msgid "An object already exist on LDAP server with DN %{dn}." msgstr "Un objet existe déjà dans l'annuaire LDAP avec le DN %{dn}." -#: includes/class/class.LSio.php:294 +#: includes/class/class.LSio.php:311 msgid "" "Failed to load existing object %{dn} from LDAP server. Can't update object." msgstr "" "Impossible de charger l'objet existant %{dn} depuis l'annuaire LDAP. " "Impossible de mettre à jour cet objet." -#: includes/class/class.LSio.php:303 +#: includes/class/class.LSio.php:320 msgid "Failed to set post data on update form." msgstr "Impossible de définir les données dans le formulaire de mise à jour." -#: includes/class/class.LSio.php:309 +#: includes/class/class.LSio.php:326 msgid "Error validating update form." msgstr "Une erreur est survenue en validant le formulaire de mise à jour." -#: includes/class/class.LSio.php:319 +#: includes/class/class.LSio.php:336 msgid "Error updating object on LDAP server." msgstr "" "Une erreur est survenue en mettant à jour cet objet dans l'annuaire LDAP." -#: includes/class/class.LSio.php:691 +#: includes/class/class.LSio.php:724 msgid "LSio: Post data not found or not completed." msgstr "LSio : les données transmises sont introuvables ou incomplètes." -#: includes/class/class.LSio.php:694 +#: includes/class/class.LSio.php:727 msgid "LSio: object type invalid." msgstr "LSio : type d'objet invalide." -#: includes/class/class.LSio.php:697 +#: includes/class/class.LSio.php:730 msgid "LSio: input/output format %{format} invalid." msgstr "LSio : Le format d'entrée/sortie %{format} est invalide." -#: includes/class/class.LSio.php:700 +#: includes/class/class.LSio.php:733 msgid "LSio: Fail to initialize input/output driver." msgstr "LSio : Impossible d'initialiser le pilote d'entrée/sortie." -#: includes/class/class.LSio.php:703 +#: includes/class/class.LSio.php:736 msgid "LSio: Fail to load objects's data from input file." msgstr "" "LSio: Impossible de charger les données des objets depuis le fichier " "d'import." -#: includes/class/class.LSio.php:706 +#: includes/class/class.LSio.php:739 msgid "LSio: Fail to load objects's data to export from LDAP directory." msgstr "" "LSio: Impossible de charger les données des objets à exporter depuis " "l'annuaire LDAP." -#: includes/class/class.LSio.php:709 +#: includes/class/class.LSio.php:742 msgid "LSio: Fail to export objects's data." msgstr "LSio: Impossible d'exporter les données des objets." +#: includes/class/class.LSio.php:745 +msgid "LSio: An error occured running before import hooks. Stop the import." +msgstr "" +"LSio : Une erreur est survenue durant l'exécution des déclencheurs d'avant " +"import. Arrêt de l'import." + +#: includes/class/class.LSio.php:748 +msgid "LSio: An error occured running after import hooks." +msgstr "" +"LSio : Une erreur est survenue durant l'exécution des déclencheurs d'après " +"import." + #: includes/class/class.LSformElement_supannRessourceEtatDate.php:61 msgid "Start date" msgstr "Date de début" @@ -1499,40 +1511,40 @@ msgstr "" msgid "Clear" msgstr "Nettoyer" -#: includes/class/class.LSsession.php:1640 +#: includes/class/class.LSsession.php:1655 msgid "Connection" msgstr "Connexion" -#: includes/class/class.LSsession.php:1660 +#: includes/class/class.LSsession.php:1675 msgid "Recovery of your credentials" msgstr "Récupération de votre mot de passe" -#: includes/class/class.LSsession.php:1669 +#: includes/class/class.LSsession.php:1684 msgid "Please fill the identifier field to proceed recovery procedure" msgstr "" "Merci d'entrer votre identifiant pour poursuivre la procédure de récupération" -#: includes/class/class.LSsession.php:1674 +#: includes/class/class.LSsession.php:1689 msgid "" "An email has been sent to %{mail}. Please follow the instructions on it." msgstr "" "Un e-mail vient de vous être envoyé à l'adresse %{mail}. Merci de suivre les " "indications qu'il contient." -#: includes/class/class.LSsession.php:1683 +#: includes/class/class.LSsession.php:1698 msgid "Your new password has been sent to %{mail}." msgstr "Votre nouveau mot de passe vous a été envoyé à l'adresse %{mail}." -#: includes/class/class.LSsession.php:2945 templates/default/select.tpl:20 +#: includes/class/class.LSsession.php:2960 templates/default/select.tpl:20 #: templates/default/recoverpassword.tpl:17 templates/default/login.tpl:16 msgid "Level" msgstr "Niveau" -#: includes/class/class.LSsession.php:3113 +#: includes/class/class.LSsession.php:3128 msgid "LSsession : The constant '%{const}' is not defined." msgstr "LSsession : La constante '%{const}' n'est pas définie." -#: includes/class/class.LSsession.php:3116 +#: includes/class/class.LSsession.php:3131 msgid "" "LSsession : The addon '%{addon}' support is uncertain. Verify system " "compatibility and the add-on configuration." @@ -1540,53 +1552,53 @@ msgstr "" "LSsession : Le support de l'addon '%{addon}' est incertain. Vérifiez la " "compatibilité du système et la configuration de l'add-on." -#: includes/class/class.LSsession.php:3119 +#: includes/class/class.LSsession.php:3134 msgid "" "LSsession : LDAP server's configuration data are invalid. Can't connect." msgstr "" "LSsession : Les données de configuration du serveur LDAP sont invalide. " "Impossible de s'y connecter." -#: includes/class/class.LSsession.php:3122 +#: includes/class/class.LSsession.php:3137 msgid "LSsession : Failed to load LSobject type '%{type}' : unknon type." msgstr "" "LSsession : Impossible de charger le type d'LSobject '%{type}' : type " "inconnu." -#: includes/class/class.LSsession.php:3125 +#: includes/class/class.LSsession.php:3140 msgid "LSsession : Failed to load LSclass '%{class}'." msgstr "LSsession : Impossible de charger la LSclass '%{class}'." -#: includes/class/class.LSsession.php:3128 +#: includes/class/class.LSsession.php:3143 msgid "LSsession : Login or password incorrect." msgstr "LSsession : Identifiant ou mot de passe incorrects." -#: includes/class/class.LSsession.php:3131 +#: includes/class/class.LSsession.php:3146 msgid "LSsession : Impossible to identify you : Duplication of identities." msgstr "LSsession : Impossible de vous identifier : Duplication d'identité." -#: includes/class/class.LSsession.php:3134 +#: includes/class/class.LSsession.php:3149 msgid "LSsession : Can't load class of authentification (%{class})." msgstr "" "LSsession : Impossible de charger la classe d'authentification (%{class})." -#: includes/class/class.LSsession.php:3137 +#: includes/class/class.LSsession.php:3152 msgid "LSsession : Can't connect to LDAP server." msgstr "LSsession : Impossible de se connecter au serveur LDAP." -#: includes/class/class.LSsession.php:3140 +#: includes/class/class.LSsession.php:3155 msgid "LSsession : Impossible to authenticate you." msgstr "LSsession : Impossible de vous identifier." -#: includes/class/class.LSsession.php:3143 +#: includes/class/class.LSsession.php:3158 msgid "LSsession : Your are not authorized to do this action." msgstr "LSsession : Vous n'êtes pas autorisé à faire cette action." -#: includes/class/class.LSsession.php:3146 +#: includes/class/class.LSsession.php:3161 msgid "LSsession : Some informations are missing to display this page." msgstr "LSsession : Des informations sont manquantes pour afficher cette page." -#: includes/class/class.LSsession.php:3149 +#: includes/class/class.LSsession.php:3164 msgid "" "LSsession : The function '%{function}' of the custom action " "'%{customAction}' does not exists or is not configured." @@ -1594,24 +1606,24 @@ msgstr "" "LSsession : La fonction '%{function}' de l'action personnalisée " "'%{customAction}' n'existe pas ou n'est pas configurée." -#: includes/class/class.LSsession.php:3152 +#: includes/class/class.LSsession.php:3167 msgid "LSsession : Fail to retrieve user's LDAP credentials from LSauth." msgstr "" "LSsession : Erreur en récupérant les identifiants LDAP de l'utilisateur " "depuis LSauth." -#: includes/class/class.LSsession.php:3155 +#: includes/class/class.LSsession.php:3170 msgid "" "LSsession : Fail to reconnect to LDAP server with user's LDAP credentials." msgstr "" "LSsession : Impossible de se reconnecter au serveur LDAP avec les " "identifiants de l'utilisateur." -#: includes/class/class.LSsession.php:3158 +#: includes/class/class.LSsession.php:3173 msgid "LSsession : No import/export format define for this object type." msgstr "LSsession : Aucun format d'entrée/sortie défini pour ce type d'objet." -#: includes/class/class.LSsession.php:3161 +#: includes/class/class.LSsession.php:3176 msgid "" "LSsession : Error during creation of list of levels. Contact administrators. " "(Code : %{code})" @@ -1619,13 +1631,13 @@ msgstr "" "LSsession : Erreur durant la création de la liste des niveaux. Contacter les " "administrateurs. (Code : %{type})" -#: includes/class/class.LSsession.php:3164 +#: includes/class/class.LSsession.php:3179 msgid "LSsession : The password recovery is disabled for this LDAP server." msgstr "" "LSsession : La récupération de mot de passe est désactivée pour ce serveur " "LDAP." -#: includes/class/class.LSsession.php:3167 +#: includes/class/class.LSsession.php:3182 msgid "" "LSsession : Some informations are missing to recover your password. Contact " "administrators." @@ -1633,7 +1645,7 @@ msgstr "" "LSsession : Des informations sont manques pour pouvoir récupérer votre mot " "de passe. Contacter les administrateurs." -#: includes/class/class.LSsession.php:3170 +#: includes/class/class.LSsession.php:3185 msgid "" "LSsession : Error during password recovery. Contact administrators.(Step : " "%{step})" @@ -1641,7 +1653,7 @@ msgstr "" "LSsession : Erreur durant la récupération de votre mot de passe. Contacter " "les administrateurs. (Etape : %{step})" -#: includes/class/class.LSsession.php:3173 +#: includes/class/class.LSsession.php:3188 msgid "" "LSsession : The function '%{func}' configured for the view '%{view}' of the " "LSaddon '%{addon}' is not declared in the LSaddon file." @@ -1649,11 +1661,11 @@ msgstr "" "LSsession : la fonction '%{func}' configurée pour la vue '%{view}' du " "LSaddon '%{addon}' n'est pas déclaré dans le fichier du LSaddon." -#: includes/class/class.LSsession.php:3176 +#: includes/class/class.LSsession.php:3191 msgid "LSsession : Failed to load resource file '%{file}'." msgstr "LSsession : Impossible de charger le fichier de ressource '%{file}'." -#: includes/class/class.LSsession.php:3179 +#: includes/class/class.LSsession.php:3194 msgid "" "LSsession : The function '%{func}' configured for the view '%{view}' of the " "LSaddon '%{addon}' doesn't exist." @@ -1661,11 +1673,11 @@ msgstr "" "LSsession : la fonction '%{func}' configurée pour la vue '%{view}' du " "LSaddon '%{addon}' n'existe pas." -#: includes/class/class.LSsession.php:3182 +#: includes/class/class.LSsession.php:3197 msgid "LSsession : invalid related object's DN pass in parameter." msgstr "LSsession : DN d'objet en relation incorrect dans les paramètres." -#: includes/class/class.LSsession.php:3185 +#: includes/class/class.LSsession.php:3200 msgid "" "LSsession : the LSaddon %{addon} keep using old-style addon view URL. Please " "upgrade it." @@ -1673,7 +1685,7 @@ msgstr "" "LSsession : le LSaddon %{addon} utilise toujours l'ancien type d'URL de " "vues. Merci de le mettre à jour." -#: includes/class/class.LSsession.php:3188 +#: includes/class/class.LSsession.php:3203 msgid "" "LSsession : You have been redirect from an old-style URL %{url}. Please " "upgrade this link." @@ -1681,7 +1693,7 @@ msgstr "" "LSsession : Vous avez été redirigé depuis une ancienne URL %{url}. Merci de " "le mettre à jour ce lien." -#: includes/class/class.LSsession.php:3191 +#: includes/class/class.LSsession.php:3206 msgid "" "LSsession : You always seem to use %{old} in your custom code: Please " "upgrade it and use %{new}.
\n"
@@ -3163,7 +3175,7 @@ msgstr ""
 "LSsearchEntry : formaterFunction %{func} invalide utilisé pour "
 "l'extraDisplayedColumns %{column}."
 
-#: includes/class/class.LSioFormat.php:171
+#: includes/class/class.LSioFormat.php:224
 msgid "LSioFormat : IOformat driver %{driver} invalid or unavailable."
 msgstr ""
 "LSioFormat : Le pilote d'IOformat %{driver} est invalide ou n'est pas "
diff --git a/src/lang/ldapsaisie.pot b/src/lang/ldapsaisie.pot
index 7280a119..696af66c 100644
--- a/src/lang/ldapsaisie.pot
+++ b/src/lang/ldapsaisie.pot
@@ -359,7 +359,7 @@ msgid "Show LdapSaisie modifications"
 msgstr ""
 
 #: includes/addons/LSaddons.accesslog.php:244
-#: includes/class/class.LSsession.php:1855 includes/routes.php:157
+#: includes/class/class.LSsession.php:1870 includes/routes.php:157
 #: includes/routes.php:470 templates/default/select.tpl:29
 msgid "Refresh"
 msgstr ""
@@ -638,75 +638,83 @@ msgstr ""
 msgid "LSformRule_%{type}: Parameter %{param} is not found."
 msgstr ""
 
-#: includes/class/class.LSio.php:244
+#: includes/class/class.LSio.php:261
 msgid "Failed to set post data on creation form."
 msgstr ""
 
-#: includes/class/class.LSio.php:250
+#: includes/class/class.LSio.php:267
 msgid "Error validating creation form."
 msgstr ""
 
-#: includes/class/class.LSio.php:255
+#: includes/class/class.LSio.php:272
 msgid "Failed to validate object data."
 msgstr ""
 
-#: includes/class/class.LSio.php:262
+#: includes/class/class.LSio.php:279
 msgid "Failed to generate DN for this object."
 msgstr ""
 
-#: includes/class/class.LSio.php:276
+#: includes/class/class.LSio.php:293
 msgid "Error creating object on LDAP server."
 msgstr ""
 
-#: includes/class/class.LSio.php:282
+#: includes/class/class.LSio.php:299
 msgid "An object already exist on LDAP server with DN %{dn}."
 msgstr ""
 
-#: includes/class/class.LSio.php:294
+#: includes/class/class.LSio.php:311
 msgid ""
 "Failed to load existing object %{dn} from LDAP server. Can't update object."
 msgstr ""
 
-#: includes/class/class.LSio.php:303
+#: includes/class/class.LSio.php:320
 msgid "Failed to set post data on update form."
 msgstr ""
 
-#: includes/class/class.LSio.php:309
+#: includes/class/class.LSio.php:326
 msgid "Error validating update form."
 msgstr ""
 
-#: includes/class/class.LSio.php:319
+#: includes/class/class.LSio.php:336
 msgid "Error updating object on LDAP server."
 msgstr ""
 
-#: includes/class/class.LSio.php:691
+#: includes/class/class.LSio.php:724
 msgid "LSio: Post data not found or not completed."
 msgstr ""
 
-#: includes/class/class.LSio.php:694
+#: includes/class/class.LSio.php:727
 msgid "LSio: object type invalid."
 msgstr ""
 
-#: includes/class/class.LSio.php:697
+#: includes/class/class.LSio.php:730
 msgid "LSio: input/output format %{format} invalid."
 msgstr ""
 
-#: includes/class/class.LSio.php:700
+#: includes/class/class.LSio.php:733
 msgid "LSio: Fail to initialize input/output driver."
 msgstr ""
 
-#: includes/class/class.LSio.php:703
+#: includes/class/class.LSio.php:736
 msgid "LSio: Fail to load objects's data from input file."
 msgstr ""
 
-#: includes/class/class.LSio.php:706
+#: includes/class/class.LSio.php:739
 msgid "LSio: Fail to load objects's data to export from LDAP directory."
 msgstr ""
 
-#: includes/class/class.LSio.php:709
+#: includes/class/class.LSio.php:742
 msgid "LSio: Fail to export objects's data."
 msgstr ""
 
+#: includes/class/class.LSio.php:745
+msgid "LSio: An error occured running before import hooks. Stop the import."
+msgstr ""
+
+#: includes/class/class.LSio.php:748
+msgid "LSio: An error occured running after import hooks."
+msgstr ""
+
 #: includes/class/class.LSformElement_supannRessourceEtatDate.php:61
 msgid "Start date"
 msgstr ""
@@ -1282,157 +1290,157 @@ msgstr ""
 msgid "Clear"
 msgstr ""
 
-#: includes/class/class.LSsession.php:1640
+#: includes/class/class.LSsession.php:1655
 msgid "Connection"
 msgstr ""
 
-#: includes/class/class.LSsession.php:1660
+#: includes/class/class.LSsession.php:1675
 msgid "Recovery of your credentials"
 msgstr ""
 
-#: includes/class/class.LSsession.php:1669
+#: includes/class/class.LSsession.php:1684
 msgid "Please fill the identifier field to proceed recovery procedure"
 msgstr ""
 
-#: includes/class/class.LSsession.php:1674
+#: includes/class/class.LSsession.php:1689
 msgid ""
 "An email has been sent to  %{mail}. Please follow the instructions on it."
 msgstr ""
 
-#: includes/class/class.LSsession.php:1683
+#: includes/class/class.LSsession.php:1698
 msgid "Your new password has been sent to %{mail}."
 msgstr ""
 
-#: includes/class/class.LSsession.php:2945 templates/default/select.tpl:20
+#: includes/class/class.LSsession.php:2960 templates/default/select.tpl:20
 #: templates/default/recoverpassword.tpl:17 templates/default/login.tpl:16
 msgid "Level"
 msgstr ""
 
-#: includes/class/class.LSsession.php:3113
+#: includes/class/class.LSsession.php:3128
 msgid "LSsession : The constant '%{const}' is not defined."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3116
+#: includes/class/class.LSsession.php:3131
 msgid ""
 "LSsession : The addon '%{addon}' support is uncertain. Verify system "
 "compatibility and the add-on configuration."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3119
+#: includes/class/class.LSsession.php:3134
 msgid ""
 "LSsession : LDAP server's configuration data are invalid. Can't connect."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3122
+#: includes/class/class.LSsession.php:3137
 msgid "LSsession : Failed to load LSobject type '%{type}' : unknon type."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3125
+#: includes/class/class.LSsession.php:3140
 msgid "LSsession : Failed to load LSclass '%{class}'."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3128
+#: includes/class/class.LSsession.php:3143
 msgid "LSsession : Login or password incorrect."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3131
+#: includes/class/class.LSsession.php:3146
 msgid "LSsession : Impossible to identify you : Duplication of identities."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3134
+#: includes/class/class.LSsession.php:3149
 msgid "LSsession : Can't load class of authentification (%{class})."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3137
+#: includes/class/class.LSsession.php:3152
 msgid "LSsession : Can't connect to LDAP server."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3140
+#: includes/class/class.LSsession.php:3155
 msgid "LSsession : Impossible to authenticate you."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3143
+#: includes/class/class.LSsession.php:3158
 msgid "LSsession : Your are not authorized to do this action."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3146
+#: includes/class/class.LSsession.php:3161
 msgid "LSsession : Some informations are missing to display this page."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3149
+#: includes/class/class.LSsession.php:3164
 msgid ""
 "LSsession : The function '%{function}' of the custom action "
 "'%{customAction}' does not exists or is not configured."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3152
+#: includes/class/class.LSsession.php:3167
 msgid "LSsession : Fail to retrieve user's LDAP credentials from LSauth."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3155
+#: includes/class/class.LSsession.php:3170
 msgid ""
 "LSsession : Fail to reconnect to LDAP server with user's LDAP credentials."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3158
+#: includes/class/class.LSsession.php:3173
 msgid "LSsession : No import/export format define for this object type."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3161
+#: includes/class/class.LSsession.php:3176
 msgid ""
 "LSsession : Error during creation of list of levels. Contact administrators. "
 "(Code : %{code})"
 msgstr ""
 
-#: includes/class/class.LSsession.php:3164
+#: includes/class/class.LSsession.php:3179
 msgid "LSsession : The password recovery is disabled for this LDAP server."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3167
+#: includes/class/class.LSsession.php:3182
 msgid ""
 "LSsession : Some informations are missing to recover your password. Contact "
 "administrators."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3170
+#: includes/class/class.LSsession.php:3185
 msgid ""
 "LSsession : Error during password recovery. Contact administrators.(Step : "
 "%{step})"
 msgstr ""
 
-#: includes/class/class.LSsession.php:3173
+#: includes/class/class.LSsession.php:3188
 msgid ""
 "LSsession : The function '%{func}' configured for the view '%{view}' of the "
 "LSaddon '%{addon}' is not declared in the LSaddon file."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3176
+#: includes/class/class.LSsession.php:3191
 msgid "LSsession : Failed to load resource file '%{file}'."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3179
+#: includes/class/class.LSsession.php:3194
 msgid ""
 "LSsession : The function '%{func}' configured for the view '%{view}' of the "
 "LSaddon '%{addon}' doesn't exist."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3182
+#: includes/class/class.LSsession.php:3197
 msgid "LSsession : invalid related object's DN pass in parameter."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3185
+#: includes/class/class.LSsession.php:3200
 msgid ""
 "LSsession : the LSaddon %{addon} keep using old-style addon view URL. Please "
 "upgrade it."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3188
+#: includes/class/class.LSsession.php:3203
 msgid ""
 "LSsession : You have been redirect from an old-style URL %{url}. Please "
 "upgrade this link."
 msgstr ""
 
-#: includes/class/class.LSsession.php:3191
+#: includes/class/class.LSsession.php:3206
 msgid ""
 "LSsession : You always seem to use %{old} in your custom code: Please "
 "upgrade it and use %{new}.
\n"
@@ -2695,7 +2703,7 @@ msgid ""
 "%{column}."
 msgstr ""
 
-#: includes/class/class.LSioFormat.php:171
+#: includes/class/class.LSioFormat.php:224
 msgid "LSioFormat : IOformat driver %{driver} invalid or unavailable."
 msgstr ""