f1cfda4ea71f0e9a406c7b2daaea0e02521ee208
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2017 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
14 * Gestion de l'action auth
16 * @package SPIP\Core\Authentification
19 if (!defined('_ECRIRE_INC_VERSION')) {
24 * Retour d'authentification pour les SSO
26 function action_auth_dist() {
28 $securiser_action = charger_fonction('securiser_action', 'inc');
29 $arg = $securiser_action();
31 if (!preg_match(",^(\w+)[/](.+)$,", $arg, $r)) {
32 spip_log("action_auth_dist $arg pas compris");
34 $auth_methode = $r[1];
36 include_spip('inc/auth');
37 $res = auth_terminer_identifier_login($auth_methode, $login);
39 if (is_string($res)) { // Erreur
40 $redirect = _request('redirect');
41 $redirect = parametre_url($redirect, 'var_erreur', $res, '&');
42 include_spip('inc/headers');
43 redirige_par_entete($redirect);
46 // sinon on loge l'auteur identifie, et on finit (redirection automatique)