Subversion Repositories Sites.tela-botanica.org

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7 david 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
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                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: ins_spip.fonct.php,v 1.1 2005/03/04 10:39:30 tam Exp $
23
/**
24
* Fonctions wikini
25
*
26
* Ce fichier propose 3 fonctions pour intervenir sur la table interwikini_users.
27
*
28
*@package inscription
29
*@subpackage fonctions_wikini
30
//Auteur original :
31
*@author        Alexandre Granier <alexandre@tela-botanica.org>
32
//Autres auteurs :
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.1 $ $Date: 2005/03/04 10:39:30 $
36
// +------------------------------------------------------------------------------------------------------+
37
*/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
42
 
43
// +------------------------------------------------------------------------------------------------------+
44
// |                                           LISTE de FONCTIONS                                         |
45
// +------------------------------------------------------------------------------------------------------+
46
 
47
function inscription_spip($id, $valeurs)
48
{
49
    $db = &DB::connect(INS_DSN_SPIP) ;
50
    // Requete pour inscrire dans SPIP
51
 
52
    $requete = "insert into spip_auteurs set id_auteur=$id, nom=\"".$valeurs['prenom']." ".$valeurs['nom'].
53
                "\",email=\"".$valeurs['email']."\",login=\"".$valeurs['email'].
54
                "\", pass=\"".md5($valeurs['mot_de_passe'])."\", statut=\"nouveau\", lang=\"".
55
                strtolower($valeurs['pays'])."\"" ;
56
    $db->query($requete) ;
57
}
58
 
59
function mod_inscription_spip($id)
60
{
61
    global $HTTP_POST_VARS ;
62
    $db = &DB::connect(INS_DSN_SPIP) ;
63
    //BIEN METTRE alea_actuel, htpass ET alea_futur À ""
64
     $requete = "update spip_auteurs set nom=\"".$HTTP_POST_VARS['prenom']." ".$HTTP_POST_VARS['nom'].
65
                "\",email=\"".$HTTP_POST_VARS['email']."\",login=\"".$HTTP_POST_VARS['email'].
66
                "\", pass=\"".md5($HTTP_POST_VARS['mot_de_passe'])."\", htpass=\"\", alea_actuel=\"\", alea_futur=\"\", lang=\"en\" where id_auteur=$id" ;
67
    //echo $requete;
68
    $db->query($requete) ;
69
}
70
function desinscription_spip($id_utilisateur)
71
{
72
    $db = &DB::connect(INS_DSN_SPIP) ;
73
    //BIEN METTRE alea_actuel, htpass ET alea_futur À ""
74
     $requete = 'delete from spip_auteurs where id_auteur='.$id_utilisateur ;
75
    //echo $requete;
76
    $resultat = $db->query ($requete) ;
77
    if (DB::isError ($resultat)) {
78
        return "Echec de la requete : $requete<br />".$resultat->getMessage() ;
79
    }
80
}
81
 
82
 
83
 
84
/* +--Fin du code ----------------------------------------------------------------------------------------+
85
*
86
* $Log: ins_spip.fonct.php,v $
87
* Revision 1.1  2005/03/04 10:39:30  tam
88
* installation
89
*
90
* Revision 1.1  2004/07/06 15:42:17  alex
91
* en cours
92
*
93
* Revision 1.2  2004/06/25 14:25:27  alex
94
* modification de la requete de suppresssion
95
*
96
* Revision 1.1  2004/06/18 09:20:48  alex
97
* version initiale
98
*
99
*
100
* +-- Fin du code ----------------------------------------------------------------------------------------+
101
*/
102
 
103
 
104
 
105
 
106
?>