Subversion Repositories Applications.papyrus

Rev

Rev 231 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
310 florian 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.2 2005-03-21 16:57:30 florian 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.2 $ $Date: 2005-03-21 16:57:30 $
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/12/15 13:32:25  alex
89
* version initiale
90
*
91
* Revision 1.1  2004/07/06 15:42:17  alex
92
* en cours
93
*
94
* Revision 1.2  2004/06/25 14:25:27  alex
95
* modification de la requete de suppresssion
96
*
97
* Revision 1.1  2004/06/18 09:20:48  alex
98
* version initiale
99
*
100
*
101
* +-- Fin du code ----------------------------------------------------------------------------------------+
102
*/
103
 
104
 
105
 
106
 
107
?>