/trunk/client/integrateur_wikini/integrateur_wikini.admin.php |
---|
19,7 → 19,7 |
// | 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: integrateur_wikini.admin.php,v 1.5 2006-04-28 12:41:26 florian Exp $ |
// CVS : $Id: integrateur_wikini.admin.php,v 1.6 2006-12-01 13:23:16 florian Exp $ |
/** |
* Gestion des Wikini associé à un menu pour papyrus : lit et stocke les informations dans la |
* champs gm_application_arguments de la table gen_menu |
39,7 → 39,7 |
* Fragmenteur choix (selection uniquement) |
* |
* -------------------------------------- |
* | Nom Wiki | Page Demmarage | |
* | Nom Wiki | Page Demarrage | |
* -------------------------------------- |
* | Wikini_01 | | |
* --------------------------------------- |
53,7 → 53,7 |
//Auteur original : |
*@author David Delon <david.delon@clapas.net> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ $Date: 2006-04-28 12:41:26 $ |
*@version $Revision: 1.6 $ $Date: 2006-12-01 13:23:16 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
276,6 → 276,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2006/04/28 12:41:26 florian |
* corrections erreurs chemin |
* |
* Revision 1.4 2005/09/30 07:48:35 ddelon |
* Projet Wikini |
* |
/trunk/client/bazar/bazar.inscription.inc.php |
---|
19,7 → 19,7 |
// | 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: bazar.inscription.inc.php,v 1.3 2006-04-28 16:10:17 florian Exp $ |
// CVS : $Id: bazar.inscription.inc.php,v 1.4 2006-12-01 13:23:17 florian Exp $ |
/** |
* |
*@package bazar |
28,7 → 28,7 |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.3 $ |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
37,9 → 37,7 |
// requete pour récupérer l'ensemble des type d'annonces |
$requete = 'select bn_id_nature from bazar_nature where 1' ; |
$resultat = $GLOBALS['ins_db']->query ($requete); |
$SQL = '' ; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
$SQL .= '('.$id_utilisateur.', '.$ligne->bn_id_nature.', 1),' ; |
} |
57,6 → 55,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2006/04/28 16:10:17 florian |
* inscrit d'office tous les utilisateurs en rédacteur de fiches |
* |
* Revision 1.2 2006/03/29 13:06:07 alexandre_tb |
* Code initial |
* |
/trunk/client/bottin/annuaire_backoffice.admin.php |
---|
New file |
0,0 → 1,138 |
<?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$ |
/** |
* |
*@package bottin |
//Auteur original : |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision$ $Date$ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CLASSE | |
// +------------------------------------------------------------------------------------------------------+ |
class Annuaire_Backoffice_Admin { |
var $objet_pear_auth; |
var $objet_pear_db; |
var $objet_pear_url; |
var $sortie_xhtml; |
/** Fonction redigerContenu() - Affiche le formulaire de r?action |
* |
* |
* @return string Le HTML |
*/ |
function afficherContenuCorps() |
{ |
/** Inclusion du fichier de configuration de cette application.*/ |
require_once PAP_CHEMIN_RACINE.'client/bottin/configuration/bottin.config.inc.php'; |
require_once INS_CHEMIN_APPLI.'configuration/cartographie.config.inc.php'; |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ; |
//------------------------------------------------------------------------------------------------------------------- |
// Initialisation des attributs |
$this->objet_pear_auth = $GLOBALS['_GEN_commun']['pear_auth']; |
$this->objet_pear_db = $GLOBALS['ins_db']; |
$this->objet_pear_url = $GLOBALS['_GEN_commun']['url']; |
$this->sortie_xhtml = '<h1>'.INS_CONFIG_ANNUAIRE_BACKOFFICE.'</h1><br />'."\n"; |
//------------------------------------------------------------------------------------------------------------------- |
// Gestion des boutons de l'interface |
if (isset($_POST['afficheur_annuler'])) { |
return false; |
} else if (isset($_POST['afficheur_enregistrer_quitter'])) { |
$requete = 'UPDATE gen_menu SET gm_application_arguments="type_annuaire='.$_POST['type_annuaire'].'" WHERE gm_id_menu='.$_GET['adme_menu_id']; |
$resultat = $this->objet_pear_db->query($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
return false; |
} |
//-------------------------------------------------------------------------------------------------------------- |
// Gestion des valeurs par defauts, en fonctions des donnees sauvees dans carto_config |
$requete = 'SELECT gm_application_arguments FROM gen_menu WHERE gm_id_menu='.$_GET['adme_menu_id']; |
$resultat = $this->objet_pear_db->query($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$valeurs_par_defaut = array(); |
if ($resultat->numRows()>0) { |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$arguments = explode(' ', $ligne->gm_application_arguments); |
var_dump($arguments); |
for ($i = 0; $i < count($arguments); $i++) { |
$attr = explode('=', $arguments[$i]); |
if ($attr[0] != '') { |
$info_application->$attr[0] = (isset($attr[1]) ? $attr[1] : ''); |
} |
} |
} |
//valeurs par defaut enregistrees dans la table |
$valeurs_par_defaut['type_annuaire']=$info_application->type_annuaire; |
} else { |
//valeurs par defaut pour afficher une carto des structures |
$valeurs_par_defaut['type_annuaire']=0; |
} |
//-------------------------------------------------------------------------------------------------------------- |
// Gestion du formulaire |
$this->objet_pear_url->addQueryString('adme_site_id', $_GET['adme_site_id']); |
$this->objet_pear_url->addQueryString('adme_menu_id', $_GET['adme_menu_id']); |
$this->objet_pear_url->addQueryString('adme_action', 'administrer'); |
$form =& new HTML_QuickForm('form_param_annuaire_backoffice', 'post', str_replace('&', '&', $this->objet_pear_url->getUrl())); |
$squelette =& $form->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<p>'."\n". |
'<label style="width:100px;padding:5px;text-align:right;">{label}'. |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
' : </label>'."\n".'{element}'."\n". |
'</p>'."\n" ); |
$option_tables[0] = INS_ANNUAIRE_BOTTIN; |
$option_tables[1] = INS_ANNUAIRE_ADMIN_PAPYRUS; |
$form->addElement('select', 'type_annuaire', INS_TYPE_ANNUAIRE, $option_tables); |
$liste_bouton_debut = '<ul class="liste_bouton">'."\n"; |
$form->addElement('html', $liste_bouton_debut); |
$form->addElement('submit', 'afficheur_enregistrer_quitter', INS_ENREGISTRER_ET_QUITTER); |
$form->addElement('submit', 'afficheur_annuler', INS_ANNULER); |
$liste_bouton_fin = '</ul>'."\n"; |
$form->addElement('html', $liste_bouton_fin); |
$form->setDefaults($valeurs_par_defaut); |
$this->sortie_xhtml .= $form->toHTML()."\n"; |
return $this->sortie_xhtml; |
} |
}// Fin de la classe |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
?> |
/trunk/client/bottin/bibliotheque/inscription.class.php |
---|
19,7 → 19,7 |
// | 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: inscription.class.php,v 1.14 2006-10-05 13:53:54 florian Exp $ |
// CVS : $Id: inscription.class.php,v 1.15 2006-12-01 13:23:16 florian Exp $ |
/** |
* Inscription |
* |
31,7 → 31,7 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.14 $ $Date: 2006-10-05 13:53:54 $ |
*@version $Revision: 1.15 $ $Date: 2006-12-01 13:23:16 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
189,6 → 189,8 |
$this->addElement('text', 'telephone', INS_TELEPHONE, array('size' => '12')) ; |
$this->addElement('text', 'fax', INS_FAX, array('size' => '12')) ; |
$this->addElement('text', 'site', INS_SITE_INTERNET) ; |
$this->addElement('file', 'image', INS_LOGO_OU_IMAGE) ; |
$this->setMaxFileSize(150000); //logo de 15ko maximum |
if (INS_CHAMPS_LETTRE != '') $this->addElement('checkbox', 'lettre',INS_LETTRE, '<br />') ; |
$this->addElement('checkbox', 'visible',INS_VISIBLE, '<br />') ; |
$this->addElement('hidden', 'est_structure', 0) ; |
/trunk/client/bottin/bibliotheque/annuaire_backoffice.fonct.php |
---|
10,7 → 10,7 |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> | |
// +--------------------------------------------------------------------------------+ |
// |
// $Id: annuaire_backoffice.fonct.php,v 1.5 2006-09-15 12:34:09 alexandre_tb Exp $ |
// $Id: annuaire_backoffice.fonct.php,v 1.6 2006-12-01 13:23:15 florian Exp $ |
/** function mkengine () |
20,8 → 20,8 |
* @return |
*/ |
include_once 'Pager/Pager.php' ; |
include_once 'HTML/Table.php'; |
include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php' ; |
include_once PAP_CHEMIN_API_PEAR.'HTML/Table.php'; |
function mkengine() |
{ |
80,10 → 80,10 |
if ($resultat_nbre_inscrit->numRows() == 1) { |
$tmp_nb = $resultat_nbre_inscrit->fetchRow(DB_FETCHMODE_OBJECT); |
$nbr_total = $tmp_nb->CPT; |
if ($nbr_total > 0) $chaine = "parmi $nbr_total données"; |
else echo("<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $query"); |
$chaine = "parmi $nbr_total données"; |
if ($nbr_total <= 0) $ret .= "<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $requete_nbre_inscrit"; |
} |
else echo("<B>Erreur</B> lors du comptage des structures : $query"); |
else $ret .= "<B>Erreur</B> lors du comptage des structures : $requete_nbre_inscrit"; |
// fin comptage |
/trunk/client/bottin/bibliotheque/bottin.fonct.php |
---|
34,6 → 34,9 |
*/ |
include_once 'inscription.fonct.wiki.php' ; |
if (INS_UTILISE_SPIP) include_once 'inscription.fonct.spip.php' ; |
/** function inscription_onglets() Affiche les onglets de présentation de la structure |
* |
* |
593,9 → 596,697 |
$GLOBALS['corps'] = ''; |
$GLOBALS['titre_mail'] = ''; |
} |
//-----Fonctions de l'inscription-----------------------------------------------------+ |
/** |
* |
* @param array les valeurs renvoyés par le formulaire |
* @return |
*/ |
function inscription_demande($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) ; |
if (INS_UTILISE_REECRITURE_URL) { |
$url = 'http://'.$GLOBALS['ins_url']->host.'/'.INS_URL_PREFIXE.$chaine ; |
} else { |
$url = str_replace ('&', '&', $GLOBALS['ins_url']->getURL()) ; |
} |
require_once PAP_CHEMIN_RACINE.'api/pear/HTML/Template/IT.php'; |
$tpl = new HTML_Template_IT() ; |
// Le gabarit du mail est dans un template |
// template 2 |
$requete = 'select it_template from inscription_template where it_id_template=2'. |
' and it_i18n like "%'.INS_LANGUE_DEFAUT.'"' ; |
if (!$tpl -> setTemplate($GLOBALS['ins_db']->getOne ($requete))) { |
echo 'erreur' ; |
} |
$tpl->setVariable('URL_INSCRIPTION', $url) ; |
mail ($GLOBALS['email'], 'Inscription', $tpl->get(), 'From: '.INS_MAIL_ADMIN_APRES_INSCRIPTION) ; |
} |
/** |
* |
* @param array les valeurs renvoyés par le formulaire |
* @return |
*/ |
function inscription_validee($valeurs) { |
inscription_insertion($valeurs) ; |
$GLOBALS['AUTH']->username = $valeurs['email'] ; |
$GLOBALS['AUTH']->password = $valeurs['mot_de_passe'] ; |
// On loggue l'utilisateur |
$GLOBALS['AUTH']->login() ; |
// inscription à la lettre d'information |
if (INS_CHAMPS_LETTRE != '' && isset ($valeurs['lettre'])) { |
inscription_lettre(INS_MAIL_INSCRIPTION_LISTE) ; |
} |
} |
/** |
* Renvoie l'accueil de l'inscription |
* |
* @return string HTML |
*/ |
function inscription_AUTH_formulaire_login() { |
require_once PAP_CHEMIN_RACINE.'api/pear/HTML/Template/IT.php'; |
$tpl = new HTML_Template_IT() ; |
// Le formulaire pour se logguer est dans un template |
// template 1 |
$requete = 'SELECT it_template FROM inscription_template WHERE it_id_template=1'. |
' AND it_i18n LIKE "%'.INS_LANGUE_DEFAUT.'"' ; |
if (!$tpl -> setTemplate($GLOBALS['ins_db']->getOne ($requete))) { |
echo 'erreur' ; |
} |
$tpl->setVariable('URL_INSCRIPTION', $GLOBALS['ins_url']->getURL()); |
return $tpl->get() ; |
} |
/** formulaire_envoi_passe() - Renvoie le code HTML d'un formulaire d'envoi de mot de passe par mail |
* |
* @return string HTML |
*/ |
function inscription_formulaire_envoi_passe() { |
$res = '<h2>'.INS_SI_PASSE_PERDU.'</h2>'."\n" ; |
$res .= '<form action="'.$GLOBALS['ins_url']->getURL().'&action=sendpasswd" method="post">'."\n" ; |
$res .= '<p class="label100">'.INS_EMAIL.' : </p>'."\n" ; |
$res .= '<input type="text" value="'; |
if (isset($_POST['username'])) $res .= $_POST['username']; |
$res .= '" name="mail" size="32" />'."\n" ; |
$res .= '<input type="submit" value="'.INS_ENVOIE_PASSE.'" />' ; |
$res .= '</form><br />'."\n" ; |
$res .= inscription_AUTH_formulaire_login() ; |
return $res; |
} |
function inscription_insertion($valeur) { |
// =========== Insertion dans l'annuaire =================== |
// Génération du nom wikini à partir du nom et du prénom |
if (INS_UTILISE_WIKINI && INS_NOM_WIKINI_GENERE) { |
$valeur['nom_wiki'] = inscription_genere_nom_wiki ($valeur['nom'], isset ($valeur['prenom']) ? $valeur['prenom'] : '') ; |
} else { |
if (!INS_NOM_WIKINI_GENERE) { |
$valeur['nom_wiki'] = $valeur['nomwiki']; |
} |
} |
$id_utilisateur = inscription_nextId(INS_ANNUAIRE, INS_CHAMPS_ID, $GLOBALS['ins_db']) ; |
$requete = 'INSERT INTO '.INS_ANNUAIRE.' SET '. |
INS_CHAMPS_ID.'="'.$id_utilisateur.'",'. |
inscription_requete_annuaire($valeur) ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
// ================ Insertion dans SPIP ========================================= |
if (INS_UTILISE_SPIP) { |
inscription_spip($id_utilisateur, $valeur) ; |
} |
if (INS_UTILISE_WIKINI) inscription_interwikini_users('', $valeur) ; |
return $id_utilisateur ; |
} |
/** |
* Réalise une mise à jour dans la base de donnée |
* |
* @param array un tableau de valeur avec en clé les noms des champs du formulaire |
* @return void |
*/ |
function inscription_mise_a_jour($valeur, $id = '') { |
// ====================Mise à jour dans l'annuaire gen_annuaire ==================== |
if ($id == '') { |
$id = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID); |
} |
$requete = 'update '.INS_ANNUAIRE.' set '. |
inscription_requete_annuaire ($valeur). |
'where '.INS_CHAMPS_ID.'="'.$id.'"'; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
unset ($resultat) ; |
// ========================= Mise à jour dans SPIP ================================ |
if (INS_UTILISE_SPIP) { |
mod_inscription_spip($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID), $valeur) ; |
} |
} |
/** 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 inscription_requete_annuaire($valeur) { |
$req = INS_CHAMPS_NOM.'="'.addslashes($valeur['nom']).'", '; |
if (isset($valeur['est_structure']) && $valeur['est_structure'] == 0) |
$req .= INS_CHAMPS_PRENOM.'="'.addslashes($valeur['prenom']).'", '; |
// Initialisation de variable pour éviter des notices |
foreach (array ('adresse_1', 'adresse_2', 'ville', 'telephone', 'fax', 'site') as $val) { |
if (!isset ($valeur[$val])) $valeur[$val] = '' ; |
} |
$req .= INS_CHAMPS_MAIL.'="'.addslashes($valeur['email']).'", ' ; |
$req .= INS_CHAMPS_PASSE.'="'.md5($valeur['mot_de_passe']).'", '. |
INS_CHAMPS_PAYS.'="'.addslashes($valeur['pays']).'", '. |
INS_CHAMPS_ADRESSE_1.'="'.addslashes($valeur['adresse_1']).'", '. |
INS_CHAMPS_ADRESSE_2.'="'.addslashes($valeur['adresse_2']).'", '. |
INS_CHAMPS_DATE_INSCRIPTION.'=NOW(), '. |
INS_CHAMPS_CODE_POSTAL.'="'.addslashes($valeur['cp']).'", '. |
INS_CHAMPS_VILLE.'="'.addslashes($valeur['ville']).'", '. |
INS_CHAMPS_EST_STRUCTURE.'="'.addslashes($valeur['est_structure']).'", '. |
INS_CHAMPS_TELEPHONE.'="'.addslashes($valeur['telephone']).'", '. |
INS_CHAMPS_FAX.'="'.addslashes($valeur['fax']).'", '. |
INS_CHAMPS_SITE_INTERNET.'="'.addslashes($valeur['site']).'" '; |
if (isset($valeur['visible'])) $req .= ', '.INS_CHAMPS_VISIBLE.'="'.$valeur['visible'].'"'; |
else $req .= ', '.INS_CHAMPS_VISIBLE.'=0'; |
if (INS_CHAMPS_LETTRE != '') { |
if (isset($valeur['lettre'])) { |
$req .= ', '.INS_CHAMPS_LETTRE.'="'.$valeur['lettre'].'" '; |
inscription_lettre('inscrire'); |
} |
else { |
$req .= ', '.INS_CHAMPS_LETTRE.'=0 '; |
inscription_lettre('desinscrire'); |
} |
} |
if (isset($_FILES['image']['name']) && $_FILES['image']['name']!='') { |
$chemin_destination=INS_CHEMIN_APPLI.'presentations/logos/'.$_FILES['image']['name']; |
move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination); |
$req .= ', '.INS_CHAMPS_LOGO.'="'.$_FILES['image']['name'].'"' ; |
} |
if (isset($valeur['sigle_structure'])) { |
$req .= ', '.INS_CHAMPS_SIGLE_STRUCTURE.'="'.addslashes($valeur['sigle_structure']).'"' ; |
} |
if (isset($valeur['num_agrement'])) { |
$req .= ', '.INS_CHAMPS_NUM_AGREMENT.'="'.addslashes($valeur['num_agrement']).'"' ; |
} |
// traitement du numéro de département pour la france |
if ($valeur['pays'] == 'FR') { |
if (preg_match("/^97|98[0-9]*/", $valeur['cp'])) { |
$n_dpt = substr($valeur['cp'], 0, 3) ; |
} else { |
$n_dpt = substr($valeur['cp'], 0, 2) ; |
} |
$req .= ",".INS_CHAMPS_DEPARTEMENT."='$n_dpt'"; |
} |
if (INS_UTILISE_WIKINI && isset ($valeur['nom_wiki'])) $req .= ','.INS_CHAMPS_NOM_WIKINI.'="'.$valeur['nom_wiki'].'"'; |
return $req ; |
} |
/** 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 inscription_formulaire_defaults($id = '') { |
if ($id == '') { |
$id = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID); |
} |
$requete = 'select '.INS_ANNUAIRE.'.* '. |
'from '.INS_ANNUAIRE.' '. |
'where '.INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'= "'.$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] ; |
if (INS_UTILISE_WIKINI) {$valeurs_par_defaut['nomwiki'] = $ligne[INS_CHAMPS_NOM_WIKINI] ;} |
$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['telephone'] = $ligne[INS_CHAMPS_TELEPHONE] ; |
$valeurs_par_defaut['fax'] = $ligne[INS_CHAMPS_FAX] ; |
if (INS_CHAMPS_STRUCTURE != '' && isset($ligne[INS_CHAMPS_STRUCTURE])) { |
$valeurs_par_defaut['structure'] = $ligne[INS_CHAMPS_STRUCTURE] ; |
//$valeurs_par_defaut['type_structure'] = $ligne['a_type_structure']; |
} |
$valeurs_par_defaut['site'] = $ligne[INS_CHAMPS_SITE_INTERNET] ; |
$valeurs_par_defaut['lettre'] = $ligne[INS_CHAMPS_LETTRE] ; |
$valeurs_par_defaut['visible'] = $ligne[INS_CHAMPS_VISIBLE] ; |
$valeurs_par_defaut['sigle_structure'] = $ligne[INS_CHAMPS_SIGLE_STRUCTURE] ; |
if (INS_CHAMPS_NUM_AGREMENT != '') $valeurs_par_defaut['num_agrement'] = $ligne[INS_CHAMPS_NUM_AGREMENT] ; |
return $valeurs_par_defaut ; |
} |
/** info() - Renvoie une fiche d'information sur la personne ou la structure |
* |
* @param integer identifiant de la fiche a afficher, mettre -1 pour voir sa propre fiche |
* @param text nom de l'onglet de la fiche |
* |
* @return text Code HTML de la fiche |
*/ |
function info($id=-1, $type_info='fiche') { |
if ($id==-1) $id=$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID); |
$requete = 'SELECT * FROM '.INS_ANNUAIRE.' WHERE '.INS_ANNUAIRE.'.' |
.INS_CHAMPS_ID.'="'.$id.'"' ; |
$resultat = $GLOBALS['ins_db'] -> query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ; |
//voir la présentation de la fiche |
if ($type_info=='fiche') { |
$res = ''; |
if ($ligne[INS_CHAMPS_EST_STRUCTURE] == 1) { |
$res .= '<h2>'.INS_FICHE_STRUCTURE.'</h2>'."\n" ; |
} else { |
$res .= '<h2>'.INS_FICHE_PERSONNELLE.'</h2>'."\n" ; |
} |
$res .= '<div class="fiche">'."\n" ; |
if ($ligne[INS_CHAMPS_LOGO] != NULL) { |
$res .= '<img style="float:right;width:120px;height:120px;margin:0 0 10px 10px;" src="'.INS_CHEMIN_APPLI.'presentations/logos/'.$ligne[INS_CHAMPS_LOGO].'" alt="logo" />'."\n"; |
} |
if ($ligne[INS_CHAMPS_EST_STRUCTURE] == 1) { |
$res .= '<h3>'.$ligne[INS_CHAMPS_NOM].'</h3>'."\n"; |
$res .= inscription_ligne(INS_SIGLE_DE_LA_STRUCTURE, $ligne[INS_CHAMPS_SIGLE_STRUCTURE]) ; |
if (INS_CHAMPS_NUM_AGREMENT != '') $res .= inscription_ligne(INS_NUM_AGREMENT, $ligne[INS_CHAMPS_NUM_AGREMENT]) ; |
} else { |
$res .= '<h3>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h3>'."\n"; |
} |
$res .= inscription_ligne(INS_ADRESSE_1, $ligne[INS_CHAMPS_ADRESSE_1]) ; |
$res .= inscription_ligne(INS_ADRESSE_2, $ligne[INS_CHAMPS_ADRESSE_2]) ; |
$res .= inscription_ligne(INS_CODE_POSTAL, $ligne[INS_CHAMPS_CODE_POSTAL]) ; |
$res .= inscription_ligne(INS_VILLE, $ligne[INS_CHAMPS_VILLE]) ; |
$pays = new ListeDePays($GLOBALS['ins_db']) ; |
$res .= inscription_ligne(INS_PAYS, $pays->getNomPays($ligne[INS_CHAMPS_PAYS], INS_LANGUE_DEFAUT)) ; |
$res .= inscription_ligne(INS_TELEPHONE, $ligne[INS_CHAMPS_TELEPHONE]) ; |
$res .= inscription_ligne(INS_FAX, $ligne[INS_CHAMPS_FAX]) ; |
if ($ligne[INS_CHAMPS_SITE_INTERNET]!='') { |
$res .= inscription_ligne(INS_SITE_INTERNET, '<a href="'.$ligne[INS_CHAMPS_SITE_INTERNET].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[INS_CHAMPS_SITE_INTERNET].'</a>'); |
} |
if ($GLOBALS['AUTH']->getAuth()) $res .= inscription_ligne(INS_EMAIL, '<a href="mailto:'.$ligne[INS_CHAMPS_MAIL].'">'.$ligne[INS_CHAMPS_MAIL].'</a>'); |
else $res .= '<br /><p class="zone_info">'.INS_PAS_IDENTIFIE.'</p>'."\n"; |
if (INS_UTILISE_WIKINI) { |
$res .= inscription_ligne (INS_NOM_WIKI, $ligne[INS_CHAMPS_NOM_WIKINI])."\n" ; |
} |
$res .= '</ul>'."\n"; |
if ($id==$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)) { |
$res .= '<ul style="margin-top:10px; clear:both;">'."\n"; |
if ($ligne[INS_CHAMPS_VISIBLE] == 1) { |
$res .= '<li>'.INS_VOUS_APPARAISSEZ.'</li>'."\n"; |
} else $res .= '<li>'.INS_VOUS_APPARAISSEZ_PAS.'</li>'."\n"; |
if (INS_CHAMPS_LETTRE != '') { |
if ($ligne[INS_CHAMPS_LETTRE] == 1) { |
$res .= '<li>'.INS_VOUS_RECEVEZ_LETTRE.'</li>'."\n"; |
} else $res .= '<li>'.INS_VOUS_RECEVEZ_PAS_LETTRE.'</li>'."\n"; |
} |
$res .= '</ul>'."\n"; |
$res .= '<ul style="margin:15px;">'."\n";; |
$res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&action=modifier&form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'">'.INS_MODIFIER_INSCRIPTION.'</a></li>'."\n" ; |
$res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&action=supprimer&form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'" onclick="javascript:return confirm(\''.INS_SUPPRIMER_INSCRIPTION.'?\');">'.INS_SUPPRIMER_INSCRIPTION.'</a></li>'."\n" ; |
$res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&action=deconnexion">'.INS_DECONNEXION.'</a></li>'."\n" ; |
$res .= '</ul>'."\n"; |
$res .= '</div>'."\n"; //div fiche |
} |
//voir les abonnements presents dans les applis clientes |
} elseif ($type_info=='abonnement') { |
$res = '<h1>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h1>'."\n"; |
$res .= '<h2>'.INS_GESTION_DES_ABONNEMENTS.'</h2>'."\n" ; |
// Appel des actions d'abonnement des applications clientes |
$d = dir(GEN_CHEMIN_CLIENT); |
$abonnement=''; |
$abonnements=''; |
while (false !== ($repertoire = $d->read())) { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.'bibliotheque'.GEN_SEP.$repertoire.'.abonnement.inc.php')) { |
require_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.'bibliotheque'.GEN_SEP.$repertoire.'.abonnement.inc.php' ; |
$abonnements .= $abonnement; |
} |
} |
$d->close(); |
$res .= $abonnements; |
//voir les actus |
} elseif ($type_info=='actus') { |
$res = '<h1>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h1>'."\n"; |
$res .= '<h2>'.INS_ACTUALITES_DEPOSEES.'</h2>'."\n" ; |
require_once GEN_CHEMIN_CLIENT.'bazar'.GEN_SEP.'configuration'.GEN_SEP.'baz_config.inc.php'; |
require_once GEN_CHEMIN_CLIENT.'bazar'.GEN_SEP.'bibliotheque'.GEN_SEP.'bazar.fonct.rss.php'; |
$_GET['action']=1; |
$res .= RSSversHTML(gen_RSS('', '', $id, 1, ''), 0, 'jma', 0); |
//voir les ressources |
} elseif ($type_info=='ressources') { |
$res = '<h1>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h1>'."\n"; |
$res .= '<h2>'.INS_RESSOURCES_ASSOCIEES.'</h2>'."\n" ; |
$requete = 'SELECT bf_id_fiche, bf_titre FROM bazar_fiche, bazar_appropriation WHERE ba_ce_id_fiche=bf_id_fiche AND ba_ce_id_structure='.$id ; |
$resultat = $GLOBALS['ins_db'] -> query($requete) ; |
$res .= '<ul>'."\n"; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$res .= '<li><a href="'.INS_URL_BAZAR.'&action=8&id_fiche='.$ligne['bf_id_fiche'].'" onclick="window.open(this.href,\'_blank\');return false;">'.$ligne['bf_titre'].'</a></li>'."\n"; |
} |
$res .= '</ul><br />'."\n"; |
//voir les competences |
} elseif ($type_info=='competences') { |
$res = '<h1>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h1>'."\n"; |
$res .= '<h2>'.INS_COMPETENCES_ASSOCIEES.'</h2>'."\n" ; |
} |
return $res ; |
} |
/** inscription_ligne() - Renvoie une ligne avec label et valeur |
* |
* @param string label Le label |
* @param string valeur |
* @return string HTML |
*/ |
function inscription_ligne($label, $valeur) { |
if ($valeur == '') { |
return; |
} |
if (($label == '')or($label == ' ')) { |
return '<div class="inscription_infos">'.$valeur.'</div>'."\n"; |
} else { |
return '<div class="inscription_infos"><strong class="inscription_label">'."\n".$label.' : </strong>'.$valeur.'</div>'."\n"; |
} |
} |
/** Renvoie vrai si l'email passé en paramètre n'est pas déjà dans l'annuaire |
* ou si, en cas de modification d'inscription, l'inscrit ne modifie pas son email |
* |
* @return boolean |
*/ |
function inscription_verif_doublonMail($mail, $id = '') { |
if ($id == '') { |
if (isset ($GLOBALS['AUTH'])) { |
$id = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ; |
} |
} |
if (isset ($id) && $id != '') { |
$requete_mail = "select ".INS_CHAMPS_MAIL." from ".INS_ANNUAIRE." where ". |
INS_CHAMPS_ID."=".$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 inscription_envoie_passe() { |
$res=''; |
$requete = 'SELECT '.INS_CHAMPS_MAIL.' FROM '.INS_ANNUAIRE.' WHERE '.INS_CHAMPS_MAIL.'="'.$_POST['mail'].'"' ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows() == 0) { |
$res .= '<p class="erreur">'.INS_MAIL_INCONNU_DANS_ANNUAIRE.'</p>'."\n" ; |
} else { |
include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ; |
$mail = & Mail::factory('smtp') ; |
$headers ['Return-Path'] = "<".INS_MAIL_ADMIN_APRES_INSCRIPTION.">" ; |
$headers ['From'] = "<".INS_MAIL_ADMIN_APRES_INSCRIPTION.">" ; |
$headers ['Subject'] = INS_MOT_DE_PASSE_CHANGE ; |
$headers ['Reply-To'] = "<".INS_MAIL_ADMIN_APRES_INSCRIPTION.">" ; |
$headers ['To'] = "<".$_POST['mail'].">" ; |
$nouveau_passe = create_new_random(6) ; |
// modification du mot de passe dans la base |
$requete = 'UPDATE '.INS_ANNUAIRE.' SET '.INS_CHAMPS_PASSE.'=MD5("'.$nouveau_passe.'") WHERE '.INS_CHAMPS_MAIL.'="'.$_POST['mail'].'"' ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$body = INS_NOUVEAU_MOT_DE_PASSE_2.$nouveau_passe ; |
$body .= INS_NOUVEAU_MOT_DE_PASSE_LAIUS ; |
$mail->send($_POST['mail'], $headers, $body) ; |
if (PEAR::isError($mail)) { |
$res .= '<p class="erreur">'.INS_PROBLEME_ENVOI_MAIL.'</p>'."\n" ; |
return $res ; |
} |
$res .= '<p class="info">'.INS_NOUVEAU_MOT_DE_PASSE_ENVOYE.'</p>'."\n" ; |
} |
return $res ; |
} |
/** |
* 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) { |
include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ; |
$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 ; |
} |
/** |
* |
* @global ins_db Un pointeur vers un objet PEAR::DB connecté |
* @return |
*/ |
function inscription_envoie_mail() //A COMPLETER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
{ |
include_once PAP_CHEMIN_RACINE.'api/pear/Mail/mime.php' ; |
include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ; |
$crlf="\n"; |
$headers ['From'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ; |
$headers ['Subject'] = INS_MAIL_COORD_SUJET ; |
$headers ['Reply-To'] = INS_MAIL_ADMIN_APRES_INSCRIPTION ; |
$mime = new Mail_mime($crlf); |
$requete = "select *, ".INS_CHAMPS_LABEL_PAYS." from ".INS_ANNUAIRE.",".INS_TABLE_PAYS. |
" where ".INS_CHAMPS_MAIL."=\"".$GLOBALS['AUTH']->getUsername()."\"". |
" and ".INS_CHAMPS_ID_PAYS."=".INS_CHAMPS_PAYS; |
$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_entete = INS_MAIL_COORD_CORPS."\n" ; |
$body = "mail : ".$ligne[INS_CHAMPS_MAIL]."\n" ; |
$body .= "------------------------------------------\n"; |
$body .= INS_NOM.": ".unhtmlentities($ligne[INS_CHAMPS_NOM])." \n" ; |
$body .= INS_PRENOM.' : '.unhtmlentities($ligne[INS_CHAMPS_PRENOM])." \n" ; |
$body .= INS_PAYS." : ".unhtmlentities($ligne[INS_CHAMPS_LABEL_PAYS])." \n" ; |
$body .= "-------------------------------------------\n" ; |
$mime->setTXTBody($body); |
$mime->setHTMLBody(info()) ; |
$body = $mime->get(); |
$headers = $mime->headers($headers); |
$mail = & Mail::factory('mail') ; |
$mail -> send ($ligne[INS_CHAMPS_MAIL], $headers, $body) ; |
// Envoi du mail aux administrateur du site |
foreach ($GLOBALS['mail_admin'] as $administrateur) { |
$mail -> send ($administrateur, $headers, $body) ; |
} |
if (PEAR::isError($mail)) { |
echo 'erreur d\'envoi' ; |
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 inscription_genere_nom_wiki($prenom, $nom) { |
// 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 = inscription_trim_non_ascii ($nom) ; |
$prenom = inscription_trim_non_ascii ($prenom) ; |
// Vérification |
$nom_wiki = $prenom.$nom ; |
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 ; |
} |
/** |
* Cette fonction supprime les caractères autres que asccii et les chiffres |
* |
* @return string la chaine épurée |
*/ |
function inscription_trim_non_ascii ($nom) { |
$premiere_lettre = true ; |
for ($i = 0; $i < strlen ($nom); $i++) { |
if (!preg_match ('/[a-zA-Z0-9]/', $nom[$i])) { |
$nom[$i] = '_' ; |
} |
// 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 = preg_replace ('/_/', '', $nom) ; |
return $nom ; |
} |
// For users prior to PHP 4.3.0 you may do this: |
//function unhtmlentities($string) |
//{ |
// $trans_tbl = array_flip ($trans_tbl); |
// return strtr ($string, $trans_tbl); |
//} |
//============================================================================== |
/** function 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 inscription_create_new_random($n,$type="") |
{ |
$str = ""; |
switch ($type){ |
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 inscription_nextId($table, $colonne_identifiant) |
{ |
$requete = 'select MAX('.$colonne_identifiant.') as maxi from '.$table ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
die (__FILE__ . __LINE__ . $resultat->getMessage() . $requete); |
return $GLOBALS['ins_db']->raiseError($resultat) ; |
} |
if ($resultat->numRows() > 1) { |
return $GLOBALS['ins_db']->raiseError("<br />La table $table a un identifiant non unique<br/>") ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
return $ligne->maxi + 1 ; |
} |
//-- Fin du code source ------------------------------------------------------------ |
/* |
* $Log$ |
* Revision 1.7 2006/10/05 13:53:54 florian |
* amélioration des fichiers sql |
* |
* Revision 1.6 2006/09/13 12:31:18 florian |
* ménage: fichier de config Papyrus, fichiers temporaires |
* |
/trunk/client/bottin/bibliotheque/inscription.fonct.php |
---|
19,8 → 19,8 |
// | 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: inscription.fonct.php,v 1.22 2006-10-05 13:53:53 florian Exp $ |
// CVS : $Id: inscription.fonct.php,v 1.22 2006-10-05 13:53:53 florian Exp $ |
// CVS : $Id: inscription.fonct.php,v 1.23 2006-12-01 13:23:15 florian Exp $ |
// CVS : $Id: inscription.fonct.php,v 1.23 2006-12-01 13:23:15 florian Exp $ |
/** |
* Fonctions du module inscription |
* |
32,8 → 32,8 |
//Autres auteurs : |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.22 $ $Date: 2006-10-05 13:53:53 $ |
*@version $Revision: 1.22 $ $Date: 2006-10-05 13:53:53 $ |
*@version $Revision: 1.23 $ $Date: 2006-12-01 13:23:15 $ |
*@version $Revision: 1.23 $ $Date: 2006-12-01 13:23:15 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
44,9 → 44,6 |
include_once 'inscription.fonct.wiki.php' ; |
include_once 'inscription.class.php' ; |
if (INS_UTILISE_SPIP) include_once 'inscription.fonct.spip.php' ; |
//require_once 'HTML/QuickForm.php' ; |
//require_once 'HTML/QuickForm/checkbox.php' ; |
//require_once 'HTML/QuickForm/password.php' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
721,6 → 718,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.22 2006/10/05 13:53:53 florian |
* amélioration des fichiers sql |
* |
* Revision 1.21 2006/09/20 13:10:01 alexandre_tb |
* Ajout d'un test sur la lettre d'actualité |
* |
/trunk/client/bottin/bibliotheque/tmp/carto/continent771ce0ad55596625a6242d5101ba3de6.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continent771ce0ad55596625a6242d5101ba3de6.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continent87413cb2f49ab95a7332a98e39361db5.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continent87413cb2f49ab95a7332a98e39361db5.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continentc1f9f0d0e489b7ae8617a5304d91583d.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continentc1f9f0d0e489b7ae8617a5304d91583d.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continent0da6482d48a9e57af6b9c4fe6c56f30b.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continent0da6482d48a9e57af6b9c4fe6c56f30b.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continente7951401ce28bb8a3c3a83a2d2cc2260.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continente7951401ce28bb8a3c3a83a2d2cc2260.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continent4e02f3d287ff451b28c7acd51fee072e.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continent4e02f3d287ff451b28c7acd51fee072e.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continenta729e2de4cac4495743c2af70cfd6cb5.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continenta729e2de4cac4495743c2af70cfd6cb5.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continentecf6c7b537d24ab0698ff6154584c915.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continentecf6c7b537d24ab0698ff6154584c915.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continent0bfaa9187a3b23e6cd9ee3e3cc3210a9.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continent0bfaa9187a3b23e6cd9ee3e3cc3210a9.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/tmp/carto/continent9c3720856d2c6a319cc4649a19c79557.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/bibliotheque/tmp/carto/continent9c3720856d2c6a319cc4649a19c79557.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/bottin/bibliotheque/lib.carto.php |
---|
29,11 → 29,11 |
*@version 01 juillet 2002 |
// +-----------------------------------------------------------------------------------------------+ |
// |
// $Id: lib.carto.php,v 1.4 2006-04-04 12:23:05 florian Exp $ |
// $Id: lib.carto.php,v 1.5 2006-12-01 13:23:16 florian Exp $ |
// FICHIER : $RCSfile: lib.carto.php,v $ |
// AUTEUR : $Author: florian $ |
// VERSION : $Revision: 1.4 $ |
// DATE : $Date: 2006-04-04 12:23:05 $ |
// VERSION : $Revision: 1.5 $ |
// DATE : $Date: 2006-12-01 13:23:16 $ |
// |
// +-----------------------------------------------------------------------------------------------+ |
// A FAIRE : |
569,10 → 569,8 |
} |
$requete .= |
' ORDER BY '.$this->_info_table_zg['nom_chp_nom_zone'].' ASC'; |
$resultat = mysql_query ($requete) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
$resultat = mysql_query ($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, |
'', $requete)); |
$i=0; |
794,7 → 792,7 |
//echo $this->fond.'<BR>'; |
$image_fond = imagecreatefrompng($this->fond); |
$taille_palette = imagecolorstotal ($image_fond); |
if (!$image_fond) echo 'erreur fond'; |
if (!$image_fond) echo 'erreur fond : '.$this->fond; |
// Pour chaque couleur contenue dans l'image, nous cherchons l'objet correspondant |
// dans le tableau $att, qui contient des informations sur chaque zone de l'image, |
// et nous attribuons à l'objet la valeur de l'index de sa couleur dans l'image. |
1193,6 → 1191,9 |
//-- Fin du code source ------------------------------------------------------------ |
/* |
* $Log: not supported by cvs2svn $ |
* Revision 1.4 2006/04/04 12:23:05 florian |
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire |
* |
* Revision 1.3 2005/12/07 14:59:14 alexandre_tb |
* suppression d'un echo |
* |
/trunk/client/bottin/cartographie.php |
---|
26,11 → 26,11 |
*@version 03 mai 2004 |
// +-----------------------------------------------------------------------------------------------+ |
// |
// $Id: cartographie.php,v 1.5 2006-04-19 13:49:04 alexandre_tb Exp $ |
// $Id: cartographie.php,v 1.6 2006-12-01 13:23:17 florian Exp $ |
// FICHIER : $RCSfile: cartographie.php,v $ |
// AUTEUR : $Author: alexandre_tb $ |
// VERSION : $Revision: 1.5 $ |
// DATE : $Date: 2006-04-19 13:49:04 $ |
// AUTEUR : $Author: florian $ |
// VERSION : $Revision: 1.6 $ |
// DATE : $Date: 2006-12-01 13:23:17 $ |
*/ |
include_once PAP_CHEMIN_RACINE.'/client/bottin/configuration/bottin.config.inc.php'; |
include_once INS_CHEMIN_APPLI.'configuration/cartographie.config.inc.php'; |
47,9 → 47,63 |
} |
//================================================================================================ |
function construit_hierarchie(&$info_zone, &$carto_config, $info_zone_hierarchie, &$monde) { |
static $i=0; |
$i++; |
function afficherContenuCorps() |
{ |
//on ajoute la carto en cours en tant que fils |
$monde->ajouterFils($info_zone_hierarchie->czh_code_alpha, $info_zone_hierarchie->czh_identifiant_table_info_couleur, |
$info_zone_hierarchie->czh_nom, $info_zone_hierarchie->czh_fichier_masque, |
$info_zone_hierarchie->czh_fichier_image, ''); |
$monde->fils[$info_zone_hierarchie->czh_code_alpha]->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ; |
//requete pour trouver les fils de la carte de depart voulue |
$requete_zone_fils = 'SELECT * FROM carto_zone_hierarchie '. |
'WHERE czh_id_zone_pere='.$info_zone_hierarchie->czh_id_zone;/*echo $requete_zone_fils;*/ |
$resultat_zone_fils = $GLOBALS['ins_db']->query($requete_zone_fils) ; |
if (DB::isError($resultat_zone_fils )) { |
echo ($resultat_zone_fils->getMessage().'<br />'.$resultat_zone_fils->getDebugInfo()).'<br />'.$requete_zone_fils ; |
} |
if ($resultat_zone_fils->numRows()!=0) { |
while ($ligne_zone_fils = $resultat_zone_fils ->fetchRow(DB_FETCHMODE_OBJECT)) { |
//requete pour obtenir toutes les infos (repartition par zones, nom des tables et champs pour les couleurs,.. ) pour la carte à afficher |
$requete_01 = 'SELECT '.$ligne_zone_fils->czh_nom_champs_id_pere.',count('.$ligne_zone_fils->czh_nom_champs_id_pere.') AS nbr'. |
' FROM '.$carto_config['cc_table1'].', '.$ligne_zone_fils->czh_nom_table_info_couleur; |
if ($carto_config['cc_table2']!=0) $requete_01 .= ', '.$carto_config['cc_table2']; |
$requete_01 .= ' WHERE '.$ligne_zone_fils->czh_champs_jointure_annuaire.' = '.$ligne_zone_fils->czh_nom_champs_id; |
if ($carto_config['cc_sql']!='') $requete_01 .= ' AND ('.$carto_config['cc_sql'].')'; |
$requete_01 .= ' GROUP BY '.$ligne_zone_fils->czh_nom_champs_id_pere; |
$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ; |
if (DB::isError($resultat_01)) { |
echo ($resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo()).'<br />'.$requete_01 ; |
} |
$tableau_repartition=array(); |
while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) { |
$id=$ligne_zone_fils->czh_nom_champs_id_pere; |
$tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; |
} |
$info_zone[$i]['nom_table_zone'] =$info_zone_hierarchie->czh_nom_table_info_couleur; |
$info_zone[$i]['nom_chp_id_zone'] =$info_zone_hierarchie->czh_nom_champs_id; |
$info_zone[$i]['nom_chp_nom_zone'] =$info_zone_hierarchie->czh_nom_champs_intitule; |
$info_zone[$i]['nom_chp_rouge'] =$info_zone_hierarchie->czh_nom_champs_couleur_R; |
$info_zone[$i]['nom_chp_vert'] =$info_zone_hierarchie->czh_nom_champs_couleur_V; |
$info_zone[$i]['nom_chp_bleu'] =$info_zone_hierarchie->czh_nom_champs_couleur_B; |
$info_zone[$i]['nom_chp_zone_sup'] =$info_zone_hierarchie->czh_nom_champs_id_pere; |
$info_zone[$i]['tableau_valeurs_zone'] = $tableau_repartition; |
if ($i == 1) { |
$monde->_info_table_zg = $info_zone[1]; |
$monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ; |
construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde); |
} else { |
$monde->_info_table_zg = $info_zone[$i]; |
construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$info_zone_hierarchie->czh_code_alpha]); |
} |
} |
} |
} |
function afficherContenuCorps() { |
global $image_x; |
global $image_y; |
global $historique_cartes; |
67,110 → 121,94 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
if ($resultat->numRows()>0) { |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
//valeurs par defaut enregistrees dans la table |
$titre=$ligne['cc_titre_carto']; |
$nom_table1=$ligne['cc_table1']; |
$nom_table2=$ligne['cc_table2']; |
$nom_champs_pays=$ligne['cc_pays']; |
$nom_champs_cp=$ligne['cc_cp']; |
$requete_sql=$ligne['cc_sql']; |
} |
$carto_config = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
//on affiche les infos lorsqu'on regarde une fiche |
if ( isset($_GET['voir_fiche']) or isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) { |
$res = affiche_onglet_info(); |
} else { |
//================================================================================================= |
$requete_01 = 'SELECT CP_ID_Continent,count(cp_id_continent) AS nbr'. |
' FROM '.$nom_table1.', carto_PAYS'; |
if ($nom_table2!=0) $requete_01 .= ', '.$nom_table2; |
$requete_01 .= ' WHERE '.$nom_champs_pays.' = cp_id_pays'; |
if ($requete_sql!='') $requete_01 .= ' AND ('.$requete_sql.')'; |
$requete_01 .= ' GROUP BY cp_id_continent'; |
$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ; |
if (DB::isError($resultat_01)) { |
die ($resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo()) ; |
//requete pour afficher la carte de depart voulue dans la conf. |
$requete_zone_hierarchie = 'SELECT * FROM carto_zone_hierarchie WHERE czh_id_zone='.$carto_config['cc_ce_premiere_carte']; |
$resultat_zone_hierarchie = $GLOBALS['ins_db']->query($requete_zone_hierarchie) ; |
if (DB::isError($resultat_zone_hierarchie )) { |
echo ($resultat_zone_hierarchie->getMessage().'<br />'.$resultat_zone_hierarchie->getDebugInfo()) ; |
} |
$tableau_ad_continent=array(); |
while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_ad_continent[$ligne_01->CP_ID_Continent] = $ligne_01->nbr; |
$ligne_zone_hierarchie = $resultat_zone_hierarchie ->fetchRow(DB_FETCHMODE_OBJECT); |
} |
$info_continent['nom_table_zone'] = 'carto_CONTINENT'; |
$info_continent['nom_chp_id_zone'] = 'CC_ID_Continent'; |
$info_continent['nom_chp_nom_zone'] = 'CC_Intitule_continent'; |
$info_continent['nom_chp_rouge'] = 'CC_Couleur_R'; |
$info_continent['nom_chp_vert'] = 'CC_Couleur_V'; |
$info_continent['nom_chp_bleu'] = 'CC_Couleur_B'; |
$info_continent['nom_chp_zone_sup'] = ''; |
$info_continent['tableau_valeurs_zone'] = $tableau_ad_continent; |
//initialisation de la variable 2 dimensions, contenant les infos specifiques a chaque echelle de territoire |
$info_zone= array(); |
$monde = new Carto_Carte($ligne_zone_hierarchie->czh_code_alpha, '', $ligne_zone_hierarchie->czh_nom, |
$ligne_zone_hierarchie->czh_fichier_masque, $ligne_zone_hierarchie->czh_fichier_image, |
INS_CHEMIN_APPLI.'presentations/fonds/', ''); |
construit_hierarchie($info_zone, $carto_config, $ligne_zone_hierarchie, $monde); |
echo '<pre>'.var_dump($monde).'</pre>'; |
//============================================================================================================ |
$requete_02 = 'SELECT CC_ID_Continent FROM carto_CONTINENT'; |
$resultat_02 = $GLOBALS['ins_db']->query($requete_02) ; |
if (DB::isError($resultat_02)) { |
die ($resultat_02->getMessage().'<br />'.$resultat_02->getDebugInfo()) ; |
//requete |
// $requete_02 = 'SELECT CC_ID_Continent FROM carto_CONTINENT'; |
// |
// $resultat_02 = $GLOBALS['ins_db']->query($requete_02) ; |
// if (DB::isError($resultat_02)) { |
// die ($resultat_02->getMessage().'<br />'.$resultat_02->getDebugInfo()) ; |
// } |
// |
// while ($ligne_02 = $resultat_02->fetchRow(DB_FETCHMODE_OBJECT)) { |
// $requete_03 = 'SELECT CP_ID_Pays, count(cp_id_pays) as nbr '. |
// ' FROM '.$nom_table1.', carto_PAYS'; |
// if ($nom_table2!=0) $requete_03 .= ', '.$nom_table2; |
// $requete_03 .= ' WHERE '.$nom_champs_pays.'= cp_id_pays'; |
// if ($requete_sql!='') $requete_03 .= ' AND ('.$requete_sql.')'; |
// $requete_03 .= ' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'. |
// ' GROUP BY cp_id_pays'; |
// $resultat_03 = $GLOBALS['ins_db']->query($requete_03) ; |
// if (DB::isError($resultat_03)) { |
// die ($resultat_03->getMessage().'<br />'.$resultat_03->getDebugInfo()) ; |
// } |
// |
// $tableau_ad_pays = array(); |
// while ($ligne_03 = $resultat_03->fetchRow(DB_FETCHMODE_OBJECT)) { |
// $tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr; |
// } |
// |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS'; |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays'; |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays'; |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R'; |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V'; |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B'; |
// $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent'; |
// $info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays; |
} |
while ($ligne_02 = $resultat_02->fetchRow(DB_FETCHMODE_OBJECT)) { |
$requete_03 = 'SELECT CP_ID_Pays, count(cp_id_pays) as nbr '. |
' FROM '.$nom_table1.', carto_PAYS'; |
if ($nom_table2!=0) $requete_03 .= ', '.$nom_table2; |
$requete_03 .= ' WHERE '.$nom_champs_pays.'= cp_id_pays'; |
if ($requete_sql!='') $requete_03 .= ' AND ('.$requete_sql.')'; |
$requete_03 .= ' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'. |
' GROUP BY cp_id_pays'; |
$resultat_03 = $GLOBALS['ins_db']->query($requete_03) ; |
if (DB::isError($resultat_03)) { |
die ($resultat_03->getMessage().'<br />'.$resultat_03->getDebugInfo()) ; |
} |
$tableau_ad_pays = array(); |
while ($ligne_03 = $resultat_03->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr; |
} |
$info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent'; |
$info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays; |
} |
//============================================================================================================ |
//if (!isset($_POST['historique_cartes']) && INS_ECHELLE_DEPART!='france') { |
$requete_04 = 'SELECT CD_ID_Departement, count(cd_id_departement) as nbr'. |
' FROM '.$nom_table1.', carto_DEPARTEMENT'. |
' WHERE '.$nom_champs_pays.' = "fr"'. |
' AND SUBSTRING('.$nom_champs_cp.' FROM 1 FOR 2) = cd_id_Departement'. |
' GROUP BY cd_id_Departement'; |
$resultat_04 = $GLOBALS['ins_db']->query ($requete_04) ; |
$tableau_ad_dpt_france = array(); |
while ($ligne_04 = $resultat_04->fetchRow(DB_FETCHMODE_OBJECT)) { |
$tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr; |
} |
$info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT'; |
$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement'; |
$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement'; |
$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R'; |
$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V'; |
$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B'; |
$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays'; |
$info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france; |
// //============================================================================================================ |
// //if (!isset($_POST['historique_cartes']) && INS_ECHELLE_DEPART!='france') { |
// $requete_04 = 'SELECT CD_ID_Departement, count(cd_id_departement) as nbr'. |
// ' FROM '.$nom_table1.', carto_DEPARTEMENT'. |
// ' WHERE '.$nom_champs_pays.' = "fr"'. |
// ' AND SUBSTRING('.$nom_champs_cp.' FROM 1 FOR 2) = cd_id_Departement'. |
// ' GROUP BY cd_id_Departement'; |
// $resultat_04 = $GLOBALS['ins_db']->query ($requete_04) ; |
// $tableau_ad_dpt_france = array(); |
// while ($ligne_04 = $resultat_04->fetchRow(DB_FETCHMODE_OBJECT)) { |
// $tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr; |
//} |
// $info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT'; |
// $info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement'; |
// $info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement'; |
// $info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R'; |
// $info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V'; |
// $info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B'; |
// $info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays'; |
// $info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france; |
// //} |
// |
//============================================================================================================ |
//============================================================================================================ |
// On cree tout d'abord l'arborescence |
$monde = new Carto_Carte('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', INS_CHEMIN_APPLI.'presentations/fonds/', $info_continent); |
$monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ; |
/* |
$monde = new Carto_Carte('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', |
INS_CHEMIN_APPLI.'presentations/fonds/', $info_zone[1]); |
$monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;*/ |
if (isset($_POST['historique_cartes'])) { |
$monde->historique_cartes = $_POST['historique_cartes']; |
} else { |
180,8 → 218,8 |
$monde->image_y = $image_y; |
$monde->liste_zone_carte = $liste_zone_carte; |
$monde->url = $GLOBALS['ins_url']->getURL(); |
foreach ($info_pays as $cle => $valeur) { |
/* |
foreach ($info_zone[2] as $cle => $valeur) { |
$requete_05 = |
"SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte". |
" FROM carto_DESCRIPTION_CARTE, carto_ACTION ". |
198,10 → 236,10 |
$ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur); |
$monde->fils[$ligne_05->CDC_ID_Carte]->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ; |
} |
*/ |
//$monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france.png', $info_zone[3]); |
//$monde->fils['europe']->fils['france']->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ; |
$monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france.png', $info_dpt_france); |
$monde->fils['europe']->fils['france']->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ; |
// Une fois l'arborescence créée on lance la methode donnerFormulaireImage() pour recuperer la carte |
// (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer |
// le niveau ou on en est grace a $monde->historique (du type continent*namerique*ca). |
215,7 → 253,7 |
} |
// Quoi qu'il arrive, on ouvre la balise formulaire |
if ($titre!='') $res = '<h1>'.$titre.'</h1>'."\n"; |
if ($carto_config['cc_titre_carto']!='') $res = '<h1>'.$carto_config['cc_titre_carto'].'</h1>'."\n"; |
else $res = '<h1>'.INS_CARTOGRAPHIE.'</h1>'."\n"; |
$res .= '<form name="formmail" action="'.$monde->url.'" method="post">'."\n"; |
if ((INS_AFFICHE_ECHELLE)and($img)) { |
224,7 → 262,7 |
} |
if (!$img ) { |
//include 'bibliotheque/cartographie.fonct.liste_inscrit.php'; |
$res .= carto_liste_fiches($monde, $nom_table1, $nom_table2, $nom_champs_pays, $nom_champs_cp, $requete_sql); |
$res .= carto_liste_fiches($monde, $carto_config['cc_table1'], $carto_config['cc_table2'], $carto_config['cc_pays'],$carto_config['cc_cp'], $carto_config['cc_sql']); |
return $res; |
} else { |
$res .= $img; |
233,7 → 271,6 |
$res .= INS_COULEUR."\n".'</p>'."\n"; |
} |
$res .= '</form>'."\n"; |
} |
return $res; |
//---------------------------------------------------------------------------------------------------------------------- |
247,6 → 284,9 |
//-- Fin du code source ------------------------------------------------------------ |
/* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2006/04/19 13:49:04 alexandre_tb |
* correction de bug sur l'utilisation de l'id_menu de papyrus |
* |
* Revision 1.4 2006/04/10 14:01:36 florian |
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions |
* |
/trunk/client/bottin/langues/annuaire_backoffice.langue.fr.inc.php |
---|
File deleted |
\ No newline at end of file |
/trunk/client/bottin/langues/bottin.langue_fr.inc.php |
---|
19,7 → 19,7 |
// | 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: bottin.langue_fr.inc.php,v 1.14 2006-10-05 13:53:54 florian Exp $ |
// CVS : $Id: bottin.langue_fr.inc.php,v 1.15 2006-12-01 13:23:16 florian Exp $ |
/** |
* Fichier de traduction en français de l'application ins_annuaire |
* |
29,7 → 29,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.14 $ $Date: 2006-10-05 13:53:54 $ |
*@version $Revision: 1.15 $ $Date: 2006-12-01 13:23:16 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
70,6 → 70,7 |
define ('INS_FONCTION', 'Fonction') ; |
define ('INS_TELEPHONE', 'Téléphone'); |
define ('INS_FAX','Fax'); |
define ('INS_LOGO_OU_IMAGE', 'Insérer une image ou un logo (.jpg, .png ou .gif, 150Ko max.)'); |
define ('INS_ANNULER', 'Annuler') ; |
define ('INS_RETABLIR', 'Rétablir') ; |
define ('INS_VALIDER', 'Valider') ; |
219,6 → 220,25 |
define ('INS_COMPETENCES', 'Compétences'); |
define ('INS_COMPETENCES_ASSOCIEES','Compétences associées'); |
define ('INS_RETOUR_A_LA_CARTE','Retour à la carte : '); |
//annuaire backoffice |
define ('INS_CONFIG_ANNUAIRE_BACKOFFICE','Configuration de la gestion de l\'annuaire'); |
define ('INS_TYPE_ANNUAIRE','Type d\'annuaire à configurer'); |
define ('INS_ANNUAIRE_BOTTIN','Annuaire du bottin'); |
define ('INS_ANNUAIRE_ADMIN_PAPYRUS','Annuaire des administrateurs Papyrus'); |
define ("AM_L_TITRE", "Chercher un adhérent") ; |
define ("AM_L_RECHERCHER", "Rechercher") ; |
define ("AM_L_PAYS", "Pays") ; |
define ("AM_L_NOM", "Nom") ; |
define ("AM_L_PRENOM", "Prénom") ; |
define ("AM_L_VILLE", "Ville") ; |
define ("AM_L_DEPARTEMENT", "Département") ; |
define ("AM_L_MAIL", "Mail") ; |
define ("AM_L_COTISANTS", "Cotisants") ; |
define ("AM_L_GRP_RES", "Grouper les résultats") ; |
define ("AM_L_TOUS", "Tous") ; |
define ("AM_L_MAIL_SELECTION", "Envoyer un mail à la sélection") ; |
//define ('ANN_PAS_D_INSCRITS', 'Pas d\'inscrits commençant par cette lettre dans l\'annuaire.'); |
//define ("ANN_LANGUES_PARLES", "Langues parlés :") ; |
//define ("ANN_EMAIL", "Courriel :") ; |
254,6 → 274,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.14 2006/10/05 13:53:54 florian |
* amélioration des fichiers sql |
* |
* Revision 1.13 2006/09/13 12:31:18 florian |
* ménage: fichier de config Papyrus, fichiers temporaires |
* |
/trunk/client/bottin/presentations/logos/logo.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/bottin/presentations/logos/vide.txt |
---|
--- client/bottin/annuaire_backoffice.php (revision 1080) |
+++ client/bottin/annuaire_backoffice.php (revision 1081) |
@@ -19,7 +19,7 @@ |
// | 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: annuaire_backoffice.php,v 1.2 2006-01-02 09:51:54 alexandre_tb Exp $ |
+// CVS : $Id: annuaire_backoffice.php,v 1.3 2006-12-01 13:23:17 florian Exp $ |
/** |
* programme principal du module annuaire_moteur |
* |
@@ -31,7 +31,7 @@ |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
-*@version $Revision: 1.2 $ |
+*@version $Revision: 1.3 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
@@ -43,27 +43,35 @@ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once 'configuration/bottin.config.inc.php'; |
-include_once INS_CHEMIN_APPLI.'configuration/annuaire_backoffice.config.inc.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/annuaire.fonct.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/annuaire_backoffice.fonct.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php'; |
+$lang=INS_LANGUE_DEFAUT; |
+define ("ANN_MAIL_TOUS", 1) ; |
+define ("ANN_MAIL_TOUS_ENVOIE", 2) ; |
-if (!isset($GLOBALS['lang'])) { |
- $GLOBALS['lang'] = INS_LANGUE_DEFAUT ; |
+// Recherche parametres menu actif : ils ne sont pas present dans le contexte, quel dommage ! |
+$requete_menu = 'SELECT gm_application_arguments '. |
+ 'FROM gen_menu '. |
+ 'WHERE gm_id_menu = '.$_GET['menu']; |
+$resultat_menu = $GLOBALS['_GEN_commun']['pear_db']->query($requete_menu); |
+$info_menu = $resultat_menu->fetchRow(DB_FETCHMODE_OBJECT); |
+$resultat_menu->free(); |
+if (isset($info_menu->gm_application_arguments)) { |
+ $arguments = explode(' ', $info_menu->gm_application_arguments); |
+ for ($i = 0; $i < count($arguments); $i++) { |
+ $attr = explode('=', $arguments[$i]); |
+ if ($attr[0] != '') { |
+ $info_application->$attr[0] = (isset($attr[1]) ? $attr[1] : ''); |
} |
-include_once INS_CHEMIN_APPLI."langues/bottin_langue_".$GLOBALS['lang'].".inc.php" ; |
- |
-if (isset($lang)) { |
- include_once INS_CHEMIN_APPLI."/langues/annuaire_backoffice.langue.$lang.inc.php" ; |
-} else { |
- include_once INS_CHEMIN_APPLI.'/langues/annuaire_backoffice.langue.fr.inc.php' ; |
} |
+} |
+//cas de l'annuaire admin papyrus, on modifie certaines constantes |
+if ($info_application->type_annuaire==1) { |
+ include_once INS_CHEMIN_APPLI.'configuration/annuaire_backoffice.config.inc.php'; |
+} |
-define ("ANN_MAIL_TOUS", 1) ; |
-define ("ANN_MAIL_TOUS_ENVOIE", 2) ; |
- |
- |
function afficherContenuCorps () { |
global $statut ; |
/trunk/client/bottin/configuration/annuaire_backoffice.config.inc.php |
---|
10,58 → 10,24 |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> | |
// +--------------------------------------------------------------------------------+ |
// |
// $Id: annuaire_backoffice.config.inc.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $ |
// $Id: annuaire_backoffice.config.inc.php,v 1.2 2006-12-01 13:23:16 florian Exp $ |
/** |
//=========================DEFINITION DE VARIABLES ================================= |
* Définition des variables globales |
//================================================================================== |
*/ |
global $GS_GLOBAL, $_SERVER ; |
/** |
//==================================== LES URLS ================================== |
* Constantes liées à l'utilisation des url |
//================================================================================== |
*/ |
define("AM_BASE_URL", 'http://'.$_SERVER["HTTP_HOST"].'/');//URL de base. Exemple: http://www.tela-botanica.org/ |
define("AM_URL_DOCUMENT",'index.php?project='.$GS_GLOBAL['project'].'&locale='. |
$GS_GLOBAL['locale'].'&doc='.$GS_GLOBAL['document_row']->GD_NOM.'&page='. |
$GS_GLOBAL['current_page_ndx']); //l'url de base de l'apllication |
/** |
//==================================== LES CHEMINS ================================= |
* Constantes définissant les chemins d'accé au différents fichiers inclus dans les |
* applications. |
//================================================================================== |
*/ |
define("AM_CHEMIN_APPLI",'client/applications_clientes/annuaire/');//le chemin vers l'application courrante |
define("AM_CHEMIN_PHP",'php/');//le chemin vers les fichiers propre à GSITE // obsolète ! |
define("AM_CHEMIN_LIBRAIRIE",'client/bibliotheque_client/fonctions/');//le chemin de la librairie de fichier php |
/** |
//==================================== CONSTANTES ================================== |
* Constantes de connexion aux bases de données MySQL |
* Constantes des noms de tables et de champs dans l'annuaire admin papyrus |
//================================================================================== |
*/ |
define("AM_HOTE","brille.logicosme.net"); |
define("AM_UTILISATEUR","botanica"); |
define("AM_MDP","wuzvw90fq"); |
define("AM_BD_BOTA", $GS_GLOBAL['mysql_db']);//Nom de la base des tables de chorologie |
define("AM_BD_LINK", $GS_GLOBAL['link']);//Nom de la base des tables de la carto (et éventuellement de chorologie) |
/** |
//==================================== CONSTANTES ================================== |
* Constantes des noms de tables et de champs dans l'annuaire |
//================================================================================== |
*/ |
define ("AM_ANNUAIRE", "annuaire_tela") ; // Nom de la table d'annuaire |
define ("AM_NOM", "U_NAME") ; // Nom du champs nom |
define ("AM_MAIL", "U_MAIL") ; // Nom du champs mail |
define ("AM_PRENOM", "U_SURNAME") ; // Nom du champs prénom |
define ("AM_DPT", "gen_FRENCH_DPT") ; // Nom de la table département |
define ("AM_PAYS", "gen_COUNTRY") ; // Nom de la table pays |
/** Nom de la table Annuaire */ |
define ('INS_ANNUAIRE', 'gen_annuaire'); |
/** Champs identifiant */ |
define ('INS_CHAMPS_ID', 'ga_id_administrateur'); |
/** Champs adresse mail */ |
define ('INS_CHAMPS_MAIL', 'ga_mail'); |
/** Champs nom */ |
define ('INS_CHAMPS_NOM', 'ga_nom'); |
/** Champs prénom */ |
define ('INS_CHAMPS_PRENOM', 'ga_prenom'); |
/** Champs mot de passe */ |
define ('INS_CHAMPS_PASSE', 'ga_mot_de_passe'); |
?> |
/trunk/client/bottin/configuration/bottin.config.inc.php |
---|
19,7 → 19,7 |
// | 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: bottin.config.inc.php,v 1.13 2006-09-20 14:56:41 alexandre_tb Exp $ |
// CVS : $Id: bottin.config.inc.php,v 1.14 2006-12-01 13:23:17 florian Exp $ |
/** |
* Fichier de configuration de l'application d'inscription/annuaire |
* |
32,7 → 32,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.13 $ $Date: 2006-09-20 14:56:41 $ |
*@version $Revision: 1.14 $ $Date: 2006-12-01 13:23:17 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
//================================= CONSTANTES DB ================================== |
98,7 → 98,10 |
define ('INS_CHAMPS_VISIBLE', 'a_voir_sur_carto'); |
/** Champs pour la vue sur carto*/ |
define ('INS_CHAMPS_NUM_AGREMENT', 'a_num_agrement_fpc'); |
/** Champs pour le logo*/ |
define ('INS_CHAMPS_LOGO', 'a_logo'); |
if (INS_CHAMPS_LETTRE != '') { |
/** adresse d'inscription à la newsletter */ |
define ('INS_MAIL_INSCRIPTION_LISTE', 'newsletter-subscribe@domaine.org'); |
240,6 → 243,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.13 2006/09/20 14:56:41 alexandre_tb |
* correction de la valeur par défaut INS_CHAMPS_I18N_PAYS |
* |
* Revision 1.12 2006/09/12 15:44:18 alexandre_tb |
* suppression du $GLOBALS['mail_admin'] en double |
* |
/trunk/client/bottin/inscription.php |
---|
19,7 → 19,7 |
// | 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: inscription.php,v 1.19 2006-10-05 13:53:54 florian Exp $ |
// CVS : $Id: inscription.php,v 1.20 2006-12-01 13:23:17 florian Exp $ |
/** |
* Inscription |
* |
32,7 → 32,7 |
//Autres auteurs : |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.19 $ $Date: 2006-10-05 13:53:54 $ |
*@version $Revision: 1.20 $ $Date: 2006-12-01 13:23:17 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
40,7 → 40,6 |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
include_once 'configuration/bottin.config.inc.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php'; |
// Inclusion d'une classe personnalisé si elle existe |
53,7 → 52,9 |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
if ( isset($_GET['voir_fiche']) or isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) { |
if ( isset($_GET['voir_fiche']) or isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) |
or (isset($_REQUEST['action'])&&($_REQUEST['action']=='modifier_v'||$_REQUEST['action']=='modifier_v')) |
or ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) ) { |
//---------------le menu de l'appli----------- |
function afficherContenuNavigation () { |
$res =inscription_onglets(); |
72,7 → 73,7 |
$GLOBALS['AUTH']->logout() ; |
$_POST['username'] = '' ; |
$_POST['password'] = '' ; |
return $res.AUTH_formulaire_login() ; |
return $res.inscription_AUTH_formulaire_login() ; |
} |
//cas de la désinscription------------------------------------------------------------------------------- |
103,12 → 104,12 |
// Deconnection |
$GLOBALS['AUTH']->logout() ; |
return $res.AUTH_formulaire_login() ; |
return $res.inscription_AUTH_formulaire_login() ; |
} |
//cas de l'envoi de mot de passe par mail---------------------------------------------------------------- |
if ($_REQUEST['action'] == 'sendpasswd') { |
return envoie_passe()."\n".formulaire_envoi_passe() ; |
return inscription_envoie_passe()."\n".inscription_formulaire_envoi_passe() ; |
} |
//cas de la saisie ou la modification de l'inscription individuelle ou structure |
129,7 → 130,7 |
//pour la modification d'une inscription, on charge les valeurs par défauts |
if ($_REQUEST['action'] == 'modifier') { |
$formulaire->addElement('hidden', 'action', 'modifier_v') ; |
$formulaire->setDefaults(formulaire_defaults()) ; |
$formulaire->setDefaults(inscription_formulaire_defaults()) ; |
} |
if ($_REQUEST['action'] == 'inscription') { |
144,12 → 145,11 |
if ($_REQUEST['action'] == 'inscription_v') { |
if ($formulaire->validate()) { |
if (INS_MAIL_VALIDATION_INSCRIPTION) { |
$formulaire->process('demande_inscription', false) ; |
$formulaire->process('inscription_demande', false) ; |
return $res.INS_MESSAGE_INSCRIPTION; |
} else { |
$formulaire->process('inscription_validee', false) ; |
$id_utilisateur = $GLOBALS['ins_db']->getOne('select '.INS_CHAMPS_ID.' from '.INS_ANNUAIRE.' where '. |
INS_CHAMPS_MAIL.'="'.$GLOBALS['AUTH']->getAuthData(INS_CHAMSP_MAIL).'"') ; |
$id_utilisateur = $GLOBALS['ins_db']->getOne('SELECT MAX('.INS_CHAMPS_ID.') FROM '.INS_ANNUAIRE) ; |
// Appel des actions des inscriptions des applications clientes |
$d = dir(GEN_CHEMIN_CLIENT); |
while (false !== ($repertoire = $d->read())) { |
166,7 → 166,7 |
} |
if ($_REQUEST['action'] == 'modifier_v') { |
if ($formulaire->validate()) { |
$formulaire->process('mise_a_jour', false) ; |
$formulaire->process('inscription_mise_a_jour', false) ; |
} else { |
return $formulaire->toHTML(); |
} |
188,7 → 188,7 |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
$donnees = unserialize (stripslashes($ligne->id_donnees)) ; |
$id_utilisateur = insertion($donnees) ; |
$id_utilisateur = inscription_insertion($donnees) ; |
$GLOBALS['AUTH']->username = $donnees['email'] ; |
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ; |
217,9 → 217,9 |
if ((!$GLOBALS['AUTH']->getAuth())&&($_REQUEST['action']!='inscription')&&($_REQUEST['action']!='inscription_v')) { |
if (isset($_POST['username']) && $_POST['username'] != '') { |
$res .= '<p class="erreur">'.INS_ERREUR_LOGIN.'</p><br />'."\n".formulaire_envoi_passe(); |
$res .= '<p class="erreur">'.INS_ERREUR_LOGIN.'</p><br />'."\n".inscription_formulaire_envoi_passe(); |
} else { |
$res .= AUTH_formulaire_login() ; |
$res .= inscription_AUTH_formulaire_login() ; |
} |
} |
234,6 → 234,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.19 2006/10/05 13:53:54 florian |
* amélioration des fichiers sql |
* |
* Revision 1.18 2006/07/20 09:48:07 alexandre_tb |
* réglages |
* |