21,7 → 21,7 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// | | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.4 2004-10-25 16:28:47 jpm Exp $ |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.5 2004-12-06 12:12:28 jpm Exp $ |
/** |
* Initialisation de l'authentification. |
* |
37,7 → 37,7 |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ $Date: 2004-10-25 16:28:47 $ |
*@version $Revision: 1.5 $ $Date: 2004-12-06 12:12:28 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
60,6 → 60,69 |
|
// +------------------------------------------------------------------------------------------------------+ |
// Gestion de l'identification des utilisateurs et des sessions |
|
// +------------------------------------------------------------------------------------------------------+ |
// Récupération des informations d'identification pour le site courant |
|
// Récupération des informations sur le site |
$requete_auth = 'SELECT gen_site_auth.* '. |
'FROM gen_site_auth, gen_site '. |
'WHERE gs_ce_auth <> 0 ' |
'AND gs_ce_auth = gsa_id_auth'; |
|
$resultat_auth = $db->query($requete_auth); |
(DB::isError($resultat_auth)) |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_auth->getMessage(), $requete_auth)) |
: ''; |
|
while ($ligne_auth = $resultat_auth->fetchRow(DB_FETCHMODE_OBJECT)) { |
// Ajout des valeurs communes aux différents type d'auth |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth]['gsa_nom'] = $ligne_auth->gsa_nom; |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth]['gsa_abreviation'] = $ligne_auth->gsa_abreviation; |
|
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) { |
$_GEN_commun['info_auth'] = $ligne_auth; |
} |
|
if ($ligne_auth->gsa_ce_auth_bdd != 0) { |
//Identification via une base de donnée : |
$requete_auth_bdd = 'SELECT * '. |
'FROM gen_site_auth_bdd '. |
'WHERE gsab_id_auth_bdd = '.$ligne_auth->gsa_ce_auth_bdd; |
|
$resultat_auth_bdd = $db->query($requete_auth_bdd); |
(DB::isError($resultat_auth_bdd)) |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_auth_bdd->getMessage(), $requete_auth_bdd)) |
: ''; |
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) { |
$_GEN_commun['info_auth_bdd'] = $resultat_auth_bdd->fetchRow(DB_FETCHMODE_OBJECT); |
} |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = $resultat_auth_bdd->fetchRow(DB_FETCHMODE_ASSOC); |
$resultat_auth_bdd->free(); |
|
} else if ($ligne_auth->gsa_ce_auth_ldap != 0) { |
//Identification via LDAP : |
$requete_auth_ldap = 'SELECT * '. |
'FROM gen_site_auth_ldap '. |
'WHERE gsal_id_auth_ldap = '.$ligne_auth->gsa_ce_auth_ldap; |
|
$resultat_auth_ldap = $db->query($requete_auth_ldap); |
(DB::isError($resultat_auth_ldap)) |
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_auth_ldap->getMessage(), $requete_auth_ldap)) |
: ''; |
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) { |
$_GEN_commun['info_auth_ldap'] = $resultat_auth_ldap->fetchRow(DB_FETCHMODE_OBJECT); |
} |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = $resultat_auth_ldap->fetchRow(DB_FETCHMODE_ASSOC); |
$resultat_auth_ldap->free(); |
} else { |
die('ERREUR Papyrus : impossible de trouver les information authentification. <br />'. |
'Identifiant auth : '.$ligne_auth->gs_ce_auth.'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier : '. __FILE__ ); |
} |
} |
$resultat_auth->free(); |
|
// Nour regardons à quel type d'identification nous avons à faire: |
if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 1) { |
93,6 → 156,9 |
|
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ |
* Revision 1.4 2004/10/25 16:28:47 jpm |
* Ajout de nouvelles balises Papyrus, ajout vérification mise à jour de Papyrus, meilleure gestion des sessions... |
* |
* Revision 1.3 2004/10/15 18:29:19 jpm |
* Modif pour gérer l'appli installateur de Papyrus. |
* |