From 3845b13170e776ed0a52943edd22f8e866aec4df Mon Sep 17 00:00:00 2001
From: x2001corpet
Date: Sat, 16 Sep 2006 08:33:41 +0000
Subject: [PATCH] bug #459, optin pour NL/ML promo a l'inscription
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@840 839d8a87-29fc-0310-9880-83ba4fa771e5
---
ChangeLog | 3 +++
modules/profile.php | 19 +++++++++++++++++--
templates/register/success.tpl | 25 ++++++++++++++++++++-----
3 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8840b88..b8bd3b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -105,6 +105,9 @@ Bug/Wish:
- #344: Tels can be bigger (up to 30 chars). -Car
- #422: Parasitic strings in vcard. -FRU
+ * Register:
+ - #459: Opt-in for newsletter and promo mailing list on register. -Car
+
* Skins:
- #454: Layout of addresses -FRU
diff --git a/modules/profile.php b/modules/profile.php
index 1a6c1b8..795c99d 100644
--- a/modules/profile.php
+++ b/modules/profile.php
@@ -253,12 +253,27 @@ class ProfileModule extends PLModule
require_once 'profil.func.inc.php';
require_once 'synchro_ax.inc.php';
- if (Post::has('register_from_ax_question')) {
- XDB::query('UPDATE auth_user_quick
+ if (Post::v('register_from_ax_question')) {
+ XDB::execute('UPDATE auth_user_quick
SET profile_from_ax = 1
WHERE user_id = {?}',
S::v('uid'));
}
+ if (Post::v('add_to_nl')) {
+ require_once 'newsletter.inc.php';
+ subscribe_nl();
+ }
+ if (Post::v('add_to_promo')) {
+ $r = XDB::query('SELECT id FROM groupex.asso WHERE diminutif = {?}',
+ S::v('promo'));
+ $asso_id = $r->fetchOneCell();
+ XDB::execute('REPLACE INTO groupex.membres (uid,asso_id)
+ VALUES ({?}, {?})',
+ S::v('uid'), $asso_id);
+ require_once 'lists.inc.php';
+ $client =& lists_xmlrpc(S::v('uid'), S::v('password'));
+ $client->subscribe("promo".S::v('promo'));
+ }
if (is_ax_key_missing()) {
$page->assign('no_private_key', true);
diff --git a/templates/register/success.tpl b/templates/register/success.tpl
index aaf3a93..9c63fd6 100644
--- a/templates/register/success.tpl
+++ b/templates/register/success.tpl
@@ -98,18 +98,33 @@ trait
- Cette fonctionnalités n'est pas du tout redondante avec l'annuaire de l'AX, car nous pouvons synchroniser pour toi
+ Cette fonctionnalité n'est pas du tout redondante avec l'annuaire de l'AX, car nous pouvons synchroniser pour toi
les données qu'il contient :
+
+
+ Pour profiter pleinement de ta nouvelle inscription, nous te proposons
+
+
+
--
2.1.4