[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / action / auth.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
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 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 /**
16 * Retour d'authentification pour les SSO
17 */
18 function action_auth_dist() {
19
20 $securiser_action = charger_fonction('securiser_action', 'inc');
21 $arg = $securiser_action();
22
23 if (!preg_match(",^(\w+)[/](.+)$,", $arg, $r)) {
24 spip_log("action_auth_dist $arg pas compris");
25 }
26 else {
27 $auth_methode = $r[1];
28 $login = $r[2];
29 include_spip('inc/auth');
30 $res = auth_terminer_identifier_login($auth_methode, $login);
31
32 if (is_string($res)){ // Erreur
33 $redirect = _request('redirect');
34 $redirect = parametre_url($redirect,'var_erreur',$res,'&');
35 include_spip('inc/headers');
36 redirige_par_entete($redirect);
37 }
38
39 // sinon on loge l'auteur identifie, et on finit (redirection automatique)
40 auth_loger($res);
41 }
42 }
43
44
45 ?>