From 5cfbbfdb27dc4b754e841b217bc51af6ba8f87c6 Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Thu, 17 Mar 2016 11:28:12 +0000 Subject: [PATCH] un pipeline auth_administrer permet de personaliser le retour des differentes fonctions d'auth (par exemple pour renforcer la verification du mot de passe, quand flux['args']['fonction']=='verifier_pass' --- ecrire/inc/auth.php | 15 ++++++++++++--- ecrire/paquet.xml | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ecrire/inc/auth.php b/ecrire/inc/auth.php index 6d88bd34b0..df9ffb5407 100644 --- a/ecrire/inc/auth.php +++ b/ecrire/inc/auth.php @@ -358,10 +358,19 @@ function auth_administrer($fonction, $args, $defaut = false) { if ($auth = charger_fonction($auth_methode, 'auth', true) and function_exists($f = "auth_{$auth_methode}_$fonction") ) { - return call_user_func_array($f, $args); + $res = call_user_func_array($f, $args); } else { - return $defaut; - } + $res = $defaut; + } + $res = pipeline('auth_administrer',array( + 'args' => array( + 'fonction' => $fonction, + 'methode' => $auth_methode, + 'args' => $args + ), + 'data' => $res + )); + return $res; } /** diff --git a/ecrire/paquet.xml b/ecrire/paquet.xml index 723335034a..5ac7146140 100644 --- a/ecrire/paquet.xml +++ b/ecrire/paquet.xml @@ -49,6 +49,7 @@ <pipeline nom="affiche_formulaire_login" action="auth_formulaire_login" inclure="inc/pipelines.php" /> <pipeline nom="alertes_auteur" action="" /> <pipeline nom="arbo_creer_chaine_url" action="" /> + <pipeline nom="auth_administrer" action="" /> <pipeline nom="autoriser" action="" /> <pipeline nom="base_admin_repair" action="" /> <pipeline nom="boite_infos" action="f_boite_infos" inclure="inc/pipelines_ecrire.php" /> -- GitLab