Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 207 → Rev 208

/trunk/papyrus/pap_initialise_auth.inc.php
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.5 2004-12-06 12:12:28 jpm Exp $
// CVS : $Id: pap_initialise_auth.inc.php,v 1.6 2004-12-06 12:42:02 alex 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.5 $ $Date: 2004-12-06 12:12:28 $
*@version $Revision: 1.6 $ $Date: 2004-12-06 12:42:02 $
// +------------------------------------------------------------------------------------------------------+
*/
 
65,7 → 65,7
// 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.* '.
$requete_auth = 'SELECT gen_site_auth.*, gs_id_site '.
'FROM gen_site_auth, gen_site '.
'WHERE gs_ce_auth <> 0 '
'AND gs_ce_auth = gsa_id_auth';
121,41 → 121,53
'Ligne n° : '. __LINE__ .'<br />'.
'Fichier : '. __FILE__ );
}
// On teste le type d'authentification
$requete = "SELECT * FROM gen_site_relation WHERE gsr_id_site_01=$ligne_auth->gs_id_site and gsr_id_site_01=gsr_id_site_02 and gsr_valeur=" ;
$resultat = $db->query ($requete) ;
}
$resultat_auth->free();
 
// Nour regardons à quel type d'identification nous avons à faire:
if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 1) {
// Authentification via une base de données
$param_bdd = array ('dsn' => PAP_DSN,
'table' => $_GEN_commun['info_auth_bdd']->gsab_nom_table,
'usernamecol' => $_GEN_commun['info_auth_bdd']->gsab_nom_champ_login,
'passwordcol' => $_GEN_commun['info_auth_bdd']->gsab_nom_champ_mdp,
'cryptType' => $_GEN_commun['info_auth_bdd']->gsab_cryptage_mdp,
'db_fields' => '*');
$_GEN_commun['pear_auth'] = new Auth('DB', $param_bdd, 'GEN_afficherInfoIdentification', 1);
} else if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 2) {
// Authentification via LDAP
$param_ldap = array ( 'host' => $_GEN_commun['info_auth_ldap']->gsal_serveur,
'port' => $_GEN_commun['info_auth_ldap']->gsal_port,
'basedn' => $_GEN_commun['info_auth_ldap']->gsal_base_dn,
'userattr' => $_GEN_commun['info_auth_ldap']->gsal_uid);
$_GEN_commun['pear_auth'] = new Auth('LDAP', $param_ldap, 'GEN_afficherInfoIdentification', 1);
} else {
die('ERREUR Génésia : type identification introuvable. <br />'.
'Type identification : '.$_GEN_commun['info_auth']->gsa_ce_type_auth.'<br />'.
'Ligne n° : '. __LINE__ . '<br />'.
'Fichier : '. __FILE__ . '<br />');
}
 
$_GEN_commun['pear_auth']->setSessionname( 'gen_'.$_GEN_commun['info_auth']->gsa_abreviation);
for ($GLOBALS['_PAPYRUS_']['auth'] as $cle => $auth_courrante) {
// Nour regardons à quel type d'identification nous avons à faire:
if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 1) {
// Authentification via une base de données
$param_bdd = array ('dsn' => $auth_courrante['gsab_dsn'],
'table' => $auth_courrante['gsab_nom_table'],
'usernamecol' => $auth_courrante['gsab_nom_champ_login'],
'passwordcol' => $auth_courrante['gsab_nom_champ_mdp'],
'cryptType' => $auth_courrante['gsab_cryptage_mdp'],
'db_fields' => '*');
// L'authentification courrante
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) {
$_GEN_commun['pear_auth'] = new Auth('DB', $param_bdd, 'GEN_afficherInfoIdentification', 1);
}
} else if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 2) {
// Authentification via LDAP
$param_ldap = array ( 'host' => $_GEN_commun['info_auth_ldap']->gsal_serveur,
'port' => $_GEN_commun['info_auth_ldap']->gsal_port,
'basedn' => $_GEN_commun['info_auth_ldap']->gsal_base_dn,
'userattr' => $_GEN_commun['info_auth_ldap']->gsal_uid);
$_GEN_commun['pear_auth'] = new Auth('LDAP', $param_ldap, 'GEN_afficherInfoIdentification', 1);
} else {
die('ERREUR Génésia : type identification introuvable. <br />'.
'Type identification : '.$_GEN_commun['info_auth']->gsa_ce_type_auth.'<br />'.
'Ligne n° : '. __LINE__ . '<br />'.
'Fichier : '. __FILE__ . '<br />');
}
$_GEN_commun['pear_auth']->setSessionname( 'gen_'.$_GEN_commun['info_auth']->gsa_abreviation);
$_GEN_commun['pear_auth']->setExpire(3600 * 24 * 30 * 6);// 6 mois
$_GEN_commun['pear_auth']->start();
}
 
$_GEN_commun['pear_auth']->setExpire(3600 * 24 * 30 * 6);// 6 mois
 
$_GEN_commun['pear_auth']->start();
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log: not supported by cvs2svn $
* Revision 1.5 2004/12/06 12:12:28 jpm
* Début de gestion des auth multiples.
*
* 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...
*