Subversion Repositories Applications.papyrus

Rev

Rev 363 | Rev 443 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 363 Rev 406
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.17 2005-04-27 15:06:21 alex Exp $
24
// CVS : $Id: pap_initialise_auth.inc.php,v 1.18 2005-07-07 09:15:36 alexandre_tb 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.17 $ $Date: 2005-04-27 15:06:21 $
40
*@version           $Revision: 1.18 $ $Date: 2005-07-07 09:15:36 $
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
*/
42
*/
Line 43... Line 43...
43
 
43
 
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
Line 202... Line 202...
202
    if (isset($valeur['type_site_externe']) && $valeur['type_site_externe'] == 201) {  // 201 = site de type "WIKINI"
202
    if (isset($valeur['type_site_externe']) && $valeur['type_site_externe'] == 201) {  // 201 = site de type "WIKINI"
203
        $tab_parametre = explode (" ", $valeur['gsab_parametres']) ;
203
        $tab_parametre = explode (" ", $valeur['gsab_parametres']) ;
204
        foreach ($tab_parametre as $cle_param => $valeur_param) {
204
        foreach ($tab_parametre as $cle_param => $valeur_param) {
205
            $tab_valeur = explode ('=', $valeur_param) ;
205
            $tab_valeur = explode ('=', $valeur_param) ;
206
            if ($tab_valeur[0] == 'champs_wiki') $nomwikini = $tab_valeur[1] ;
206
            if ($tab_valeur[0] == 'champs_wiki') $nomwikini = $tab_valeur[1] ;
-
 
207
            if ($tab_valeur[0] == 'coauth') $coauth= $tab_valeur[1] ;
207
        }
208
        }
208
    }
209
    }
209
}
210
}
-
 
211
 
-
 
212
if (isset ($nomwikini) && isset ($coauth) && $coauth == $auth_courante['gsab_id_auth_bdd']&& $GLOBALS['_GEN_commun']['pear_auth']->getAuth()) {
210
unset ($tab_parametre) ; unset ($tab_valeur) ;
213
    unset ($tab_parametre) ; unset ($tab_valeur) ;
211
if (isset ($nomwikini)) {
-
 
-
 
214
    
212
    // 1. name
215
    // 1. name
Line 213... Line 216...
213
 
216
 
Line 214... Line 217...
214
    setcookie ("name", $nomwikini, time () + 3600 * 24 * 30, "/" ) ; // 1 mois
217
    setcookie ("name", $GLOBALS['_GEN_commun']['pear_auth']->getAuthData($nomwikini), time () + 3600 * 24 * 30, "/" ) ; // 1 mois
215
    
218
    
-
 
219
    //2. password
-
 
220
    // on recherche le mot de passe crypté
-
 
221
    $requete_mot_passe = 'select '.$GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_champ_mdp'].' from '.
-
 
222
                            $GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_table'].' where '.
216
    //2. password
223
                            $GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_champ_login'].'='.
217
    // on recherche le mot de passe crypté
224
                            '"'.$GLOBALS['_GEN_commun']['pear_auth']->getUsername().'"' ;
-
 
225
    
-
 
226
    $resultat_mot_passe = $db->query($requete_mot_passe) ;
-
 
227
    if (DB::isError($resultat_mot_passe)) {
-
 
228
        echo 'erreur de la requete pour identifier sur wikini' ;
-
 
229
    }
Line 218... Line 230...
218
   
230
    $ligne_mot_passe = $resultat_mot_passe->fetchRow(DB_FETCHMODE_ASSOC) ;
Line 219... Line 231...
219
    $mot_de_passe = $_GEN_commun['pear_auth']->session('password') ;
231
    $mot_de_passe = $ligne_mot_passe[$GLOBALS['_PAPYRUS_']['auth'][$coauth]['gsab_nom_champ_mdp']];
220
    
232
    
221
    setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ;
-
 
222
    
233
    setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ;
Line 223... Line 234...
223
    // 3. remember
234
    
224
    setcookie ("remember", 1, time () + 3600 * 24 * 30, "/") ;
235
    // 3. remember
Line 295... Line 306...
295
}
306
}
Line 296... Line 307...
296
 
307
 
297
 
308
 
-
 
309
/* +--Fin du code ---------------------------------------------------------------------------------------+
-
 
310
* $Log: not supported by cvs2svn $
-
 
311
* Revision 1.17  2005/04/27 15:06:21  alex
298
/* +--Fin du code ---------------------------------------------------------------------------------------+
312
* ajout de l'authentification wiki.
299
* $Log: not supported by cvs2svn $
313
*
300
* Revision 1.16  2005/03/25 13:08:20  jpm
314
* Revision 1.16  2005/03/25 13:08:20  jpm
301
* Déplacement de la gestion des arguments de l'authentification.
315
* Déplacement de la gestion des arguments de l'authentification.
302
*
316
*