448 |
ddelon |
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 |
// +------------------------------------------------------------------------------------------------------+
|
1298 |
neiluj |
22 |
// CVS : $Id: inscription.fonct.spip.php,v 1.4 2007-04-11 08:30:12 neiluj Exp $
|
448 |
ddelon |
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
|
1298 |
neiluj |
35 |
*@version $Revision: 1.4 $ $Date: 2007-04-11 08:30:12 $
|
448 |
ddelon |
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.
|
1298 |
neiluj |
58 |
"\", pass=\"".md5($valeur['mot_de_passe'])."\", statut=\"nouveau\", lang=\"".
|
448 |
ddelon |
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.
|
1298 |
neiluj |
73 |
"\", pass=\"".md5($valeur['mot_de_passe'])."\", htpass=\"\", alea_actuel=\"\", alea_futur=\"\", lang=\"fr\" where id_auteur=$id" ;
|
448 |
ddelon |
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 |
function spip_cookie() {
|
|
|
84 |
if ($userid != 0) {
|
1298 |
neiluj |
85 |
setcookie("spip_admin", "@$login", time()+3600*24*30, INS_CHEMIN_SPIP) ;
|
448 |
ddelon |
86 |
include ("ecrire/inc_version.php3");
|
|
|
87 |
include_ecrire ("inc_meta.php3");
|
|
|
88 |
include_ecrire ("inc_session.php3");
|
|
|
89 |
$query = "SELECT * FROM spip_auteurs WHERE id_auteur=$userid";
|
|
|
90 |
$result = mysql_query($query);
|
|
|
91 |
$GLOBALS['auteur_session'] = mysql_fetch_array($result) ;
|
|
|
92 |
$GLOBALS['auteur_session']['statut'] = "1comite" ;
|
|
|
93 |
$GLOBALS['auteur_session']['lang'] = "en" ;
|
|
|
94 |
|
|
|
95 |
if (!$HTTP_COOKIE_VARS["spip_session"]) {
|
|
|
96 |
$id_session = $userid."_".(md5 (uniqid (rand ())));
|
|
|
97 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/vecam/") ;
|
|
|
98 |
} else {
|
|
|
99 |
$id_session = preg_replace("/[0-9]+_/", $userid."_", $HTTP_COOKIE_VARS["spip_session"]) ;
|
|
|
100 |
setcookie("spip_session", $id_session, time()+3600*24*30, "/vecam/") ;
|
|
|
101 |
}
|
|
|
102 |
ajouter_session($GLOBALS['auteur_session'], $id_session) ;
|
|
|
103 |
}
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
107 |
*
|
|
|
108 |
* $Log: not supported by cvs2svn $
|
1298 |
neiluj |
109 |
* Revision 1.2 2006/03/15 11:03:34 alexandre_tb
|
|
|
110 |
* généralisation du code
|
|
|
111 |
*
|
778 |
alexandre_ |
112 |
* Revision 1.1 2005/09/22 14:02:49 ddelon
|
|
|
113 |
* nettoyage annuaire et php5
|
|
|
114 |
*
|
448 |
ddelon |
115 |
* Revision 1.4 2005/09/22 13:30:49 florian
|
|
|
116 |
* modifs pour compatibilité XHTML Strict + corrections de bugs (mais ya encore du boulot!!)
|
|
|
117 |
*
|
|
|
118 |
* Revision 1.2 2005/03/21 16:57:30 florian
|
|
|
119 |
* correction de bug, mise à jour interface
|
|
|
120 |
*
|
|
|
121 |
* Revision 1.1 2004/12/15 13:32:25 alex
|
|
|
122 |
* version initiale
|
|
|
123 |
*
|
|
|
124 |
* Revision 1.1 2004/07/06 15:42:17 alex
|
|
|
125 |
* en cours
|
|
|
126 |
*
|
|
|
127 |
* Revision 1.2 2004/06/25 14:25:27 alex
|
|
|
128 |
* modification de la requete de suppresssion
|
|
|
129 |
*
|
|
|
130 |
* Revision 1.1 2004/06/18 09:20:48 alex
|
|
|
131 |
* version initiale
|
|
|
132 |
*
|
|
|
133 |
*
|
|
|
134 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
135 |
*/
|
|
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
?>
|