Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
231 alex 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 2004-12-15 13:32:25 alex 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: 2004-12-15 13:32:25 $
36
// +------------------------------------------------------------------------------------------------------+
37
*/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
42
 
43
// +------------------------------------------------------------------------------------------------------+
44
// |                                           LISTE de FONCTIONS                                         |
45
// +------------------------------------------------------------------------------------------------------+
46
 
47
function inscription_spip($id, &$valeur)
48
{
49
 
50
    // Requete pour inscrire dans SPIP
51
    if (isset ($valeur['nomwiki'])) {
52
        $login = $valeur['nomwiki'] ;
53
    } else {
54
        $login = $valeur['email'] ;
55
    }
56
    $requete = "insert into spip_auteurs set id_auteur=$id, nom=\"".$valeur['prenom']." ".$valeur['nom'].
57
                "\",email=\"".$valeur['email']."\",login=\"".$login.
58
                "\", pass=\"".md5($valeur['password'])."\", statut=\"nouveau\", lang=\"".
59
                strtolower($valeur['pays'])."\"" ;
60
    @mysql_query($requete) or die ("$requete<br>Echec <br>".mysql_error()) ;
61
}
62
 
63
function mod_inscription_spip($id, &$valeur)
64
{
65
    if (isset ($valeur['nomwiki'])) {
66
        $login = $valeur['nomwiki'] ;
67
    } else {
68
        $login = $valeur['email'] ;
69
    }
70
    //BIEN METTRE alea_actuel, htpass ET alea_futur À ""
71
     $requete = "update spip_auteurs set nom=\"".$valeur['prenom']." ".$valeur['nom'].
72
                "\",email=\"".$valeur['email']."\",login=\"".$login.
73
                "\", pass=\"".md5($valeur['password'])."\", htpass=\"\", alea_actuel=\"\", alea_futur=\"\", lang=\"fr\" where id_auteur=$id" ;
74
    //echo $requete;
75
    @mysql_query($requete) or die ("$requete<br>Echec <br>".mysql_error()) ;
76
}
77
function desinscription_spip($id_utilisateur)
78
{
79
     $requete = 'delete from spip_auteurs where id_auteur='.$id_utilisateur ;
80
    @mysql_query($requete) or die ("$requete<br>Echec de la requête de mise à la poubelle de l'utilisateur dans spip <br>".mysql_error()) ;
81
}
82
 
83
 
84
 
85
/* +--Fin du code ----------------------------------------------------------------------------------------+
86
*
87
* $Log: not supported by cvs2svn $
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
?>