Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 405 → Rev 406

/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.17 2005-04-27 15:06:21 alex Exp $
// CVS : $Id: pap_initialise_auth.inc.php,v 1.18 2005-07-07 09:15:36 alexandre_tb 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.17 $ $Date: 2005-04-27 15:06:21 $
*@version $Revision: 1.18 $ $Date: 2005-07-07 09:15:36 $
// +------------------------------------------------------------------------------------------------------+
*/
 
204,25 → 204,36
foreach ($tab_parametre as $cle_param => $valeur_param) {
$tab_valeur = explode ('=', $valeur_param) ;
if ($tab_valeur[0] == 'champs_wiki') $nomwikini = $tab_valeur[1] ;
if ($tab_valeur[0] == 'coauth') $coauth= $tab_valeur[1] ;
}
}
}
unset ($tab_parametre) ; unset ($tab_valeur) ;
if (isset ($nomwikini)) {
 
if (isset ($nomwikini) && isset ($coauth) && $coauth == $auth_courante['gsab_id_auth_bdd']&& $GLOBALS['_GEN_commun']['pear_auth']->getAuth()) {
unset ($tab_parametre) ; unset ($tab_valeur) ;
// 1. name
 
setcookie ("name", $nomwikini, time () + 3600 * 24 * 30, "/" ) ; // 1 mois
setcookie ("name", $GLOBALS['_GEN_commun']['pear_auth']->getAuthData($nomwikini), time () + 3600 * 24 * 30, "/" ) ; // 1 mois
//2. password
// on recherche le mot de passe crypté
$mot_de_passe = $_GEN_commun['pear_auth']->session('password') ;
$requete_mot_passe = 'select '.$GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_champ_mdp'].' from '.
$GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_table'].' where '.
$GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_champ_login'].'='.
'"'.$GLOBALS['_GEN_commun']['pear_auth']->getUsername().'"' ;
$resultat_mot_passe = $db->query($requete_mot_passe) ;
if (DB::isError($resultat_mot_passe)) {
echo 'erreur de la requete pour identifier sur wikini' ;
}
$ligne_mot_passe = $resultat_mot_passe->fetchRow(DB_FETCHMODE_ASSOC) ;
$mot_de_passe = $ligne_mot_passe[$GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_champ_mdp']];
setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ;
// 3. remember
setcookie ("remember", 1, time () + 3600 * 24 * 30, "/") ;
 
}
 
 
297,6 → 308,9
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log: not supported by cvs2svn $
* Revision 1.17 2005/04/27 15:06:21 alex
* ajout de l'authentification wiki.
*
* Revision 1.16 2005/03/25 13:08:20 jpm
* Déplacement de la gestion des arguments de l'authentification.
*