Line 19... |
Line 19... |
19 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | You should have received a copy of the GNU Lesser General Public |
|
20 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | License along with this library; if not, write to the Free Software |
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | |
|
22 |
// | |
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
24 |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.8 2004-12-07 11:36:22 alex Exp $
|
24 |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.9 2004-12-07 11:39:24 alex Exp $
|
25 |
/**
|
25 |
/**
|
26 |
* Initialisation de l'authentification.
|
26 |
* Initialisation de l'authentification.
|
27 |
*
|
27 |
*
|
28 |
* Suite à la recherche des informations depuis la base de données nous initialisons
|
28 |
* Suite à la recherche des informations depuis la base de données nous initialisons
|
29 |
* l'authentification des utilisateurs si le site l'utilise.
|
29 |
* l'authentification des utilisateurs si le site l'utilise.
|
Line 35... |
Line 35... |
35 |
//Auteur original :
|
35 |
//Auteur original :
|
36 |
*@author Alexandre GRANIER <alex@tela-botanica.org>
|
36 |
*@author Alexandre GRANIER <alex@tela-botanica.org>
|
37 |
//Autres auteurs :
|
37 |
//Autres auteurs :
|
38 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
38 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
39 |
*@copyright Tela-Botanica 2000-2004
|
39 |
*@copyright Tela-Botanica 2000-2004
|
40 |
*@version $Revision: 1.8 $ $Date: 2004-12-07 11:36:22 $
|
40 |
*@version $Revision: 1.9 $ $Date: 2004-12-07 11:39:24 $
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
*/
|
42 |
*/
|
Line 43... |
Line 43... |
43 |
|
43 |
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
Line 201... |
Line 201... |
201 |
}
|
201 |
}
|
Line 202... |
Line 202... |
202 |
|
202 |
|
203 |
if (isset ($chemin_spip) && isset ($coauth) && $coauth == $auth_courante['gsab_id_auth_bdd']&& $_GEN_commun['pear_auth']->getAuth()) {
|
203 |
if (isset ($chemin_spip) && isset ($coauth) && $coauth == $auth_courante['gsab_id_auth_bdd']&& $_GEN_commun['pear_auth']->getAuth()) {
|
204 |
$login = $_GEN_commun['pear_auth']->getAuthData($auth_courante['gsab_nom_champ_login']) ;
|
204 |
$login = $_GEN_commun['pear_auth']->getAuthData($auth_courante['gsab_nom_champ_login']) ;
|
- |
|
205 |
setcookie("spip_admin", "@".$login, time()+3600*24*30, "/$chemin_spip/") ;
|
- |
|
206 |
set_include_path(get_include_path().":".$chemin_spip) ;
|
Line 205... |
Line -... |
205 |
setcookie("spip_admin", "@".$login, time()+3600*24*30, "/$chemin_spip/") ;
|
- |
|
206 |
|
- |
|
207 |
|
- |
|
208 |
ajouter_session($GLOBALS['auteur_session'], $id_session) ;
|
207 |
|
Line 209... |
Line -... |
209 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/$chemin_spip/") ;
|
- |
|
210 |
}
|
- |
|
211 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/$chemin_spip/") ;
|
208 |
|
Line 212... |
Line 209... |
212 |
|
209 |
|
213 |
} else {
|
210 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/$chemin_spip/") ;
|
214 |
$id_session = preg_replace("/[0-9]+_/", $userid."_", $HTTP_COOKIE_VARS["spip_session"]) ;
|
211 |
|
Line 222... |
Line 219... |
222 |
$GLOBALS['auteur_session']['statut'] = "1comite" ;
|
219 |
$GLOBALS['auteur_session']['statut'] = "1comite" ;
|
223 |
$GLOBALS['auteur_session']['lang'] = "fr" ;
|
220 |
$GLOBALS['auteur_session']['lang'] = "fr" ;
|
Line 224... |
Line 221... |
224 |
|
221 |
|
225 |
if (!$HTTP_COOKIE_VARS["spip_session"]) {
|
222 |
if (!$HTTP_COOKIE_VARS["spip_session"]) {
|
226 |
$id_session = $userid."_".(md5 (uniqid (rand ())));
|
223 |
$id_session = $userid."_".(md5 (uniqid (rand ())));
|
227 |
set_include_path(get_include_path().":".$chemin_spip) ;
|
224 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/$chemin_spip/") ;
|
- |
|
225 |
|
- |
|
226 |
} else {
|
- |
|
227 |
$id_session = preg_replace("/[0-9]+_/", $userid."_", $HTTP_COOKIE_VARS["spip_session"]) ;
|
- |
|
228 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/$chemin_spip/") ;
|
- |
|
229 |
}
|
Line -... |
Line 230... |
- |
|
230 |
|
Line 228... |
Line 231... |
228 |
|
231 |
|
Line 229... |
Line 232... |
229 |
|
232 |
ajouter_session($GLOBALS['auteur_session'], $id_session) ;
|