Subversion Repositories Sites.tela-botanica.org

Rev

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
    // Requete pour inscrire dans SPIP
375 jpm 50
    $requete = "insert into ".INS_BDD_SPIP.".spip_auteurs set id_auteur=$id, nom=\"".$valeurs['prenom']." ".$valeurs['nom'].
7 david 51
                "\",email=\"".$valeurs['email']."\",login=\"".$valeurs['email'].
96 alex 52
                "\", pass=\"".md5($valeurs['mot_de_passe'])."\", statut=\"1comite\", lang=\"".
7 david 53
                strtolower($valeurs['pays'])."\"" ;
375 jpm 54
    $GLOBALS['ins_db']->query($requete) ;
55
 
7 david 56
}
57
 
58
function mod_inscription_spip($id)
59
{
60
    global $HTTP_POST_VARS ;
61
    //BIEN METTRE alea_actuel, htpass ET alea_futur À ""
375 jpm 62
     $requete = "update ".INS_BDD_SPIP.".spip_auteurs set nom=\"".$HTTP_POST_VARS['prenom']." ".$HTTP_POST_VARS['nom'].
7 david 63
                "\",email=\"".$HTTP_POST_VARS['email']."\",login=\"".$HTTP_POST_VARS['email'].
64
                "\", pass=\"".md5($HTTP_POST_VARS['mot_de_passe'])."\", htpass=\"\", alea_actuel=\"\", alea_futur=\"\", lang=\"en\" where id_auteur=$id" ;
65
    //echo $requete;
375 jpm 66
    $GLOBALS['ins_db']->query($requete) ;
7 david 67
}
375 jpm 68
 
7 david 69
function desinscription_spip($id_utilisateur)
70
{
71
    //BIEN METTRE alea_actuel, htpass ET alea_futur À ""
375 jpm 72
     $requete = 'DELETE FROM '.INS_BDD_SPIP.'.spip_auteurs WHERE id_auteur='.$id_utilisateur ;
7 david 73
    //echo $requete;
375 jpm 74
    $resultat = $GLOBALS['ins_db']->query ($requete) ;
7 david 75
    if (DB::isError ($resultat)) {
76
        return "Echec de la requete : $requete<br />".$resultat->getMessage() ;
77
    }
78
}
79
 
80
 
81
 
82
/* +--Fin du code ----------------------------------------------------------------------------------------+
83
*
84
* $Log: ins_spip.fonct.php,v $
85
* Revision 1.1  2005/03/04 10:39:30  tam
86
* installation
87
*
88
* Revision 1.1  2004/07/06 15:42:17  alex
89
* en cours
90
*
91
* Revision 1.2  2004/06/25 14:25:27  alex
92
* modification de la requete de suppresssion
93
*
94
* Revision 1.1  2004/06/18 09:20:48  alex
95
* version initiale
96
*
97
*
98
* +-- Fin du code ----------------------------------------------------------------------------------------+
99
*/
100
 
101
 
102
 
103
 
104
?>