Subversion Repositories Sites.tela-botanica.org

Compare Revisions

No changes between revisions

Ignore whitespace Rev 607 → Rev 608

/tags/v4.0/client/inscription/wikini_cookie.php
New file
0,0 → 1,69
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: wikini_cookie.php,v 1.1 2004/07/06 15:42:28 alex Exp $
/**
* Envoie de cookie pour wikini à partir d'une inscription
*
* Envoie de cookie pour wikini à partir d'une inscription
*
*@package inscription
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:28 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// Wikini envoie 3 cookies
// name avec pour valeur le nom wiki de l'utilisateur
// password avec pour valeur le mot de passe crypté de l'utilisateur
// remember la durée du cookie
 
// On fait la même chose
 
if ($userid != "") {
 
// 1. name
// On recherche le nom
$nomwikini = $AUTH->getAuthData('ga_login') ;
setcookie ("name", $nomwikini, time () + 3600 * 24 * 30, "/" ) ; // 1 mois
//2. password
// on recherche le mot de passe crypté
$requete = "select ga_mot_de_passe from gen_annuaire where ga_id_administrateur=$userid" ;
$resultat = $db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Erreur") ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$mot_de_passe = $ligne->ga_mot_de_passe ;
setcookie ("password", $mot_de_passe, time () + 3600 * 24 * 30, "/") ;
// 3. remember
setcookie ("remember", 1, time () + 3600 * 24 * 30, "/") ;
}
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/spip_cookie.php
New file
0,0 → 1,86
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: spip_cookie.php,v 1.1 2004/07/06 15:42:28 alex Exp $
/**
* Envoie de cookie pour SPIP à partir d'une inscription
*
* Envoie de cookie pour SPIP à partir d'une inscription
*
*@package inscription
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:28 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// Ce fichier doit être placé à la racine de SPIP
// Il doit être appellé dans chaque squelette
// après l'ouverture d'une session, si on ouvre une session
 
// Il faut récupérer une valeur userid, c'est à dire
// loggué l'utilisateur par exemple avec PEAR
 
if ($userid != 0) {
 
 
setcookie("spip_admin", "@$login", time()+3600*24*30, "/vecam/") ;
 
include ("ecrire/inc_version.php3");
 
include_ecrire ("inc_meta.php3");
include_ecrire ("inc_session.php3");
$query = "SELECT * FROM spip_auteurs WHERE id_auteur=$userid";
$result = mysql_query($query);
$GLOBALS['auteur_session'] = mysql_fetch_array($result) ;
$GLOBALS['auteur_session']['statut'] = "1comite" ;
$GLOBALS['auteur_session']['lang'] = "en" ;
 
if (!$HTTP_COOKIE_VARS["spip_session"]) {
$id_session = $userid."_".(md5 (uniqid (rand ())));
setcookie("spip_session", $id_session, time()+3600*24*30, "/vecam/") ;
 
} else {
$id_session = preg_replace("/[0-9]+_/", $userid."_", $HTTP_COOKIE_VARS["spip_session"]) ;
setcookie("spip_session", $id_session, time()+3600*24*30, "/vecam/") ;
}
 
ajouter_session($GLOBALS['auteur_session'], $id_session) ;
 
}
 
 
 
 
 
 
 
 
 
 
 
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/bibliotheque/inscription.fonct.php
New file
0,0 → 1,761
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
/**
* Fonctions du module inscription
*
* Fonctions du module inscription
*
*@package inscription
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Id: inscription.fonct.php,v 1.2 2005/03/21 16:50:27 alex Exp $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/**
*
* @param array les valeurs renvoyés par le formulaire
* @return
*/
function demande_inscription ($valeurs) {
// On stocke les informations dans un variable de session
// On coupe l'identifiant de session pour ne prendre que les 8 premiers caractères
// afin d'éviter d'obtenir une url trop longue
$chaine = substr(session_id(), 0, 8) ;
$requete_verif = 'SELECT * '.
'FROM inscription_demande '.
'WHERE id_identifiant_session = "'.$chaine.'" ';
$resultat_verif = $GLOBALS['ins_db']->query($requete_verif);
if ($resultat_verif->numRows() != 0) {
$requete_suppression = 'DELETE FROM inscription_demande WHERE id_identifiant_session="'.$chaine.'"';
$GLOBALS['ins_db']->query($requete_suppression);
}
$requete = 'INSERT INTO inscription_demande '.
'SET id_identifiant_session = "'.$chaine.'", '.
' id_donnees = "'.addslashes(serialize($valeurs)).'", '.
' id_date = NOW()';
$resultat = $GLOBALS['ins_db']->query($requete);
if (DB::isError ($resultat)) {
echo ("Echec de la requete : $requete<br />".$resultat->getMessage());
}
// On envoie un email de confirmation pour l'utilisateur
$GLOBALS['ins_url']->addQueryString('id', $chaine);
$corps = INS_MESSAGE_DEBUT_MAIL_INSCRIPTION;
if (INS_UTILISE_REECRITURE_URL) {
$corps .= 'http://'.$GLOBALS['ins_url']->host.'/'.INS_URL_PREFIXE.$chaine;
} else {
$corps .= str_replace('&amp;', '&', $GLOBALS['ins_url']->getURL());
}
$corps .= INS_MESSAGE_FIN_MAIL_INSCRIPTION;
if (!mail($GLOBALS['email'], 'Inscription', $corps, 'From: '.INS_MAIL_ADMIN_APRES_INSCRIPTION)) {
trigger_error("Le courriel n'a pas été envoyé à : {$GLOBALS['email']}", E_USER_WANRNING);
}
}
 
function AUTH_formulaire_login ($msg = '') {
$res = '';
//--------------------------------------------------------------------------
// Les urls
$url_deja_inscrit = preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()) ;
$GLOBALS['ins_url']->addQueryString('action', 'inscription');
$url_inscription = preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()) ;
$GLOBALS['ins_url']->removeQueryString('action');
//--------------------------------------------------------------------------
// Le formulaire
$form = new HTML_QuickForm ('inscription', 'post', $url_inscription);
$form->addElement ('submit', 'Inscription', INS_INSCRIPTION) ;
$res = '<h1 class="titre1_inscription">'.INS_ACCUEIL_INSCRIPTION.'</h1>';
$res .= $msg ;
$res .= '<h2 class="titre2_inscription">'.INS_LAIUS_INSCRIPTION.'</h2>'."\n" ;
$res .= '<p>'.INS_LAIUS_INSCRIPTION_2.'</p>'."\n" ;
$res .= $form->toHTML() ;
$res .= '<h2 class="titre2_inscription">'.INS_DEJA_INSCRIT.'</h2>' ;
$form = new HTML_QuickForm ('inscription', 'post', $url_deja_inscrit) ;
$form->addElement ('text', 'username', INS_EMAIL) ;
$form->addElement ('password', 'password', INS_MOT_DE_PASSE) ;
$form->addElement('submit', 'valider', INS_VALIDER);
$res .= $form->toHTML() ;
$res .= '<p>'.INS_TEXTE_PERDU.'</p>'."\n" ;
return $res;
}
 
/** message_erreur () - Renvoie le code HTML d'un message d'erreur
*
* Cette page est appelée avec le paramêtre action=mdp_oubli passé dans l'url.
* Elle peut aussi être appelé en cas d'erreur de loggin.
* @return string HTML
*/
function message_erreur ($erreur = true) {
$res = '';
 
// Les urls
$url_deja_inscrit = preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()) ;
$GLOBALS['ins_url']->addQueryString('action', 'sendpasswd');
$url_envoi_mdp = preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()) ;
$GLOBALS['ins_url']->removeQueryString('action');
 
// La page
$res .= '<h1 class="titre1_inscription">'.INS_MDP_PERDU_TITRE.'</h1>' ;
if ($erreur) {
$res .= '<p class="attention">'.INS_ERREUR_LOGIN.'</p>'."\n" ;
}
$res .= '<div class="information">'."\n";
$res .= '<p>'.INS_SI_PASSE_PERDU.'</p>'."\n";
$res .= '<p>'.INS_INDIQUE_ADRESSE.'</p>'."\n";
$res .= '<p>'."\n";
$res .= '<form action="'.$url_envoi_mdp.'" method="post">'."\n";
$res .= '<label for="nom_d_utilisateur">'.INS_EMAIL.'</label>';
$valeur = (isset($_POST['username'])) ? $_POST['username'] : '';
$res .= '<input type="text" id="nom_d_utilisateur" name="nom_d_utilisateur" value="'.$valeur.'" size="32" /></li></ul>'."\n";
$res .= '<input type="submit" value="'.INS_ENVOIE_PASSE.'" />'."\n";
$res .= '</form>'."\n";
$res .= '</p>';
$res .= '</div>';
$res .= '<hr/>';
// On remet le formulaire d'inscription mais un peu réduit
$res .= '<h2 class="titre2_inscription">'.INS_MDP_PERDU_TITRE_RETENTER.'</h2>' ;
$form = new HTML_QuickForm ('inscription', 'post', $url_deja_inscrit) ;
$form->addElement('text', 'username', INS_EMAIL) ;
$form->addElement('password', 'password', INS_MOT_DE_PASSE) ;
$form->addElement('submit', 'valider', INS_VALIDER);
 
// Retour du html
$res .= $form->toHTML() ;
return $res;
}
 
function insertion($valeur) {
// =========== Insertion dans l'annuaire ===================
 
$autres_valeurs = info_annuaire($valeur);
$autres_valeurs[INS_CHAMPS_DATE] = date('Y-m-d');
$autres_valeurs[INS_CHAMPS_MAIL] = $valeur['email'];
switch (INS_MDP_CRYPTYPE) {
case 'md5' :
$autres_valeurs[INS_CHAMPS_PASSE] = md5($valeur['mot_de_passe']);
break;
default :
trigger_error('Type d\'encodage du mot de passe inconnu!', E_USER_ERROR);
}
// Utilisation de AUTH pour ajouter la personne
//$resultat = $GLOBALS['AUTH']->addUser($valeur['email'], $valeur['mot_de_passe'], $autres_valeurs) ;
$champs = '';
$vals = '';
foreach($autres_valeurs as $champ => $val) {
if ($val != '') {
$champs .= $champ.', ';
$vals .= '"'.str_replace('"', '\"', $val).'", ';
}
}
$champs = trim($champs, ', ');
$vals = trim($vals, ', ');
$requete = 'INSERT INTO '.INS_ANNUAIRE.' '.
' ('.$champs.') '.
'VALUES ('.$vals.') ';
$resultat = $GLOBALS['ins_db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
 
// Récupération de l'identifiant de l'inscription
$requete = 'SELECT '.INS_CHAMPS_ID.' '.
'FROM '.INS_ANNUAIRE.' '.
'WHERE '.INS_CHAMPS_MAIL.' = "'.$valeur['email'].'"' ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
$id = $ligne[INS_CHAMPS_ID] ;
 
// ================ Insertion dans SPIP =========================================
if (INS_UTILISE_SPIP) inscription_spip($id, $valeur) ;
 
// Insertion dans les statistiques
if (INS_UTILISE_STAT) {
$requete = 'INSERT INTO '.INS_TABLE_STATISTIQUE.' SET '.INS_STATS_CHAMPS_DATE.' = NOW(), '.INS_STATS_CHAMPS_ACTION.' = "add" ';
$resultat = $GLOBALS['ins_db']->query($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
// si la case pour recevoir la lettre d'actualité est cochée
if(isset($valeur['lettre']))
{
$ajout_abo = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste=actu&mail='.$valeur['email']) ;
}
}
 
/**
* Effectue une mise à jour dans la base de donnée
*
* @global AUTH un objet PEAR:Auth
* @global ins_db un objet PEAR::DB
* @return
*/
function mise_a_jour($valeur) {
// ===================Changement de mail ===================
if($GLOBALS['AUTH']->getUsername() != $valeur['email'])
{
// dans tous les cas on désinscrit la personne de la lettre d'actualité
$supp_abo = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste=actu&mail='.$GLOBALS['AUTH']->getUsername()) ;
// si la case pour recevoir la lettre d'actualité est cochée
if(isset($valeur['lettre']))
{
$ajout_abo = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste=actu&mail='.$valeur['email']) ;
}
// si le mail n'a pas changé
} else {
// si la case pour recevoir la lettre d'actualité est cochée
if(isset($valeur['lettre'])) {
// on abonne la personne
$ajout_abo = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste=actu&mail='.$valeur['email']) ;
}
else {
// sinon on désinscrit la personne de la lettre d'actualité
$supp_abo = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste=actu&mail='.$valeur['email']) ;
}
}
// ====================Mise à jour dans l'annuaire ====================
$requete = 'UPDATE '.INS_ANNUAIRE.' '.
'SET '.requete_annuaire($valeur).' '.
'WHERE '.INS_CHAMPS_ID.' = "'.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID).'"';
$resultat = $GLOBALS['ins_db']->query($requete) ;
if (DB::isError($resultat)) {
return ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
else
{
if($GLOBALS['AUTH']->getUsername() != $valeur['email']) {
$GLOBALS['AUTH']->setAuth($valeur['email']) ;
}
}
if (isset($valeur['lettre'])) {
// On appelle cette fonction pour mettre à jour
$GLOBALS['AUTH']->setAuthData(INS_CHAMPS_LETTRE, $valeur['lettre'], true);
}
// la valeur de session (récupéré par getAuthData()
unset($resultat);
// ========================= Mise à jour dans SPIP ================================
if (INS_UTILISE_SPIP) mod_inscription_spip($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)) ;
}
 
/** requete_annuaire () - Renvoie une chaine contenant les champs de l'annuaire avec leur valeur suite à le fonction process de QuickForm
*
* @return string une requete du type champs="valeur",...
*/
function requete_annuaire(&$valeur) {
if (!isset($valeur['lettre'])) {
$valeur['lettre'] = 0;
}
if (preg_match ('/([0-9][0-9])[0-9][0-9][0-9]/', $valeur['cp'], $match)) {
$valeur['dpt'] = $match[1];
if (preg_match ('/(97[0-9])[0-9][0-9]/', $valeur['cp'], $match2)) {
$valeur['dpt'] = $match2[1];
}
}
foreach($valeur as $champ => $val) {
$valeur[$champ] = str_replace('"', '\"', $val);
}
$req = INS_CHAMPS_NOM.'="'.$valeur['nom'].'",'.
INS_CHAMPS_PRENOM.'="'.$valeur['prenom'].'",'.
INS_CHAMPS_MAIL.'="'.$valeur['email'].'",'.
INS_CHAMPS_PASSE.'="'.md5 ($valeur['mot_de_passe']).'",'.
INS_CHAMPS_PAYS.'="'.$valeur['pays'].'", '.
INS_CHAMPS_CODE_POSTAL.'="'.$valeur['cp'].'", '.
INS_CHAMPS_VILLE.'="'.$valeur['ville'].'", '.
INS_CHAMPS_ADRESSE_1.'="'.$valeur['adresse_1'].'", '.
INS_CHAMPS_ADRESSE_2.'="'.$valeur['adresse_2'].'", '.
INS_CHAMPS_REGION.'="'.$valeur['region'].'", '.
INS_CHAMPS_STRUCTURE.'="'.$valeur['organisme'].'", '.
INS_CHAMPS_SITE_WEB.'="'.$valeur['site'].'", '.
INS_CHAMPS_LETTRE.'="'.$valeur['lettre'].'", '.
'U_FONCTION="'.$valeur['fonction'].'", '.
'U_NIV="'.$valeur['niveau'].'", '.
'U_ACT="'.$valeur['activite'].'", '.
'U_ASS="'.$valeur['asso'].'", '.
'U_SPE="'.$valeur['specialite'].'", '.
'U_GEO="'.$valeur['specialite_geo'].'" ';
if (isset($valeur['dpt'])) {
$req .= ','.INS_CHAMPS_DPT.' = "'.$valeur['dpt'].'"' ;
}
return $req ;
}
 
/**
* renvoie un tableau avec en clé les champs de la base et en valeur les valeurs saisies dans le formulaire
*
* @return array renvoie un tableau avec en clé les champs de la base et en valeur les valeurs saisies dans le formulaire
*/
function info_annuaire($valeur) {
// Petit code pour recupere le num de dpt a partir du cp pour les français
if (preg_match('/^(?:fr|mc)$/', $valeur['pays'])) {
if (preg_match('/(\d{2})\d{3}/', $valeur['cp'], $match)) {
$valeur['dpt'] = $match[1];
if (preg_match('/((?:97|98)\d)\d{2}/', $valeur['cp'], $match2)) {
$valeur['dpt'] = $match2[1];
}
}
}
$tableau = array (
INS_CHAMPS_ID => nextId(INS_ANNUAIRE, INS_CHAMPS_ID, $GLOBALS['ins_db']),
INS_CHAMPS_NOM => addslashes($valeur['nom']),
INS_CHAMPS_PRENOM => addslashes($valeur['prenom']),
INS_CHAMPS_PAYS => $valeur['pays'],
INS_CHAMPS_CODE_POSTAL => $valeur['cp'],
INS_CHAMPS_DPT => $valeur['dpt'],
INS_CHAMPS_VILLE => addslashes($valeur['ville']),
INS_CHAMPS_ADRESSE_1 => addslashes($valeur['adresse_1']),
INS_CHAMPS_ADRESSE_2 => addslashes($valeur['adresse_2']),
INS_CHAMPS_REGION => addslashes($valeur['region']),
INS_CHAMPS_SITE_WEB => $valeur['site'],
'U_FONCTION' => addslashes($valeur['fonction']),
'U_NIV' => $valeur['niveau'],
'U_ACT' => $valeur['activite'],
'U_ASS' => $valeur['asso'],
'U_SPE' => addslashes($valeur['specialite']),
'U_GEO' => addslashes($valeur['specialite_geo'])
);
if (INS_UTILISE_LISTE){
$tableau[INS_CHAMPS_LETTRE] = $valeur['lettre'];
}
return $tableau ;
}
 
/** formulaire_defaults () - Renvoie un tableau avec les valeurs par défaut du formulaire d'inscription
*
* @return array Valeurs par défaut du formulaire d'inscription
*/
function formulaire_defaults () {
$requete = 'SELECT '.INS_ANNUAIRE.'.* '.
'FROM '.INS_ANNUAIRE.' '.
'WHERE '.INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'= "'.$GLOBALS['AUTH']->getAuthData (INS_CHAMPS_ID).'"' ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
$valeurs_par_defaut = array() ;
$valeurs_par_defaut['email'] = $ligne[INS_CHAMPS_MAIL];
$valeurs_par_defaut['nom'] = $ligne[INS_CHAMPS_NOM];
$valeurs_par_defaut['prenom'] = $ligne[INS_CHAMPS_PRENOM] ;
$valeurs_par_defaut['pays'] = $ligne[INS_CHAMPS_PAYS] ;
$valeurs_par_defaut['nomwiki'] = $ligne[INS_CHAMPS_LOGIN] ;
$valeurs_par_defaut['cp'] = $ligne[INS_CHAMPS_CODE_POSTAL] ;
$valeurs_par_defaut['ville'] = $ligne[INS_CHAMPS_VILLE] ;
$valeurs_par_defaut['adresse_1'] = $ligne[INS_CHAMPS_ADRESSE_1] ;
$valeurs_par_defaut['adresse_2'] = $ligne[INS_CHAMPS_ADRESSE_2] ;
$valeurs_par_defaut['region'] = $ligne[INS_CHAMPS_REGION] ;
$valeurs_par_defaut['structure'] = $ligne[INS_CHAMPS_STRUCTURE] ;
$valeurs_par_defaut['site'] = $ligne['U_WEB'] ;
$valeurs_par_defaut['organisme'] = $ligne['U_TITLE'] ;
$valeurs_par_defaut['fonction'] = $ligne['U_FONCTION'] ;
$valeurs_par_defaut['niveau'] = $ligne['U_NIV'] ;
$valeurs_par_defaut['activite'] = $ligne['U_ACT'] ;
$valeurs_par_defaut['asso'] = $ligne['U_ASS'] ;
$valeurs_par_defaut['specialite'] = $ligne['U_SPE'] ;
$valeurs_par_defaut['specialite_geo'] = $ligne['U_GEO'] ;
if (INS_UTILISE_LISTE){
$valeurs_par_defaut['lettre'] = $ligne[INS_CHAMPS_LETTRE] ;
}
return $valeurs_par_defaut ;
}
 
function info() {
$requete = 'SELECT * from '.INS_ANNUAIRE.', '.INS_TABLE_PAYS.', annuaire_LABEL_ACT, annuaire_LABEL_NIV, annuaire_LABEL_ASS '.
'WHERE '.INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'="'.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID).'" '.
'AND '.INS_CHAMPS_PAYS.'='.INS_CHAMPS_ID_PAYS.' '.
'AND U_ACT=ID_LABEL_ACT '.
'AND U_NIV=ID_LABEL_NIV '.
'AND U_ASS=ID_LABEL_ASS ';
$resultat = $GLOBALS['ins_db'] -> query ($requete) ;
if (DB::isError ($resultat)) {
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
 
$ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC) ;
$res = '<h1 class="inscription_titre1">'.INS_MESSAGE_BIENVENU."</h1>\n" ;
$res .= "<h2 class=\"inscription_titre2\">".INS_FICHE_PERSONNELLE."</h2>\n" ;
$res .= '<dl>' ;
$res .= ligne_inscription (INS_EMAIL, $ligne[INS_CHAMPS_MAIL]) ;
$res .= ligne_inscription (INS_NOM, $ligne[INS_CHAMPS_NOM]) ;
$res .= ligne_inscription (INS_PRENOM, $ligne[INS_CHAMPS_PRENOM]) ;
$res .= ligne_inscription (INS_ADRESSE_1, $ligne[INS_CHAMPS_ADRESSE_1]) ;
$res .= ligne_inscription (INS_ADRESSE_2, $ligne[INS_CHAMPS_ADRESSE_2]) ;
$res .= ligne_inscription (INS_REGION, $ligne[INS_CHAMPS_REGION]) ;
$res .= ligne_inscription (INS_CODE_POSTAL, $ligne[INS_CHAMPS_CODE_POSTAL]) ;
$res .= ligne_inscription (INS_VILLE, $ligne[INS_CHAMPS_VILLE]) ;
$res .= ligne_inscription (INS_PAYS, $ligne[INS_CHAMPS_LABEL_PAYS]) ;
$res .= ligne_inscription (INS_SITE_INTERNET, $ligne[INS_CHAMPS_SITE_WEB]) ;
if($ligne[INS_CHAMPS_LETTRE]) {
$res .= ligne_inscription (INS_LETTRE_INSCRIT, INS_LETTRE_INSCRIT_OUI) ;
}
else {
$res .= ligne_inscription (INS_LETTRE_INSCRIT, INS_LETTRE_INSCRIT_NON) ;
}
$res .= '</dl>' ;
//$res .= "<div>".INS_NOM_WIKI." : ".$ligne[INS_CHAMPS_LOGIN]."</div>\n" ;
$res .= '<h2 class="inscription_titre2">'.INS_ADHERENT.'</h2>' ;
$res .= '<dl>' ;
$res .= ligne_inscription (INS_ORGANISME, $ligne['U_TITLE']) ;
$res .= ligne_inscription (INS_FONCTION, $ligne['U_FONCTION']) ;
$res .= '</dl>' ;
$res .= '<h2 class="inscription_titre2">'.INS_ETES_BOTANISTE.'</h2>' ;
$res .= '<div>'.$ligne['LABEL_NIV'].'</div>'."\n" ;
$res .= '<h2 class="inscription_titre2">'.INS_ACTIVITE_PROFESSIONNELLE.'</h2>' ;
$res .= '<div>'.$ligne['LABEL_ACT'].'</div>'."\n" ;
$res .= '<h2 class="inscription_titre2">'.INS_MEMBRE_ASSO.'</h2>' ;
$res .= '<div>'.$ligne['LABEL_ASS'].'</div>'."\n" ;
$res .= '<h2 class="inscription_titre2">'.INS_SPECIALISTE.'</h2>' ;
$res .= '<div>'.$ligne['U_SPE'].'</div>'."\n" ;
$res .= '<h2 class="inscription_titre2">'.INS_SPE_ZONE.'</h2>' ;
$res .= '<div>'.$ligne['U_GEO'].'</div>'."\n" ;
return $res ;
}
 
/**
*
*
* @return
*/
function ligne_inscription ($label, $valeur)
{
if ($valeur == '') {
$valeur = '&nbsp;' ;
}
return '<dt>'.$label.'</dt><dd>'.$valeur.'</dd>' ;
}
 
function bouton($url)
{
$boutons = new HTML_QuickForm('inscription', 'post', $url) ; ;
//confirmation() ;
$buttons[] = &HTML_QuickForm::createElement('submit', 'modifier', INS_MODIFIER_INSCRIPTION);
$buttons[] = &HTML_QuickForm::createElement('submit', 'supprimer', INS_SUPPRIMER_INSCRIPTION,
array ('onclick' => "javascript:return confirm('".INS_SUPPRIMER_INSCRIPTION." ?');"));
$boutons->addGroup($buttons, null, null, '&nbsp;');
$boutons->addElement('hidden', 'id_utilisateur', $GLOBALS['AUTH']->getAuthData (INS_CHAMPS_ID));
return $boutons->toHTML();
}
 
/**
* Renvoie un lien pour se déconnex=cter
*
* @return string
*/
function deconnexion ($url)
{
// Un champs logout
return '<div><a href="'.$url.'&amp;logout=1">'.INS_DECONNEXION.'</a></div>';
}
 
function verif_doublonMail($mail)
{
if (isset ($GLOBALS['AUTH']) && $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) != '') {
$requete_mail = "select ".INS_CHAMPS_MAIL." from ".INS_ANNUAIRE." where ".INS_CHAMPS_ID."=".$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
$resultat_mail = $GLOBALS['ins_db']->query($requete_mail) ;
if (DB::isError ($resultat_mail)) {
die ("Echec de la requete : $requete_mail<br />".$resultat_mail->getMessage()) ;
}
$ligne_mail = $resultat_mail->fetchRow(DB_FETCHMODE_ASSOC) ;
if ($mail == $ligne_mail[INS_CHAMPS_MAIL]) {
return true ;
}
}
$requete = "select ".INS_CHAMPS_MAIL." from ".INS_ANNUAIRE." where ".INS_CHAMPS_MAIL."= \"$mail\"" ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError ($resultat)) {
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
if ($resultat->numRows() == 0) {
return true ;
}
return false ;
}
 
function envoie_passe()
{
$headers['From'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ;
$headers['Subject'] = INS_NOUVEAU_MOT_DE_PASSE;
 
$nouveau_passe = create_new_random(6) ;
 
$body = INS_NOUVEAU_MOT_DE_PASSE_2.$nouveau_passe ;
$body .= INS_NOUVEAU_MOT_DE_PASSE_LAIUS ;
 
// modification du mot de passe dans la base
$requete = "update ".INS_ANNUAIRE." set ".INS_CHAMPS_PASSE."=MD5(\"$nouveau_passe\") where ".INS_CHAMPS_MAIL."=\"".$_POST['nom_d_utilisateur']."\"" ;
 
$resultat = $GLOBALS['ins_db']->query($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
// On teste si l'email est présent dans la base
if ($GLOBALS['ins_db']->affectedRows() == 0) {
return '<div class="erreur">Il n\'y a pas d\'inscrit avec cet email</div>'."\n" ;
}
 
// création du mail
if (!mail ($_POST['nom_d_utilisateur'], $headers['Subject'], $body)) {
return 'erreur lors de l\'envoie de mail' ;
}
 
return "<div class=\"titre1_inscription\">".INS_MOT_DE_PASSE_ENVOYE_1." ".$_POST['nom_d_utilisateur']."</div>\n".
"<div><br>".INS_MOT_DE_PASSE_ENVOYE_2."</div>\n";
}
 
/**
*
* @global ins_db Un pointeur vers un objet PEAR::DB connecté
* @return
*/
function envoie_mail()
{
$requete = 'SELECT *, '.INS_CHAMPS_LABEL_PAYS.' '.
'FROM '.INS_ANNUAIRE.','.INS_TABLE_PAYS.', annuaire_LABEL_ACT, annuaire_LABEL_NIV, annuaire_LABEL_ASS '.
'WHERE '.INS_CHAMPS_MAIL.' = "'.$GLOBALS['AUTH']->getUsername().'" '.
'AND '.INS_CHAMPS_ID_PAYS.'='.INS_CHAMPS_PAYS.' '.
'AND U_ACT=ID_LABEL_ACT '.
'AND U_NIV=ID_LABEL_NIV '.
'AND U_ASS=ID_LABEL_ASS ';
$resultat = $GLOBALS['ins_db']->query($requete);
if (DB::isError ($resultat)) {
die ("Echec de la requete : $requete<br />".$resultat->getMessage());
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
$body = INS_MAIL_COORD_CORPS."\n" ;
$body .= "------------------------------------------\n";
$body .= INS_EMAIL.unhtmlentities($ligne[INS_CHAMPS_MAIL])." \n" ;
$body .= INS_NOM.unhtmlentities($ligne[INS_CHAMPS_NOM])." \n" ;
$body .= unhtmlentities(INS_PRENOM).unhtmlentities($ligne[INS_CHAMPS_PRENOM])." \n" ;
$body .= INS_PAYS.unhtmlentities($ligne[INS_CHAMPS_LABEL_PAYS])." \n" ;
$body .= INS_ADRESSE_1.unhtmlentities($ligne[INS_CHAMPS_ADRESSE_1])." \n" ;
$body .= INS_ADRESSE_2.unhtmlentities($ligne[INS_CHAMPS_ADRESSE_2])." \n" ;
$body .= unhtmlentities(INS_REGION).unhtmlentities($ligne[INS_CHAMPS_REGION])." \n" ;
$body .= INS_CODE_POSTAL.unhtmlentities($ligne[INS_CHAMPS_CODE_POSTAL])." \n" ;
$body .= INS_VILLE.unhtmlentities($ligne[INS_CHAMPS_VILLE])." \n" ;
$body .= INS_SITE_INTERNET.unhtmlentities($ligne[INS_CHAMPS_SITE_WEB])." \n" ;
$body .= INS_ORGANISME.unhtmlentities($ligne['U_TITLE'])." \n" ;
$body .= INS_FONCTION.unhtmlentities($ligne['U_FONCTION'])." \n" ;
$body .= unhtmlentities(INS_ETES_BOTANISTE).unhtmlentities($ligne['LABEL_NIV'])." \n" ;
$body .= unhtmlentities(INS_ACTIVITE_PROFESSIONNELLE).unhtmlentities($ligne['LABEL_ACT'])." \n" ;
$body .= unhtmlentities(INS_MEMBRE_ASSO).unhtmlentities($ligne['LABEL_ASS'])." \n" ;
$body .= unhtmlentities(INS_SPECIALISTE).unhtmlentities($ligne['U_SPE'])." \n" ;
$body .= unhtmlentities(INS_SPE_ZONE).unhtmlentities($ligne['U_GEO'])." \n" ;
$body .= "-------------------------------------------\n" ;
 
// Envoi du mail aux administrateur du site
if ($ligne[INS_CHAMPS_MAIL] != '') {
$headers ['From'] = INS_MAIL_ADMIN_APRES_INSCRIPTION;
$headers ['Reply-To'] = INS_MAIL_ADMIN_APRES_INSCRIPTION;
$headers ['Subject'] = INS_MAIL_COORD_SUJET;
$mail =& Mail::factory('mail') ;
$mail->send($ligne[INS_CHAMPS_MAIL], $headers, $body) ;
// Pour les admins
$body .= INS_MESSAGE_APPLI."\n" ;
foreach ($GLOBALS['mail_admin'] as $administrateur) {
$envoi = $mail->send($administrateur, $headers, $body) ;
if (PEAR::isError($envoi)) {
trigger_error($envoi->getMessage(), E_USER_WARNING);
}
}
}
return true ;
}
 
/**
*
*
* @return
*/
 
function message_inscription () {
return INS_MESSAGE_INSCRIPTION;
}
 
/**
* Inscrit un adhérent à la lettre d'actualité par l'envoie d'un email subscribe / unsubscribe
* à la liste
*
* @global AUTH Un objet PEAR::Auth
* @return boolean true en cas de succès
*/
function inscription_lettre ($action) {
$mail =& Mail::factory('smtp');
$email = $GLOBALS['AUTH']->getUsername();
$headers ['Return-Path'] = $email;
$headers ['From'] = '<'.$email.'>';
$headers ['Subject'] = $action;
$headers ['Reply-To'] = $email;
$mail->send($action, $headers, '');
if (PEAR::isError($mail)) {
echo '<p class="erreur">Le mail n\'est pas parti...</p>';
return false;
}
return true;
}
 
/**
* Génère un nom wiki valide à partir des données saisies par l'utilisateur
* fait une requete dans la base
*
* @return string un nom wiki valide
*/
function genere_nom_wiki ($nom, $prenom) {
// 1. suppression des espaces
$nom = trim ($nom) ;
$prenom = trim ($prenom) ;
// 2. suppression des caractères non ascii et ajout de la première lettre en majuscule
$nom = trim_non_ascii ($nom) ;
$prenom = trim_non_ascii ($prenom) ;
// Vérification
$nom_wiki = $nom.$prenom ;
if (!preg_match('/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/', $nom_wiki)) {
$nom_wiki = chr(rand(65, 90)).$nom_wiki.chr(rand(65, 90)) ;
}
return $nom_wiki ;
}
 
/**
*
*
* @return
*/
function trim_non_ascii ($nom) {
$premiere_lettre = true ;
for ($i = 0; $i < strlen ($nom); $i++) {
if (!preg_match ('/[a-zA-Z0-9]/', $nom[$i])) {
// str_replace ($nom[$i], '_', $nom, 1) ;
}
// remplacement de la première lettre en majuscule
if (preg_match ('/[a-zA-Z]/', $nom[$i]) && $premiere_lettre) {
$nom[$i] = strtoupper ($nom[$i]) ;
$premiere_lettre = false ;
} else {
if (preg_match ('/[a-zA-Z]/', $nom[$i])) {
$nom[$i] = strtolower ($nom[$i]) ;
}
}
}
$nom = trim ($nom, '_') ;
return $nom ;
}
 
// For users prior to PHP 4.3.0 you may do this:
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
 
/* ***********************************
create_new_random($n,$type) permet de générer un nombre de caractères aléatoires.
 
ENTREE :
- $n : créer un 'mot' de $n caractères
- $type : permet de définir la liste des caractères disponibles
 
SORTIE : chaine de $n caractères pris dans une liste $type
*********************************** */
function create_new_random($n,$type="")
{
$str = "";
 
switch ($type){
//liste des caractères possibles en virant ceux qui se ressemblent (ijl1oO0)
// case "":
// {
// }
// break;
default:{
$chaine = "abcdefghkmnpqrstuvwxyzABCDEFGHKLMNPQRSTUVWXYZ23456789";
}
break;
}
srand((double)microtime()*1000000);
for($i = 0; $i < $n; $i++){
$str .= $chaine[rand()%strlen($chaine)];
}
return "$str";
}
 
//==============================================================================
/** function nextId () Renvoie le prochain identifiant numérique libre d'une table
*
* On passe en paramètre le nom de la table et l'identifiant de la base selon PEAR DB
*
* @param mixed handler de connexion
* @param string Nom de la table
* return interger l'identifiant
*/
 
function nextId ($table, $colonne_identifiant, $db)
{
$requete = "select MAX($colonne_identifiant) as maxi from $table" ;
$resultat = $db->query($requete) ;
if (DB::isError($resultat)) {
die (__FILE__ . __LINE__ . $resultat->getMessage() . $requete);
return $db->raiseError($resultat) ;
}
if ($resultat->numRows() > 1) {
return $db->raiseError("<br/>La table $table a un identifiant non unique<br/>") ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
return $ligne->maxi + 1 ;
}
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/bibliotheque/ins_spip.fonct.php
New file
0,0 → 1,104
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ins_spip.fonct.php,v 1.1 2005/03/04 10:39:30 tam Exp $
/**
* Fonctions wikini
*
* Ce fichier propose 3 fonctions pour intervenir sur la table interwikini_users.
*
*@package inscription
*@subpackage fonctions_wikini
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005/03/04 10:39:30 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
function inscription_spip($id, $valeurs)
{
// Requete pour inscrire dans SPIP
$requete = "insert into ".INS_BDD_SPIP.".spip_auteurs set id_auteur=$id, nom=\"".$valeurs['prenom']." ".$valeurs['nom'].
"\",email=\"".$valeurs['email']."\",login=\"".$valeurs['email'].
"\", pass=\"".md5($valeurs['mot_de_passe'])."\", statut=\"1comite\", lang=\"".
strtolower($valeurs['pays'])."\"" ;
$GLOBALS['ins_db']->query($requete) ;
 
}
 
function mod_inscription_spip($id)
{
global $HTTP_POST_VARS ;
//BIEN METTRE alea_actuel, htpass ET alea_futur À ""
$requete = "update ".INS_BDD_SPIP.".spip_auteurs set nom=\"".$HTTP_POST_VARS['prenom']." ".$HTTP_POST_VARS['nom'].
"\",email=\"".$HTTP_POST_VARS['email']."\",login=\"".$HTTP_POST_VARS['email'].
"\", pass=\"".md5($HTTP_POST_VARS['mot_de_passe'])."\", htpass=\"\", alea_actuel=\"\", alea_futur=\"\", lang=\"en\" where id_auteur=$id" ;
//echo $requete;
$GLOBALS['ins_db']->query($requete) ;
}
 
function desinscription_spip($id_utilisateur)
{
//BIEN METTRE alea_actuel, htpass ET alea_futur À ""
$requete = 'DELETE FROM '.INS_BDD_SPIP.'.spip_auteurs WHERE id_auteur='.$id_utilisateur ;
//echo $requete;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError ($resultat)) {
return "Echec de la requete : $requete<br />".$resultat->getMessage() ;
}
}
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: ins_spip.fonct.php,v $
* Revision 1.1 2005/03/04 10:39:30 tam
* installation
*
* Revision 1.1 2004/07/06 15:42:17 alex
* en cours
*
* Revision 1.2 2004/06/25 14:25:27 alex
* modification de la requete de suppresssion
*
* Revision 1.1 2004/06/18 09:20:48 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
 
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/bibliotheque/ins_wiki.fonct.php
New file
0,0 → 1,101
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ins_wiki.fonct.php,v 1.1 2004/07/06 15:42:17 alex Exp $
/**
* Fonctions wikini
*
* Ce fichier propose 3 fonctions pour intervenir sur la table interwikini_users.
*
*@package inscription
*@subpackage fonctions_wikini
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
 
function inscription_interwikini_users($nom, $valeur) {
$requete = "insert into ".INS_BDD_WIKINI.".interwikini_users set name=\"".$nom.
"\", password=\"".md5($valeur['mot_de_passe'])."\", email=\"".$valeur['email']."\"" ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete dans interwikini_users<br />".$resultat->getMessage()) ;
}
}
 
function mod_inscription_interwikini_users($nomwiki, $valeur) {
$requete = "update ".INS_BDD_WIKINI.".interwikini_users set password=\"".md5($valeur['mot_de_passe'])."\", email=\"".$valeur['email']."\"".
" where name=\"$nomwiki\"" ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
echo ("Echec de la requete dans interwikini_users<br />".$resultat->getMessage()) ;
}
}
 
function desinscription_interwikini_users($nomwiki) {
$requete = "delete from ".INS_BDD_WIKINI.".interwikini_users where name=\"$nomwiki\"" ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
echo ("Echec de la requete dans interwikini_users<br />".$resultat->getMessage()) ;
}
}
 
function verif_doublonNomWiki($nom_wiki) {
$requete = "select name from ".INS_BDD_WIKINI.".interwikini_users where name = \"$nom_wiki\"" ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError ($resultat)) {
echo ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
if ($resultat->numRows() == 0) return true ;
return false ;
}
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: ins_wiki.fonct.php,v $
* Revision 1.1 2004/07/06 15:42:17 alex
* en cours
*
* Revision 1.1 2004/06/18 09:20:48 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
 
 
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/bibliotheque/inscription.class.php
New file
0,0 → 1,336
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
/**
* Fonctions du module inscription
*
* Fonctions du module inscription
*
*@package inscription
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Id: inscription.class.php,v 1.3 2005/05/13 13:48:38 alex Exp $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
class HTML_formulaireInscription extends HTML_Quickform {
var $mode_ajout = true;
/**
* Constructeur
*
* @param string formName Le nom du formulaire
* @param string method Méthode post ou get
* @param string action L'action du formulaire.
* @param int target La cible.
* @param Array attributes Les attributs HTML en plus.
* @param bool trackSubmit ??
* @return void
* @access public
*/
function HTML_forumlaireInscription ( $formName, $method = "post", $action, $target = "_self", $attributes, $trackSubmit = false ) {
HTML_Quickform::HTML_Quickform($formName, $method, $action, $target, $attributes, $trackSubmit) ;
}
 
/**
*
*
* @return void
* @access public
*/
function construitFormulaire($url, $liste_pays) {
$squelette =& $this->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
$modele_element_debut = '<li class="groupe_formulaire">'."\n".'<span class="inscription_label1">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
"\n".'{element}'."\n".''."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
''."\n" ;
$modele_element_fin = "\n".'<span class="inscription_label2">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
"\n".'{element}'."\n".''."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n" ;
$squelette->setElementTemplate( '<li class="liste_inscription">'."\n".'<span class="inscription_label">{label}<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required --></span>'.
"\n".'{element}'."\n".''."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
//$squelette->setElementTemplate(, ) ;
// Les modèles pour les champs qui se tienne 2 par ligne
foreach (array('mot_de_passe', 'nom', 'cp') as $valeur) $squelette->setElementTemplate( $modele_element_debut, $valeur);
foreach (array('password_repete', 'prenom', 'ville') as $valeur) $squelette->setElementTemplate( $modele_element_fin, $valeur);
$squelette->setElementTemplate( '<ul><li class="groupe_bouton">{element}', 'annuler');
$squelette->setElementTemplate( '{element}</li></ul>', 'valider');
$squelette->setRequiredNoteTemplate("\n".'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'."\n");
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.(($this->mode_ajout) ? INS_AJOUT_MEMBRE : INS_MODIF_MEMBRE).'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
$this->addElement ('text', 'email', INS_EMAIL) ;
$this->addRule ('email', INS_EMAIL_REQUIS, 'required','', 'client') ;
$this->addRule ('email', INS_MAIL_INCORRECT, 'email', '', 'client') ;
$this->registerRule('doublon', 'callback', 'verif_doublonMail') ;
$this->addRule ('email', INS_MAIL_DOUBLE, 'doublon', true) ;
$this->addElement('password', 'mot_de_passe', INS_MOT_DE_PASSE);
$this->addElement('password', 'password_repete', INS_REPETE_MOT_DE_PASSE);
$this->addRule ('mot_de_passe', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
$this->addRule ('password_repete', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
$this->addElement('text', 'nom', INS_NOM);
$this->addElement('text', 'prenom', INS_PRENOM);
$this->addRule ('nom', INS_NOM_REQUIS, 'required', '', 'client') ;
$this->addRule ('prenom', INS_PRENOM_REQUIS, 'required', '', 'client') ;
$this->addElement ('text', 'adresse_1', INS_ADRESSE_1) ;
$this->addElement ('text', 'adresse_2', INS_ADRESSE_2) ;
$this->addElement ('text', 'region', INS_REGION) ;
$this->addElement('text', 'cp', INS_CODE_POSTAL) ;
$this->addElement('text', 'ville', INS_VILLE) ;
$this->addRule ('cp', INS_CODE_POSTAL_REQUIS, 'required', '', 'client') ;
$this->addRule ('ville', INS_VILLE_REQUIS, 'required', '', 'client') ;
// L'élément pays est construit à partir de la table des pays
$s =& $this->createElement('select','pays',INS_PAYS);
$s->loadArray($liste_pays,'fr');
$this->addElement($s);
if (INS_UTILISE_LISTE) {
$element_lettre = &new HTML_QuickForm_checkbox ('lettre', '', INS_LETTRE) ;
$this->addElement($element_lettre) ;
}
$this->addElement ('text', 'site', INS_SITE_INTERNET) ;
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.INS_ADHERENT.'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
$this->addElement ('text', 'organisme', INS_ORGANISME) ;
$this->addElement ('text', 'fonction', INS_FONCTION) ;
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.INS_ETES_BOTANISTE.'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
// requete pour trouver les niveaux en botanique
$requete = 'SELECT * FROM annuaire_LABEL_NIV';
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->addElement ('radio', 'niveau', '', $ligne->LABEL_NIV, $ligne->ID_LABEL_NIV) ;
}
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
// L'activité professionnelle
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.INS_ACTIVITE_PROFESSIONNELLE.'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
// Requete pour trouver les niveaux en botanique
$requete = 'SELECT * FROM annuaire_LABEL_ACT';
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->addElement ('radio', 'activite', '', $ligne->LABEL_ACT, $ligne->ID_LABEL_ACT) ;
}
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
// L'activité professionnelle
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.INS_MEMBRE_ASSO.'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
// Requete pour trouver les niveaux en botanique
$requete = 'SELECT * FROM annuaire_LABEL_ASS';
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->addElement ('radio', 'asso', '', $ligne->LABEL_ASS, $ligne->ID_LABEL_ASS) ;
}
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
// Les spécialité
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.INS_SPECIALISTE.'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
$this->addElement ('textarea', 'specialite', '', array ('cols' => 50, 'rows' => 4)) ;
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
// Les spécialité géographiques
$fieldset_debut = '<fieldset>'."\n".
'<legend>'.INS_SPE_ZONE.'</legend>'."\n".
'<ul>'."\n";
$this->addElement('html', $fieldset_debut);
$this->addElement ('textarea', 'specialite_geo', '', array ('cols' => 50, 'rows' => 4)) ;
$fieldset_fin = '</ul>'."\n".
'</fieldset>'."\n";
$this->addElement('html', $fieldset_fin);
if (!$this->mode_ajout) {
$this->addElement ('link', 'annuler', '', preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()), INS_ANNULER) ;
}
$this->addElement ('submit', 'valider', INS_VALIDER) ;
$this->setRequiredNote(INS_NOTE_REQUIS) ;
}
/** Modifie le formulaire pour l'adapter au cas des structures
*
*
* @return void
* @access public
*/
function formulaireStructure() {
$this->removeElement('email', false) ;
$mail = & HTML_QuickForm::createElement ('text', 'email', INS_MAIL_STRUCTURE) ;
$this->insertElementBefore ($mail, 'mot_de_passe') ;
$nom_structure = & HTML_QuickForm::createElement ('text', 'nom', INS_NOM_STRUCTURE) ;
$this->insertElementBefore ($nom_structure, 'email') ;
$this->removeElement ('site', false) ;
$site_structure = & HTML_QuickForm::createElement ('text', 'site', INS_SITE_STRUCTURE) ;
$this->insertElementBefore ($site_structure, 'pays') ;
$this->addElement ('hidden', 'est_structure', 1) ;
$sigle_structure = & HTML_QuickForm::createElement ('text', 'sigle_structure', INS_SIGLE_STRUCTURE) ;
$this->insertElementBefore ($sigle_structure, 'nom') ;
$this->addRule ('sigle_structure', INS_SIGLE_REQUIS, 'required', '', 'client') ;
}
/**
*
*
* @return string
* @access public
*/
function toHTML( ) {
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
}
 
class ListeDePays extends PEAR{
 
var $_db ;
/** Constructeur
* Vérifie l'existance de la table gen_pays_traduction
*
* @param DB Un objet PEAR::DB
* @return
*/
function ListeDePays (&$objetDB) {
$this->_db = $objetDB ;
$requete = 'SHOW TABLES';
$resultat = $objetDB->query($requete) ;
if (DB::isError ($resultat)) {
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
while ($ligne = $resultat->fetchRow()) {
if ($ligne[0] == INS_TABLE_PAYS) {
return ;
}
}
return $this->raiseError('La table '.INS_TABLE_PAYS.' n\'est pas présente dans la base de donnée !') ;
}
/** Renvoie la liste des pays traduite
*
* @param string une chaine de type i18n ou une chaine code iso langue (fr_FR ou fr ou FR)
* @return un tableau contenant en clé, le code iso du pays, en majuscule et en valeur le nom du pays traduit
*/
function getListePays ($i18n) {
if (strlen($i18n) == 2) {
$i18n = strtolower($i18n).'-'.strtoupper($i18n) ;
}
$requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' '.
'FROM '.INS_TABLE_PAYS.' '.
'WHERE '.INS_CHAMPS_PAYS_LG.' = "fr" '.
'ORDER BY '.INS_CHAMPS_LABEL_PAYS.' ';
$resultat = $this->_db->query($requete);
if (DB::isError($resultat)) {
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
if ($resultat->numRows() == 0) {
return $this->raiseError('Le code fourni ne correspond à aucun pays ou n\'est pas dans la table!') ;
}
$retour = array() ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$retour[$ligne[INS_CHAMPS_ID_PAYS]] = $ligne[INS_CHAMPS_LABEL_PAYS];
}
return $retour;
}
}
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
* Revision 1.1 2004/06/18 09:20:47 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
/tags/v4.0/client/inscription/langues/ins_langue_en.inc.php
New file
0,0 → 1,114
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ins_langue_en.inc.php,v 1.1 2004/07/06 15:42:17 alex Exp $
/**
* Fichier de traduction en anglais de l'application inscription
*
* Fichier de traduction en anglais de l'application inscription
*
*@package inscription
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
define ("INS_NOM", "Name :") ;
define ("INS_PRENOM", "First name") ;
define ("INS_PAYS", "Country:") ;
define ("INS_LANGUES_PARLES", "Languages spoken :") ;
define ("INS_EMAIL", "E-mail :") ;
define ("INS_MOT_DE_PASSE", "Password:") ;
define ("INS_REPETE_MOT_DE_PASSE", "Repeat the password :") ;
define ("INS_ANNULER", "Cancel") ;
define ("INS_RETABLIR", "Restore") ;
define ("INS_VALIDER", "Validate") ;
define ("INS_MOTS_DE_PASSE_DIFFERENTS", "The two passwords are different !") ;
define ("INS_EMAIL_REQUIS", "You must enter your e-mail.") ;
define ("INS_MOT_DE_PASSE_REQUIS", "You must enter your password.") ;
 
define ("INS_MAIL_INCORRECT", "E-mail addresses must be in the following format, user@domain.ext") ;
define ("INS_MAIL_DOUBLE", "This e-mail has already been used") ;
define ("INS_NOTE_REQUIS", "Indicate the required fields") ;
define ("INS_MODIFIER_INSCRIPTION", "Modify your registration") ;
define ("INS_SUPPRIMER_INSCRIPTION", "Cancel your registration") ;
define ("INS_MESSAGE_BIENVENU", "You are registered to i-twinning ") ;
define ("INS_FICHE_PERSONNELLE", "Personal form") ;
define ("INS_DECONNEXION", "Logout") ;
define ("INS_INSCRIPTION", "Registration") ;
define ("INS_TEXTE_PERDU", "If you forgot your password, enter your e-mail address in the Login ".
"field below and click on Validate") ;
define ("INS_NOM_WIKI", "Wiki name") ;
define ("INS_MAUVAIS_NOM_WIKI", "The wiki name is not valid (ex : NameFirstname)") ;
define ("INS_DEJA_INSCRIT", "If you are already registered :") ;
define ("INS_ERREUR_LOGIN", "Unknown user or invalid password") ;
define ("INS_SI_PASSE_PERDU", "If you forgot your password") ;
define ("INS_INDIQUE_ADRESSE", "Enter your e-mail address in the field below.<br>\n".
"A new password will be sent to you ") ;
define ("INS_ENVOIE_PASSE", "Password e-mailing") ;
define ("INS_LAIUS_INSCRIPTION", "Click here for registration") ;
 
//============= L'envoie du mot de passe perdu par mail =============================
define ("INS_NOUVEAU_MOT_DE_PASSE", "Your new i-twinning password") ;
define ("INS_NOUVEAU_MOT_DE_PASSE_2", "Your new password : ") ;
define ("INS_NOUVEAU_MOT_DE_PASSE_LAIUS", "\n\n This password allows you to modify your personnal informations\n".
"in the i-t website\n.".
"http://www.vecam.org/i-j/\n\n") ;
define ("INS_MOT_DE_PASSE_ENVOYE_1", "Your new password has been sent to the address ") ;
define ("INS_MOT_DE_PASSE_ENVOYE_2", "Check your mail, remember your password and register again. Don't ".
"hesitate to change this password and replace it by an easier one.") ;
//============= L'envoie d'un mail de confirmation ===================================
// Ne pas utiliser d'entités HTML
define ("INS_MAIL_INSCRIPTION_1", "Votre inscription a bien été prise en compte.\n".
"Voici les informations que nous avons enregistré :\n") ;
define ("INS_MAIL_INSCRIPTION_2", "\nVous pouvez modifier votre inscription sur \nhttp://www.vecam.org/i-j/\n".
"rubrique Inscription.\n\n".
"L'équipe I-Jumelage.") ;
 
// Envoir d'un mail à la coordination
define ("INS_MAIL_COORD_SUJET", "A new registration on the I-Twinning") ;
define ("INS_MAIL_COORD_CORPS", "A new registration on the I-Twinning") ;
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: ins_langue_en.inc.php,v $
* Revision 1.1 2004/07/06 15:42:17 alex
* en cours
*
* Revision 1.3 2004/06/25 14:25:40 alex
* ajout de labels
*
* Revision 1.2 2004/06/24 07:43:55 alex
* traduction
*
* Revision 1.1 2004/06/18 09:21:15 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/langues/ins_langue_es.inc.php
New file
0,0 → 1,110
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ins_langue_es.inc.php,v 1.1 2004/07/06 15:42:17 alex Exp $
/**
* Fichier de traduction en français de l'application inscription
*
* Fichier de traduction en français de l'application inscription
*
*@package inscription
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004/07/06 15:42:17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
define ("INS_NOM", "Apellido") ;
define ("INS_PRENOM", "Nombre") ;
define ("INS_PAYS", "Pais") ;
define ("INS_LANGUES_PARLES", "Idiomas hablados") ;
define ("INS_EMAIL", "Correo electronico") ;
define ("INS_MOT_DE_PASSE", "Contraseña") ;
define ("INS_REPETE_MOT_DE_PASSE", "Repetir la contraseña") ;
define ("INS_ANNULER", "Cancelar") ;
define ("INS_RETABLIR", "Restablecer") ;
define ("INS_VALIDER", "Ingresar") ;
define ("INS_MOTS_DE_PASSE_DIFFERENTS", "Las contraseñas son diferentes!") ;
define ("INS_EMAIL_REQUIS", "Debe ingresar un correo electronico") ;
define ("INS_MOT_DE_PASSE_REQUIS", "Debe ingresar una contraseña.") ;
define ("INS_MAIL_INCORRECT", "El correo electronico debe tener una forma correcta, utilizador@domaine.ext") ;
define ("INS_MAIL_DOUBLE", "Este correo electronico ya es utilizado por otra persona") ;
define ("INS_NOTE_REQUIS", "Indicar los espacios requeridos") ;
define ("INS_MODIFIER_INSCRIPTION", "Modificar su inscripccion") ;
define ("INS_SUPPRIMER_INSCRIPTION", "Cancelar su inscripcion") ;
define ("INS_MESSAGE_BIENVENU", "Esta inscrito en I-Enlace") ;
define ("INS_FICHE_PERSONNELLE", "Ficha personal") ;
define ("INS_DECONNEXION", "Desconectar") ;
define ("INS_INSCRIPTION", "Inscripcion") ;
define ("INS_TEXTE_PERDU", "Si ha perdido su contraseña, indique su correo electronico en el espaciologin y haga clic en Ingresar") ;
define ("INS_NOM_WIKI", "Nombre wiki") ;
define ("INS_MAUVAIS_NOM_WIKI", "El nombre wiki no es valido (ex: NomPrenom)") ;
define ("INS_DEJA_INSCRIT", "Si ya esta inscrito") ;
define ("INS_ERREUR_LOGIN", "Utilizador desconocido o contraseña incorrecta") ;
define ("INS_SI_PASSE_PERDU", "Si ha perdido su contraseña ") ;
define ("INS_INDIQUE_ADRESSE", "indique su correo electronico en el espacio que sigue. Una nueva contraseñale sera enviada.") ;
define ("INS_LAIUS_INSCRIPTION", "Si no est&agrave; inscrito, haga clic en inscripci&oacute;n") ;
define ("INS_ENVOIE_PASSE", "Envio de la contraseña por correo electronico") ;
 
//=================== Envio de la contraseña perdida por correo electronico========================
 
define ("INS_NOUVEAU_MOT_DE_PASSE", "Su nueva contraseña I-Enlaces") ;
define ("INS_NOUVEAU_MOT_DE_PASSE_2", "Su nueva contraseña:") ;
define ("INS_NOUVEAU_MOT_DE_PASSE_LAIUS", "Esta contraseña le permite modificar las informaciones que le conciernen enel sitio de I-Enlace.Su nueva contraseña es enviada a la direccion") ;
define ("INS_MOT_DE_PASSE_ENVOYE_1", "Rebice su correo electronico, anote su nueva contraseña e idenfiquedirigiendose de nuevo a la inscripcion.No dude en cambiar esta contraseña para poner una mas simple y mas facil aretener. ") ;
 
//============= L'envoie d'un mail de confirmation ===================================
// Ne pas utiliser d'entités HTML
define ("INS_MAIL_INSCRIPTION_1", "Votre inscription a bien été prise en compte.\n".
"Voici les informations que nous avons enregistré :\n") ;
define ("INS_MAIL_INSCRIPTION_2", "\nVous pouvez modifier votre inscription sur \nhttp://www.vecam.org/i-j/\n".
"rubrique Inscription.\n\n".
"L'équipe I-Jumelage.") ;
// Envoir d'un mail à la coordination
define ("INS_MAIL_COORD_SUJET", "Un nouvel inscrit à I-Twinning") ;
define ("INS_MAIL_COORD_CORPS", "Un nouvel inscrit à I-Twinning") ;
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: ins_langue_es.inc.php,v $
* Revision 1.1 2004/07/06 15:42:17 alex
* en cours
*
* Revision 1.4 2004/06/30 10:00:59 alex
* traduction
*
* Revision 1.3 2004/06/25 14:25:40 alex
* ajout de labels
*
* Revision 1.2 2004/06/24 07:43:55 alex
* traduction
*
* Revision 1.1 2004/06/18 09:21:15 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/langues/ins_langue_fr.inc.php
New file
0,0 → 1,149
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: ins_langue_fr.inc.php,v 1.3 2005/03/21 16:50:45 alex Exp $
/**
* Fichier de traduction en français de l'application inscription
*
* Fichier de traduction en français de l'application inscription
*
*@package inscription
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $ $Date: 2005/03/21 16:50:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
define ("INS_AJOUT_MEMBRE", "Remplissez le formulaire ci-dessous pour vous inscrire") ;
define ('INS_MODIF_MEMBRE', 'Modification de vos informations');
define ("INS_NOM", "Nom : ") ;
define ("INS_NOM_REQUIS", "Indiquez votre nom.") ;
define ("INS_PRENOM", "Pr&eacute;nom : ") ;
define ("INS_PRENOM_REQUIS", "Veuillez indiquer votre prénom.") ;
define ("INS_PAYS", "Pays : ") ;
define ("INS_LANGUES_PARLES", "Langues parl&eacute;s") ;
define ("INS_EMAIL", "Adresse mail : ") ;
define ("INS_MOT_DE_PASSE", "Mot de passe :") ;
define ("INS_REPETE_MOT_DE_PASSE", "R&eacute;p&eacute;ter le mot de passe : ") ;
define ("INS_ADRESSE_1", "Adresse : ") ;
define ("INS_ADRESSE_2", "Adresse (suite) : ") ;
define ("INS_REGION", "R&eacute;gion / province : ") ;
define ("INS_CODE_POSTAL", "Code postal : ") ;
define ("INS_CODE_POSTAL_REQUIS", "Indiquez votre code postal.") ;
define ("INS_VILLE", "Ville : ") ;
define ("INS_VILLE_REQUIS", "Indiquez votre ville.") ;
define ("INS_SITE_INTERNET", "Site web personnel : ") ;
define ("INS_LETTRE", "Je souhaite recevoir la lettre d'actualités de Tela Botanica") ;
define ("INS_LETTRE_INSCRIT", "Inscrit &agrave; la lettre d'actualit&eacute;s : ") ;
define ("INS_LETTRE_INSCRIT_OUI", "oui") ;
define ("INS_LETTRE_INSCRIT_NON", "non") ;
define ("INS_ADHERENT", "Vous &ecirc;tes adh&eacute;rents de personnes morales (associations, institutions, entreprise... ) : ") ;
define ("INS_ORGANISME", "Organisme : ") ;
define ("INS_FONCTION", "Fonction : ") ;
define ("INS_ETES_BOTANISTE", "Vous &ecirc;tes botaniste : ") ;
define ("INS_ACTIVITE_PROFESSIONNELLE", "Votre activit&eacute; professionnelle (ou celle que vous aviez) : ") ;
define ("INS_MEMBRE_ASSO", "Vous &ecirc;tes membre d'une association botanique, naturaliste, ou autre... : ") ;
define ("INS_SPECIALISTE", "Vous &ecirc;tes sp&eacute;cialiste d'une discipline ou d'un groupe de plantes particulier, lequel : ") ;
define ("INS_SPE_ZONE", "Vous &egrave;tes sp&eacute;cialiste d'une zone g&eacute;ographique, laquelle : ") ;
define ("INS_ANNULER", "Annuler") ;
define ("INS_RETABLIR", "Rétablir") ;
define ("INS_VALIDER", "Valider") ;
define ("INS_MOTS_DE_PASSE_DIFFERENTS", "Les mots de passe sont diff&eacute;rents !") ;
define ("INS_EMAIL_REQUIS", "Vous devez saisir un email.") ;
define ("INS_MOT_DE_PASSE_REQUIS", "Vous devez saisir un mot de passe.") ;
define ("INS_MAIL_INCORRECT", "L'email doit avoir une forme correcte, utilisateur@domaine.ext") ;
define ("INS_MAIL_DOUBLE", "Cet email est d&eacute;j&agrave utilis&eacute; par quelqu'un d'autre") ;
define ("INS_NOTE_REQUIS", "Indique les champs requis") ;
define ("INS_ACCUEIL_INSCRIPTION", "Inscription au réseau Tela Botanica") ;
define ("INS_MODIFIER_INSCRIPTION", "Modifier votre inscription") ;
define ("INS_SUPPRIMER_INSCRIPTION", "Supprimer votre inscription") ;
define ("INS_MESSAGE_BIENVENU", "Vous &ecirc;tes inscrit &agrave; Tela Botanica") ;
define ('INS_MESSAGE_EXPIRATION', 'Votre demande a expiré, veuillez ressaisir le formulaire d\'inscription.') ;
define ("INS_FICHE_PERSONNELLE", "Fiche personnelle") ;
define ("INS_DECONNEXION", 'D&eacute;connexion') ;
define ("INS_INSCRIPTION", 'Inscription') ;
define ("INS_MDP_PERDU_TITRE", "Perte ou oubli de mot de passe");
define ("INS_MDP_PERDU_TITRE_RETENTER", "Vous pouvez aussi essayer à nouveau de vous identifier...");
 
define ("INS_TEXTE_PERDU", "Si vous avez perdu votre mot de passe, veuillez cliquer sur le lien suivant :") ;
define('INS_MDP_PERDU_OUBLI', 'perte de mot de passe');
define ("INS_DEJA_INSCRIT", "D&eacute;j&agrave;  inscrit, identifiez-vous pour acc&eacute;der &agrave;  votre fiche personnelle :") ;
define ("INS_ERREUR_LOGIN", "Utilisateur inconnu ou mot de passe erronn&eacute;") ;
define ("INS_SI_PASSE_PERDU", "Si vous avez perdu votre mot de passe") ;
define ("INS_INDIQUE_ADRESSE", "Indiquez dans le champs ci-dessous l'adresse email que vous avez utilisé pour vous inscrire au site.<br>\n".
"Un nouveau mot de passe vous sera envoyé.") ;
define ("INS_ENVOIE_PASSE", "Envoi du mot de passe par mail") ;
define ("INS_LAIUS_INSCRIPTION", "L'inscription est libre et gratuite !") ;
define ("INS_LAIUS_INSCRIPTION_2", "Elle vous permet de :</p>
<ul>
<li>consulter l'annuaire des personnes inscrites et pouvoir ainsi échanger des informations, </li>
<li>accéder à certaines informations diffusées sur le site, </li>
<li>recevoir une lettre électronique d'informations.</li>
</ul>
<p><strong>L'inscription à l'annuaire du site de Tela Botanica implique que vous soyez d'accord pour que votre nom, prénom, ville,
code postal et pays apparaissent en clair dans l'annuaire du site Internet de Tela Botanica, les autres informations restent confidentielles (courriel, adresse).</strong></p>
<p>En application des articles 39 et suivants de la loi du 6 janvier 1978 modifiée, vous bénéficiez d'un droit d'accès
et de rectification aux informations qui vous concernent.</p>
<p>Par la suite, il vous sera possible de modifier voire annuler votre inscription.<br />");
define ('INS_PIED_INFO', 'Si vous constatez des problèmes en utilisant cette application, veuillez contacter : ') ;
define ('INS_PIED_MAIL', 'webmestre@tela-botanica.org') ;
 
//============= L'envoie du mot de passe perdu par mail =============================
define ("INS_NOUVEAU_MOT_DE_PASSE", "Votre nouveau mot de passe Tela Botanica") ;
define ("INS_NOUVEAU_MOT_DE_PASSE_2", "Votre nouveau mot de passe : ") ;
define ("INS_NOUVEAU_MOT_DE_PASSE_LAIUS", "\n\nCe mot de passe vous permet de modifier les informations\n".
"vous concernant dans le site de Tela Botanica.\n".
"http://www.tela-botanica.org/\n\n") ;
define ("INS_MOT_DE_PASSE_ENVOYE_1", "Votre nouveau mot de passe a &eacute;t&eacute; ".
"envoy&eacute; &agrave; l'adresse") ;
define ("INS_MOT_DE_PASSE_ENVOYE_2", "Relevez votre messagerie, notez votre nouveau mot de passe et identifiez vous à ".
"nouveau en allant à l'inscription. N'h&eacute;sitez pas à changer ce mot de passe ".
"pour en mettre un plus simple, tr&egrave;s facile &agrave; retenir." );
//============= L'envoie d'un mail de confirmation ===================================
// Ne pas utiliser d'entités HTML
define ("INS_MAIL_INSCRIPTION_1", "Votre inscription a bien été prise en compte.\n".
"Voici les informations que nous avons enregistré :\n") ;
define ("INS_MAIL_INSCRIPTION_2", "\nVous pouvez modifier votre inscription sur \nhttp://www.tela-botanica.org\n".
"rubrique Inscription.\n\n".
"L'équipe de Tela Botanica.") ;
 
// Envoir d'un mail à la coordination
define ("INS_MAIL_COORD_SUJET", "Un nouvel inscrit à Tela Botanica") ;
define ("INS_MAIL_COORD_CORPS", "Un nouvel inscrit à Tela Botanica") ;
define ('INS_MESSAGE_APPLI', 'Application INSCRIPTION');
define ("INS_MESSAGE_INSCRIPTION",
'<h1 class="titre1_inscription">Inscription au réseau Tela Botanica</h1>'."\n".
'<p class="information">Votre inscription a bien été prise en compte.</p>'."\n".
"<h2>Pour terminer votre inscription :</h2>\n".
"<p>Un message de confirmation vous a été envoyé à l'adresse e-mail que vous avez fournie. <br />\n".
"Ce message devrait arriver immédiatement mais cela peut prendre plusieurs dizaines de minutes. <br />\n".
"Lorsque vous l'aurez reçu, veuillez lire ce courriel et en suivre les instructions pour activer complètement votre inscription.</p>\n".
"<p>Ce courriel peut quelque fois être considéré comme du spam par votre lecteur de courriel. <br />\n".
"Veuillez vérifier votre anti-spam en cas de problème.</p>\n");
define ('INS_MESSAGE_DEBUT_MAIL_INSCRIPTION', 'Bonjour,'."\n\n".
'Nous avons reçu une demande d\'inscription pour cette adresse mail.'."\n".
'Pour confirmer, cliquer sur le lien ci-dessous.'."\n\n" ) ;
define ('INS_MESSAGE_FIN_MAIL_INSCRIPTION', "\n\n".'L\'équipe de Tela Botanica') ;
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/configuration/ins_config.inc.php
New file
0,0 → 1,155
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
/**
* Fichier de configuration de l'inscription
*
* A éditer de façon spécifique à chaque déploiement
*
*@package inscription
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Id: ins_config.inc.php,v 1.3 2005/05/13 13:49:15 alex Exp $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
/**
//=========================DEFINITION DE VARIABLES =================================
* Définition des variables globales
//==================================================================================
*/
$GLOBALS['AUTH'] =& $GLOBALS['_GEN_commun']['pear_auth'] ;
 
/**
//==================================== LES URLS ==================================
* Constantes liées à l'utilisation des url
//==================================================================================
*/
$GLOBALS['ins_url'] =& $GLOBALS['_GEN_commun']['url'] ;
$GLOBALS['ins_db'] =& $GLOBALS['_GEN_commun']['pear_db'] ;
define('INS_CHEMIN_FICHIER', 'client/inscription/') ;
define('URL_LISTE_ACTU', 'http://vpopmail.tela-botanica.org/');
 
/**
//==================================== CONSTANTES ==================================
* Constantes des noms de tables et de champs dans l'annuaire
//==================================================================================
*/
define ('INS_ANNUAIRE', 'annuaire_tela');
define ('INS_CHAMPS_ID', 'U_ID');// Nom du champs nom
define ('INS_CHAMPS_MAIL', 'U_MAIL');// Nom du champs mail
define ('INS_CHAMPS_LOGIN', 'at_nom_wiki');
define ('INS_CHAMPS_NOM', 'U_NAME');
define ('INS_CHAMPS_PRENOM', 'U_SURNAME');
define ('INS_CHAMPS_PASSE', 'U_PASSWD');
define ('INS_CHAMPS_PAYS', 'U_COUNTRY');
define ('INS_CHAMPS_CODE_POSTAL', 'U_ZIP_CODE');
define ('INS_CHAMPS_VILLE', 'U_CITY');
define ('INS_CHAMPS_ADRESSE_1', 'U_ADDR1');
define ('INS_CHAMPS_ADRESSE_2', 'U_ADDR2');
define ('INS_CHAMPS_REGION', 'U_STATE');
define ('INS_CHAMPS_SITE_WEB', 'U_WEB');
define ('INS_CHAMPS_TELEPHONE', 'U_PHONE');
define ('INS_CHAMPS_FAX', 'U_FAX');
define ('INS_CHAMPS_STRUCTURE', 'U_TITLE');
define ('INS_CHAMPS_DATE', 'U_DATE');
define ('INS_CHAMPS_LETTRE', 'U_LETTRE');// Le champs qui indique si l'usager est inscrit à la lettre d'inscription
define ('INS_CHAMPS_DPT', 'U_FRENCH_DPT');
define ('PROJET_DPT', 'carto_DEPARTEMENT');// Nom de la table département
define ('INS_TABLE_PAYS', 'carto_PAYS');// Nom de la table pays
define ('INS_CHAMPS_ID_PAYS', 'CP_ID_Pays');
define ('INS_CHAMPS_LABEL_PAYS', 'CP_Intitule_pays');
define ('INS_CHAMPS_PAYS_LG', 'CP_Langue_intitule');// Langue de l'intitule du pays
 
/**
//==================================== PARAMETRAGE =================================
* Pour régler certaines fonctionnalité de l'application
//==================================================================================
*/
// Indique le type de cryptage du mot de passe à appliquer (doit être identique à PEAR_AUTH)
define ('INS_MDP_CRYPTYPE', 'md5');// Choix : md5 seulement
 
define ('INS_MAIL_ADMIN_APRES_INSCRIPTION', 'Accueil Tela Botanica <accueil@tela-botanica.org>');
define ('INS_MAIL_ADMIN_APRES_INSCRIPTION_SUJET', '[Tela Botanica] Inscription');
 
define ('INS_UTILISE_LISTE', true);// Mettre à false si pas de liste d'actu
define ('INS_MAIL_INSCRIPTION_LISTE', 'actu-subscribe@tela-botanica.org');
define ('INS_MAIL_DESINSCRIPTION_LISTE', 'actu-unsubscribe@tela-botanica.org');
 
// Liste des personne recevant le mail après inscription
$GLOBALS['mail_admin'] = array ('Accueil <accueil@tela-botanica.org>',
'Daniel MATHIEU <dmathieu@tela-botanica.org>',
'Jean-Pascal MILCENT <jpm@tela-botanica.org>');
 
define ('INS_UTILISE_SPIP', 1);
if (INS_UTILISE_SPIP) {
define ('INS_BDD_SPIP', 'tela_prod_spip_actu');
}
 
/**
//==================================== PARAMETRAGE =================================
* Pour gérer la réécriture d'url de l'inscription
* Cela nécessite une ligne dans le fichier .htaccess, par exemple
* RewriteRule ^ins([0-9a-z]*)$ papyrus.php?menu=22&action=ajouter&id=$1 [L]
* Cela sert à racourcir l'URL de confirmation d'inscription
//==================================================================================
*/
define ('INS_UTILISE_REECRITURE_URL', 1);// mettre à 1 si on souhaite utiliser la réécriture
if (INS_UTILISE_REECRITURE_URL) {
define ('INS_URL_PREFIXE', '_ins_');// Indique le préfixe de l'url http://www.mondomaine.org/prefix____
}
 
define ('INS_UTILISE_STAT', true);
define ('INS_TABLE_STATISTIQUE', 'ins_STATS') ;
define ('INS_STATS_CHAMPS_DATE', 'IS_DATE') ;
define ('INS_STATS_CHAMPS_ACTION', 'IS_ACTION') ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: ins_config.inc.php,v $
* Revision 1.3 2005/05/13 13:49:15 alex
* ajout de la réécriture d'url et des statistiques
*
* Revision 1.2 2005/03/21 16:50:31 alex
* mille et une corrction
*
* Revision 1.1 2005/03/04 10:39:41 tam
* installation
*
* Revision 1.1 2004/07/06 15:42:17 alex
* en cours
*
* Revision 1.4 2004/07/06 15:31:33 alex
* en cours
*
* Revision 1.3 2004/06/30 10:00:53 alex
* ajout de champs pour gérer les pays
*
* Revision 1.2 2004/06/18 09:20:54 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/inscription.php
New file
0,0 → 1,302
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
/**
* Inscription
*
* Un module d'inscription, en général ce code est spécifique à un site web.
*
*@package inscription
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Id: inscription.php,v 1.3 2005/03/21 16:50:21 alex Exp $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
include_once PAP_CHEMIN_API_PEAR.'Mail.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/password.php' ;
/** Constante "dynamique" stockant la langue demandée par l'utilisateur pour l'application.*/
define('INS_LANGUE', substr($GLOBALS['_GEN_commun']['i18n'], 0, 2));
$fichier_lg = 'client/inscription/langues/ins_langue_'.INS_LANGUE.'.inc.php';
if (file_exists($fichier_lg)) {
include_once $fichier_lg;
include_once 'client/inscription/langues/ins_langue_'.INS_LANGUE.'.inc.php';
} else {
include_once 'client/inscription/langues/ins_langue_fr.inc.php' ;
}
include_once 'client/inscription/configuration/ins_config.inc.php';
include_once 'client/inscription/bibliotheque/inscription.fonct.php';
include_once 'client/inscription/bibliotheque/ins_spip.fonct.php';
include_once INS_CHEMIN_FICHIER.'bibliotheque/inscription.class.php';
 
// Ajout d'une feuille de style externe
GEN_stockerStyleExterne ('inscription', 'client/inscription/inscription.css') ;
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
function afficherContenuTete() {
$retour = '<h1 class="titre1_inscription">Inscription au Réseau Tela Botanica</h1>';
return ;
}
 
// ================ Note =======================
// La variable action sert à définir ce qui est demandé (inscription, modification d'inscription, suppression ...
// Elle est appelé avec $_REQUEST car elle peut aussi bien venir d'un formulaire que d'un lien.
// ==============================================
 
 
/**
*
* @global AUTH Un pointeur vers un objet PEAR::Auth
* @global ins_url Un pointeur vers un objet PEAR::Net_URL
* @return string Le contenu de l'application inscription
*/
function afficherContenuCorps() {
 
// Operation de maintenance sur la table inscription_demande
// On supprime les vieilles demandes qui ont expire
$requete_maintenance = 'delete from inscription_demande where id_date < DATE_SUB(NOW(), interval 1 week)';
$resultat_maintenance = $GLOBALS['ins_db']->query ($requete_maintenance);
if (DB::isError($resultat_maintenance)) {
return ('Echec de la requete : '.$requete_maintenance.'<br />'.$resultat_maintenance->getMessage());
}
$url = preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()) ;
// Attibution de l'action par défaut à effectuer.
if (!isset ($_REQUEST['action'])) {
$_REQUEST['action'] = 'inscription';
}
$res = '' ;
$est_loggue = true ;
// ... tentative de déconnection
if (isset ($_GET['logout']) && $_GET['logout'] == 1) {
$GLOBALS['AUTH']->logout() ;
$_POST['username'] = '' ;
$_POST['password'] = '' ;
//return AUTH_formulaire_login() ;
}
// ...supprimer l'inscription
if (isset ($_POST['supprimer'])) {
$mail_utilisateur = $GLOBALS['AUTH']->getUsername();
$id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
$bool_inscription_lettre = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_LETTRE);
$resultat = $GLOBALS['AUTH']->removeUser($mail_utilisateur) ;
 
if (PEAR::isError($resultat)) {
return ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
}
 
// Suppression dans SPIP
if (INS_UTILISE_SPIP) {
desinscription_spip($id_utilisateur) ;
}
 
// Désinscription de la lettre d'info
if (INS_UTILISE_LISTE) {
if ($bool_inscription_lettre == 1) {
$supp_abo = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste=actu&mail='.$mail_utilisateur) ;
}
}
// Appel des actions desinscriptions des applications clientes
$msg = '';
$d = dir(GEN_CHEMIN_CLIENT);
while (false !== ($repertoire = $d->read())) {
if ($repertoire != '.' || $repertoire != '..') {
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php'))
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php' ;
}
if ($msg != '') $res .= $msg;
}
$d->close();
// Deconnexion
$GLOBALS['AUTH']->logout() ;
// Ajout d'une ligne dans les statistiques
if (INS_UTILISE_STAT) {
$requete = 'INSERT INTO '.INS_TABLE_STATISTIQUE.' SET '.INS_STATS_CHAMPS_DATE.'=NOW(), '.INS_STATS_CHAMPS_ACTION.'="del"' ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
//return AUTH_formulaire_login() ;
}
 
// ... envoie de mot de passe
if ($_REQUEST['action'] == 'sendpasswd') {
envoie_passe();
}
// ...oublie de mot de passe
if (preg_match('/^(?:mdp_oubli|sendpasswd)$/', $_REQUEST['action'])) {
return message_erreur(false);
}
// ...inscription dans la base si l'utilisateur clique sur le lien du courriel de confirmation envoyé par l'appli
if (isset($_GET['action']) && $_GET['action'] == 'ajouter' && isset($_GET['id']) && !$GLOBALS['AUTH']->getAuth()) {
$requete = 'SELECT id_donnees '.
'FROM inscription_demande '.
'WHERE id_identifiant_session = "'.$_GET['id'].'" ';
$resultat = $GLOBALS['ins_db']->query($requete);
if (DB::isError ($resultat)) {
return ("Echec de la requete : $requete<br />".$resultat->getMessage());
}
if ($resultat->numRows() == 0) {
return INS_MESSAGE_EXPIRATION;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$donnees = unserialize(stripslashes($ligne->id_donnees));
//trigger_error(print_r($donnees, true), E_USER_WARNING);
 
// Ajout des données dans la base
insertion($donnees);
// On loggue l'utilisateur
$GLOBALS['AUTH']->username = $donnees['email'];
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'];
$GLOBALS['AUTH']->login();
// Inscription à la lettre d'information
/*if (INS_UTILISE_LISTE) {
if (isset($donnees['lettre']) && 1 == $donnees['lettre']) {
inscription_lettre(INS_MAIL_INSCRIPTION_LISTE) ;
}
}*/
// On supprime la demande d'inscription
$requete = 'DELETE FROM inscription_demande WHERE id_identifiant_session="'.$_GET['id'].'"' ;
$resultat = $GLOBALS['ins_db']->query ($requete) ;
if (DB::isError ($resultat)) {
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
// On envoi les mails d'information sur la nouvelle inscription.
envoie_mail();
}
 
// ... affichage d'une erreur en cas de pb
if (!$GLOBALS['AUTH']->getAuth() && $_REQUEST['action'] != 'inscription' && $_REQUEST['action'] != 'inscription_v') {
if (isset($_POST['username']) && $_POST['username'] != '') {
$res .= message_erreur();
}
}
 
// ... la personne est identifiée nous affichons ses informations
if ($GLOBALS['AUTH']->getAuth () && !isset($_POST['modifier']) && $_REQUEST['action'] != 'modifier_v') {
return info().bouton($url);
}
// ...tentative d'inscription ou Inscription structure
if (preg_match('/^(?:inscription|inscription_v|modifier_v)$/', $_REQUEST['action']) || isset($_POST['modifier'])) {
$action = preg_replace ("/&amp;/", "&", $GLOBALS['ins_url']->getURL()) ;
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', $action) ;
// Construction de la liste des pays
$liste_pays = new ListeDePays($GLOBALS['ins_db']) ;
 
if (isset($_POST['structure'])) {
$formulaire->formulaireStructure() ;
}
 
if (!isset($_POST['modifier'])) {
$GLOBALS['ins_url']->addQueryString('action', 'mdp_oubli');
$url_oubli = preg_replace ('/&amp;/', '&', $GLOBALS['ins_url']->getURL()) ;
$GLOBALS['ins_url']->removeQueryString('action');
$res .= '<h1 class="titre1_inscription">'.INS_ACCUEIL_INSCRIPTION.'</h1>';
$res .= '<h2 class="titre2_inscription">'.INS_LAIUS_INSCRIPTION.'</h2>'."\n" ;
$res .= '<p>'.INS_LAIUS_INSCRIPTION_2.'</p>'."\n" ;
$res .= '<p>'.INS_TEXTE_PERDU.' <a href="'.$url_oubli.'">'.INS_MDP_PERDU_OUBLI.'</a></p>'."\n" ;
} else {
$formulaire->mode_ajout = false;
$res .= '<h1 class="titre1_inscription">'.INS_ACCUEIL_INSCRIPTION.'</h1>';
}
 
$formulaire->construitFormulaire($action, $liste_pays->getListePays('fr')) ;
if (isset($_POST['modifier'])) {
$formulaire->addElement ('hidden', 'action', 'modifier_v') ;
$formulaire->setDefaults(formulaire_defaults()) ;
if (INS_UTILISE_LISTE) {
if ($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_LETTRE) == 1) {
$lettre = & $formulaire->getElement('lettre') ;
$lettre->setChecked(true) ;
}
}
} else if ($_REQUEST['action'] == 'inscription') {
$formulaire->addElement ('hidden', 'action', 'inscription_v') ;
$formulaire->setDefaults (array ('pays' => 'fr', 'asso' => 3, 'activite' => 3, 'niveau' => 4, 'lettre' => 1)) ;
if (INS_UTILISE_LISTE) {
$lettre = & $formulaire->getElement('lettre') ;
$lettre->setChecked(true) ;
}
} else if ($_REQUEST['action'] == 'inscription_v') {
if ($formulaire->validate()) {
$formulaire->process('demande_inscription', false) ;
return message_inscription() ;
}
} else if ($_REQUEST['action'] == 'modifier_v') {
$ancien_mail = $GLOBALS['AUTH']->getUsername() ;
if ($formulaire->validate()) {
$formulaire->process('mise_a_jour', false) ;
}
$nouveau_mail = $GLOBALS['AUTH']->getUsername() ;
// on parcourt tout le dossier des applications clientes et on appelle la modification de chacune
$d = dir(GEN_CHEMIN_CLIENT);
while (false !== ($repertoire = $d->read())) {
if ($repertoire != '.' || $repertoire != '..') {
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.modification.inc.php'))
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.modification.inc.php' ;
}
}
$d->close();
return info($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)).bouton($url);
}
return $res.$formulaire->toHTML() ;
}
return $res ;
}
 
function afficherContenuPied () {
$sortie = '<p id="ins_pied_page">'.INS_PIED_INFO.
'<a href="mailto:'.INS_PIED_MAIL.'">'.INS_PIED_MAIL.'</a>.'.
'</p>';
return $sortie;
}
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v4.0/client/inscription/inscription.css
New file
0,0 → 1,57
/* Feuille de style inscription*/
 
/* Pied de page */
#ins_pied_page {
color:#A9A9A9;
font-size:10px;
padding-top:10px;
text-align:center;}
 
/* Presentation de la fiche des inscrits */
dt {
float:left;
width:10em;
text-align:right;
font-weight:bold;
padding-right : 10px;}
.inscription_titre2 {
clear:both;
color:#996F18;;}
 
/* Presentation du formulaire d'inscription */
#formulaire_inscription fieldset {
border: 0;
margin: 0;
margin-top:10px;
padding: 0;}
#formulaire_inscription legend {
line-height:1.3em;
margin:8px 0 4px 0;
font-size:15px;
color: #996F18;
font-weight:bold;}
#formulaire_inscription ul {
list-style:none;
margin:0;
padding:0;}
#formulaire_inscription li {
font-weight:bold;
margin:5px 0px;
clear:both;}
.symbole_obligatoire {
color:#F00;
font-size:14pt;}
.liste_inscription .inscription_label {
float:left;
width:10em;
text-align:right;
padding-right:10px;}
.liste_inscription select {
margin-top:5px;}
.groupe_formulaire .inscription_label1 {
float:left;
width:10em;
text-align:right;
padding-right:10px;}
.inscription_label2 {
margin-left:10px;}
Property changes:
Added: svn:executable
+*
\ No newline at end of property