Subversion Repositories Applications.papyrus

Rev

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

Rev 231 Rev 310
Line 1... Line 1...
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: wikini_cookie.php,v 1.1 2004-12-15 13:32:15 alex Exp $
22
// CVS : $Id: wikini_cookie.php,v 1.2 2005-03-21 16:57:30 florian Exp $
23
/**
23
/**
24
* Envoie de cookie pour wikini à partir d'une inscription 
24
* Envoie de cookie pour wikini à partir d'une inscription 
25
*
25
*
26
* Envoie de cookie pour wikini à partir d'une inscription 
26
* Envoie de cookie pour wikini à partir d'une inscription 
27
*
27
*
28
*@package inscription
28
*@package inscription
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.1 $ $Date: 2004-12-15 13:32:15 $
34
*@version       $Revision: 1.2 $ $Date: 2005-03-21 16:57:30 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// Wikini envoie 3 cookies
38
// Wikini envoie 3 cookies
39
// name        avec pour valeur le nom wiki de l'utilisateur
39
// name        avec pour valeur le nom wiki de l'utilisateur
40
// password     avec pour valeur le mot de passe crypté de l'utilisateur
40
// password     avec pour valeur le mot de passe crypté de l'utilisateur
41
// remember     la durée du cookie
41
// remember     la durée du cookie
42
 
42
 
43
// On fait la même chose
43
// On fait la même chose
44
 
44
 
45
if ($userid != "") {
45
if ($userid != "") {
46
 
46
 
47
    // 1. name
47
    // 1. name
48
    // On recherche le nom
48
    // On recherche le nom
49
    $nomwikini = $AUTH->getAuthData('ga_login') ;
49
    $nomwikini = $AUTH->getAuthData('ga_login') ;
50
    setcookie ("name", $nomwikini, time () + 3600 * 24 * 30, "/" ) ; // 1 mois
50
    setcookie ("name", $nomwikini, time () + 3600 * 24 * 30, "/" ) ; // 1 mois
51
    
51
    
52
    //2. password
52
    //2. password
53
    // on recherche le mot de passe crypté
53
    // on recherche le mot de passe crypté
54
    $requete = "select ga_mot_de_passe from gen_annuaire where ga_id_administrateur=$userid" ;
54
    $requete = "select ga_mot_de_passe from gen_annuaire where ga_id_administrateur=$userid" ;
55
    $resultat = $db->query ($requete) ;
55
    $resultat = $db->query ($requete) ;
56
    if (DB::isError($resultat)) {
56
    if (DB::isError($resultat)) {
57
        die ("Erreur") ;
57
        die ("Erreur") ;
58
    }
58
    }
59
    $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
59
    $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
60
    $mot_de_passe = $ligne->ga_mot_de_passe ;
60
    $mot_de_passe = $ligne->ga_mot_de_passe ;
61
    
61
    
62
    setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ;
62
    setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ;
63
    
63
    
64
    // 3. remember
64
    // 3. remember
65
    setcookie ("remember", 1, time () + 3600 * 24 * 30, "/") ;
65
    setcookie ("remember", 1, time () + 3600 * 24 * 30, "/") ;
66
    
66
    
67
}
67
}
68
 
68
 
69
?>
69
?>
70
70