Subversion Repositories Applications.papyrus

Rev

Rev 1731 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1731 Rev 1795
Line 703... Line 703...
703
                INS_CHAMPS_ID.'="'.$id_utilisateur.'",'.
703
                INS_CHAMPS_ID.'="'.$id_utilisateur.'",'.
704
                inscription_requete_annuaire($valeur) ;
704
                inscription_requete_annuaire($valeur) ;
Line 705... Line 705...
705
 
705
 
706
    $resultat = $GLOBALS['ins_db']->query($requete) ;
706
    $resultat = $GLOBALS['ins_db']->query($requete) ;
707
    if (DB::isError($resultat)) {
707
    if (DB::isError($resultat)) {
708
        return ($resultat->getMessage().$resultat->getDebugInfo()) ;
708
        return $resultat->raiseError();
Line 709... Line 709...
709
    }
709
    }
710
 
710
 
711
    // ================ Insertion dans SPIP =========================================
711
    // ================ Insertion dans SPIP =========================================
Line 786... Line 786...
786
		elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong'|| $tableau[$i]['type']=='champs_mail' 
786
		elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong'|| $tableau[$i]['type']=='champs_mail' 
787
						|| $tableau[$i]['type']=='champs_cache' || $tableau[$i]['type']=='lien_internet') {
787
						|| $tableau[$i]['type']=='champs_cache' || $tableau[$i]['type']=='lien_internet') {
788
			//on mets les slashes pour les saisies dans les champs texte et textearea
788
			//on mets les slashes pour les saisies dans les champs texte et textearea
789
			$val=addslashes($valeur[$tableau[$i]['nom_bdd']]) ;
789
			$val=addslashes($valeur[$tableau[$i]['nom_bdd']]) ;
790
			$requete .= $tableau[$i]['nom_bdd'].'="'.$val.'", ' ;
790
			$requete .= $tableau[$i]['nom_bdd'].'="'.$val.'", ' ;
-
 
791
			if ($tableau[$i]['type'] == 'champs_mail') $courriel = $val;
791
		}
792
		}
Line 792... Line 793...
792
		 
793
		 
793
		// Cas de la carte google
794
		// Cas de la carte google
794
		elseif ($tableau[$i]['type'] == 'carte_google') {
795
		elseif ($tableau[$i]['type'] == 'carte_google') {
Line 812... Line 813...
812
						desinscription_lettre($tableau[$i]['limite2']);
813
						desinscription_lettre($tableau[$i]['limite2']);
813
					}
814
					}
814
				}
815
				}
815
			} else {
816
			} else {
816
				if ($valeur[$tableau[$i]['nom_bdd']] == 1) {
817
				if ($valeur[$tableau[$i]['nom_bdd']] == 1) {
-
 
818
					
817
					inscription_lettre($tableau[$i]['limite1']);
819
					inscription_lettre($tableau[$i]['limite1'], $courriel);
818
				} else {
820
				} else {
819
					desinscription_lettre($tableau[$i]['limite2']);
821
					desinscription_lettre($tableau[$i]['limite2']);
820
				}
822
				}
821
			}
823
			}
822
		}
824
		}
Line 1158... Line 1160...
1158
 *
1160
 *
1159
 * @global  AUTH    Un objet PEAR::Auth
1161
 * @global  AUTH    Un objet PEAR::Auth
1160
 * @return  boolean true en cas de succes
1162
 * @return  boolean true en cas de succes
1161
 */
1163
 */
Line 1162... Line 1164...
1162
 
1164
 
1163
function inscription_lettre($email_inscription) {
1165
function inscription_lettre($email_inscription, $email = '') {
1164
    include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ;
1166
    include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ;
1165
    $mail = & Mail::factory ('mail') ;
1167
    $mail = & Mail::factory ('mail') ;
1166
    $email = $GLOBALS['AUTH']->getUsername() ;
1168
    if ($email == '') $email = $GLOBALS['AUTH']->getUsername() ;
1167
    $headers ['Return-Path'] = $email ;
1169
    $headers ['Return-Path'] = $email ;
1168
    $headers ['From'] = "<".$email.">" ;
1170
    $headers ['From'] = "<".$email.">" ;
1169
    $headers ['Subject'] = $email_inscription ;
1171
    $headers ['Subject'] = $email_inscription ;
Line 1309... Line 1311...
1309
 
1311
 
1310
 
1312
 
1311
//-- Fin du code source    ------------------------------------------------------------
1313
//-- Fin du code source    ------------------------------------------------------------
-
 
1314
/*
-
 
1315
* $Log$
-
 
1316
* Revision 1.28.2.2  2007-11-28 13:20:44  alexandre_tb
1312
/*
1317
* mise en place du moteur de l'annuaire basé sur le template du bottin.
1313
* $Log$
1318
*
1314
* Revision 1.28.2.1  2007-11-16 11:17:11  alexandre_tb
1319
* Revision 1.28.2.1  2007-11-16 11:17:11  alexandre_tb
1315
* amelioration gestion des newsletters
1320
* amelioration gestion des newsletters
1316
* amelioration de la fontion info()
1321
* amelioration de la fontion info()