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.4 2004-10-25 16:28:47 jpm Exp $
|
24 |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.5 2004-12-06 12:12:28 jpm 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.4 $ $Date: 2004-10-25 16:28:47 $
|
40 |
*@version $Revision: 1.5 $ $Date: 2004-12-06 12:12:28 $
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
*/
|
42 |
*/
|
Line 43... |
Line 43... |
43 |
|
43 |
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
Line 59... |
Line 59... |
59 |
// +------------------------------------------------------------------------------------------------------+
|
59 |
// +------------------------------------------------------------------------------------------------------+
|
Line 60... |
Line 60... |
60 |
|
60 |
|
61 |
// +------------------------------------------------------------------------------------------------------+
|
61 |
// +------------------------------------------------------------------------------------------------------+
|
Line -... |
Line 62... |
- |
|
62 |
// Gestion de l'identification des utilisateurs et des sessions
|
- |
|
63 |
|
- |
|
64 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
65 |
// Récupération des informations d'identification pour le site courant
|
- |
|
66 |
|
- |
|
67 |
// Récupération des informations sur le site
|
- |
|
68 |
$requete_auth = 'SELECT gen_site_auth.* '.
|
- |
|
69 |
'FROM gen_site_auth, gen_site '.
|
- |
|
70 |
'WHERE gs_ce_auth <> 0 '
|
- |
|
71 |
'AND gs_ce_auth = gsa_id_auth';
|
- |
|
72 |
|
- |
|
73 |
$resultat_auth = $db->query($requete_auth);
|
- |
|
74 |
(DB::isError($resultat_auth))
|
- |
|
75 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_auth->getMessage(), $requete_auth))
|
- |
|
76 |
: '';
|
- |
|
77 |
|
- |
|
78 |
while ($ligne_auth = $resultat_auth->fetchRow(DB_FETCHMODE_OBJECT)) {
|
- |
|
79 |
// Ajout des valeurs communes aux différents type d'auth
|
- |
|
80 |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth]['gsa_nom'] = $ligne_auth->gsa_nom;
|
- |
|
81 |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth]['gsa_abreviation'] = $ligne_auth->gsa_abreviation;
|
- |
|
82 |
|
- |
|
83 |
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) {
|
- |
|
84 |
$_GEN_commun['info_auth'] = $ligne_auth;
|
- |
|
85 |
}
|
- |
|
86 |
|
- |
|
87 |
if ($ligne_auth->gsa_ce_auth_bdd != 0) {
|
- |
|
88 |
//Identification via une base de donnée :
|
- |
|
89 |
$requete_auth_bdd = 'SELECT * '.
|
- |
|
90 |
'FROM gen_site_auth_bdd '.
|
- |
|
91 |
'WHERE gsab_id_auth_bdd = '.$ligne_auth->gsa_ce_auth_bdd;
|
- |
|
92 |
|
- |
|
93 |
$resultat_auth_bdd = $db->query($requete_auth_bdd);
|
- |
|
94 |
(DB::isError($resultat_auth_bdd))
|
- |
|
95 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_auth_bdd->getMessage(), $requete_auth_bdd))
|
- |
|
96 |
: '';
|
- |
|
97 |
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) {
|
- |
|
98 |
$_GEN_commun['info_auth_bdd'] = $resultat_auth_bdd->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
99 |
}
|
- |
|
100 |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = $resultat_auth_bdd->fetchRow(DB_FETCHMODE_ASSOC);
|
- |
|
101 |
$resultat_auth_bdd->free();
|
- |
|
102 |
|
- |
|
103 |
} else if ($ligne_auth->gsa_ce_auth_ldap != 0) {
|
- |
|
104 |
//Identification via LDAP :
|
- |
|
105 |
$requete_auth_ldap = 'SELECT * '.
|
- |
|
106 |
'FROM gen_site_auth_ldap '.
|
- |
|
107 |
'WHERE gsal_id_auth_ldap = '.$ligne_auth->gsa_ce_auth_ldap;
|
- |
|
108 |
|
- |
|
109 |
$resultat_auth_ldap = $db->query($requete_auth_ldap);
|
- |
|
110 |
(DB::isError($resultat_auth_ldap))
|
- |
|
111 |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_auth_ldap->getMessage(), $requete_auth_ldap))
|
- |
|
112 |
: '';
|
- |
|
113 |
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) {
|
- |
|
114 |
$_GEN_commun['info_auth_ldap'] = $resultat_auth_ldap->fetchRow(DB_FETCHMODE_OBJECT);
|
- |
|
115 |
}
|
- |
|
116 |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = $resultat_auth_ldap->fetchRow(DB_FETCHMODE_ASSOC);
|
- |
|
117 |
$resultat_auth_ldap->free();
|
- |
|
118 |
} else {
|
- |
|
119 |
die('ERREUR Papyrus : impossible de trouver les information authentification. <br />'.
|
- |
|
120 |
'Identifiant auth : '.$ligne_auth->gs_ce_auth.'<br />'.
|
- |
|
121 |
'Ligne n° : '. __LINE__ .'<br />'.
|
- |
|
122 |
'Fichier : '. __FILE__ );
|
- |
|
123 |
}
|
- |
|
124 |
}
|
62 |
// Gestion de l'identification des utilisateurs et des sessions
|
125 |
$resultat_auth->free();
|
63 |
|
126 |
|
64 |
// Nour regardons à quel type d'identification nous avons à faire:
|
127 |
// Nour regardons à quel type d'identification nous avons à faire:
|
65 |
if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 1) {
|
128 |
if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 1) {
|
66 |
// Authentification via une base de données
|
129 |
// Authentification via une base de données
|
Line 91... |
Line 154... |
91 |
|
154 |
|
Line 92... |
Line 155... |
92 |
$_GEN_commun['pear_auth']->start();
|
155 |
$_GEN_commun['pear_auth']->start();
|
93 |
|
156 |
|
- |
|
157 |
/* +--Fin du code ---------------------------------------------------------------------------------------+
|
- |
|
158 |
* $Log: not supported by cvs2svn $
|
- |
|
159 |
* Revision 1.4 2004/10/25 16:28:47 jpm
|
94 |
/* +--Fin du code ---------------------------------------------------------------------------------------+
|
160 |
* Ajout de nouvelles balises Papyrus, ajout vérification mise à jour de Papyrus, meilleure gestion des sessions...
|
95 |
* $Log: not supported by cvs2svn $
|
161 |
*
|
96 |
* Revision 1.3 2004/10/15 18:29:19 jpm
|
162 |
* Revision 1.3 2004/10/15 18:29:19 jpm
|
97 |
* Modif pour gérer l'appli installateur de Papyrus.
|
163 |
* Modif pour gérer l'appli installateur de Papyrus.
|
98 |
*
|
164 |
*
|