670,7 → 670,7 |
$GLOBALS['AUTH']->username = $valeurs['a_mail'] ; |
$GLOBALS['AUTH']->password = $valeurs['mot_de_passe'] ; |
// On loggue l'utilisateur |
$GLOBALS['AUTH']->login() ; |
$GLOBALS['AUTH']->start() ; |
// inscription a la lettre d'information |
if ($GLOBALS['ins_config']['ic_mail_inscription_news'] != '' && isset ($valeurs['lettre'])) { |
inscription_lettre($GLOBALS['ins_config']['ic_mail_inscription_news']) ; |
761,7 → 761,7 |
'where '.INS_CHAMPS_ID.'="'.$id.'"'; |
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
return ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
unset ($resultat) ; |
|
800,12 → 800,16 |
} |
|
//cas des images |
elseif ($tableau[$i]['type']=='image_simple') { |
if (isset($_FILES['image']['name']) && $_FILES['image']['name']!='') { |
//$requete .= baz_insertion_image($GLOBALS['_BAZAR_']['id_fiche']); |
elseif ($tableau[$i]['type']=='image') { |
if(is_file($_FILES['image']['tmp_name'])) { |
$chemin_destination= INS_CHEMIN_APPLI.'images/'.md5($_FILES['image']['name']).strrchr($_FILES['image']['name'], '.'); |
move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination); |
$chemin_destination= 'http://'.$_SERVER['HTTP_HOST'].'/'.$chemin_destination; |
$requete .= $tableau[$i]['nom_bdd'].'="'.$chemin_destination.'", '; |
} else { |
$chemin_destination=NULL; |
} |
} |
|
//cas des champs texte |
elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong'|| $tableau[$i]['type']=='champs_mail' |
|| $tableau[$i]['type']=='champs_cache' || $tableau[$i]['type']=='lien_internet') { |
821,7 → 825,17 |
elseif ($tableau[$i]['type'] == 'mot_de_passe') { |
$requete .= $tableau[$i]['nom_bdd'].'="'.md5($valeur['mot_de_passe']).'",'; |
} |
elseif ($tableau[$i]['type'] == 'newsletter') { |
$requete .= $tableau[$i]['nom_bdd'].'="'.$valeur[$tableau[$i]['nom_bdd']].'",'; |
// Si le champs newletter vaut cad, la case est coche, on inscrit le pretendant |
// a la lettre d actualite |
if ($valeur[$tableau[$i]['nom_bdd']] == 1) { |
inscription_lettre($tableau[$i]['limite1']); |
} else { |
desinscription_lettre($tableau[$i]['limite2']); |
} |
} |
} |
// traitement du numero de departement pour la france |
if ($valeur['a_ce_pays'] == 'fr') { |
if (preg_match("/^97|98[0-9]*/", $valeur['a_code_postal'])) { |
914,7 → 928,7 |
} |
$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"; |
$res .= '<img style="float:right;width:120px;height:120px;margin:0 0 10px 10px;" src="'.$ligne[INS_CHAMPS_LOGO].'" alt="logo" />'."\n"; |
} |
if ($ligne[INS_CHAMPS_EST_STRUCTURE] == 1) { |
$res .= '<h3>'.$ligne[INS_CHAMPS_NOM].'</h3>'."\n"; |
1020,6 → 1034,7 |
$res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'" onclick="javascript:return confirm(\''.INS_SUPPRIMER_INSCRIPTION.'?\');">'.INS_SUPPRIMER_INSCRIPTION.'</a></li>'."\n" ; |
$GLOBALS['ins_url']->removeQueryString('id_inscription'); |
$GLOBALS['ins_url']->addQueryString('action', 'deconnexion'); |
$GLOBALS['ins_url']->addQueryString('logout', 1); |
$res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'">'.INS_DECONNEXION.'</a></li>'."\n" ; |
$GLOBALS['ins_url']->removeQueryString('action'); |
$GLOBALS['ins_url']->removeQueryString('id_inscription'); |
1174,16 → 1189,16 |
* @return boolean true en cas de succes |
*/ |
|
function inscription_lettre($action) { |
function inscription_lettre($email_inscription) { |
include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ; |
$mail = & Mail::factory ('mail') ; |
$email = $GLOBALS['AUTH']->getUsername() ; |
$headers ['Return-Path'] = $email ; |
$headers ['From'] = "<".$email.">" ; |
$headers ['Subject'] = $action ; |
$headers ['Subject'] = $email_inscription ; |
$headers ['Reply-To'] = $email ; |
|
$mail -> send ($action, $headers, "") ; |
$mail -> send ($email_inscription, $headers, "") ; |
if (PEAR::isError ($mail)) { |
echo '<p class="erreur">Le mail n\'est pas parti...</p>' ; |
return false ; |
1196,19 → 1211,19 |
* a la liste |
* |
* @global AUTH Un objet PEAR::Auth |
* @return boolean true en cas de succès |
* @return boolean true en cas de succes |
*/ |
|
function desinscription_lettre($action) { |
function desinscription_lettre($email_desinscription) { |
include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ; |
$mail = & Mail::factory ('mail') ; |
$email = $GLOBALS['AUTH']->getUsername() ; |
$headers ['Return-Path'] = $email ; |
$headers ['From'] = "<".$email.">" ; |
$headers ['Subject'] = $action ; |
$headers ['Subject'] = $email_desinscription ; |
$headers ['Reply-To'] = $email ; |
|
$mail -> send ($action, $headers, "") ; |
$mail -> send ($email_desinscription, $headers, "") ; |
if (PEAR::isError ($mail)) { |
echo '<p class="erreur">Le mail n\'est pas parti...</p>' ; |
return false ; |
1390,6 → 1405,9 |
//-- Fin du code source ------------------------------------------------------------ |
/* |
* $Log$ |
* Revision 1.25 2007-10-01 12:16:04 alexandre_tb |
* ajout du type lien_internet, et encodage |
* |
* Revision 1.24 2007-09-07 14:23:03 alexandre_tb |
* retablissement d une div mal imbrique dans info() |
* |