From: Florent Bruneau Date: Sun, 23 Sep 2007 13:09:08 +0000 (+0200) Subject: Move end of registration code from the profile module to the registration X-Git-Tag: xorg/0.9.15~113 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=97a0a459fb0d53cfa36d27d969bfe93422def960;p=platal.git Move end of registration code from the profile module to the registration module... Signed-off-by: Florent Bruneau --- diff --git a/modules/profile.php b/modules/profile.php index f33824c..1346856 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -278,44 +278,6 @@ class ProfileModule extends PLModule { global $globals; - // Finish registration procedure - 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'; - NewsLetter::subscribe(); - } - if (Post::v('add_to_ax')) { - require_once dirname(__FILE__) . '/axletter/axletter.inc.php'; - AXLetter::subscribe(); - } - 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); - $mmlist = new MMList(S::v('uid'), S::v('password')); - $mmlist->subscribe("promo".S::v('promo')); - } - if (Post::v('sub_ml')) { - $subs = array_keys(Post::v('sub_ml')); - $current_domain = null; - foreach ($subs as $list) { - list($sub, $domain) = explode('@', $list); - if ($domain != $current_domain) { - $current_domain = $domain; - $client = new MMList(S::v('uid'), S::v('password'), $domain); - } - $client->subscribe($sub); - } - } - // AX Synchronization require_once 'synchro_ax.inc.php'; if (is_ax_key_missing()) { diff --git a/modules/register.php b/modules/register.php index c3e4a7b..32c3fe6 100644 --- a/modules/register.php +++ b/modules/register.php @@ -28,6 +28,7 @@ class RegisterModule extends PLModule 'register/end' => $this->make_hook('end', AUTH_PUBLIC), 'register/end.php' => $this->make_hook('end_old', AUTH_PUBLIC), 'register/success' => $this->make_hook('success', AUTH_MDP), + 'register/save' => $this->make_hook('save', AUTH_MDP), ); } @@ -413,6 +414,51 @@ class RegisterModule extends PLModule $page->addJsLink('motdepasse.js'); } + + function handler_save(&$page) + { + global $globals; + + // Finish registration procedure + 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'; + NewsLetter::subscribe(); + } + if (Post::v('add_to_ax')) { + require_once dirname(__FILE__) . '/axletter/axletter.inc.php'; + AXLetter::subscribe(); + } + 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); + $mmlist = new MMList(S::v('uid'), S::v('password')); + $mmlist->subscribe("promo".S::v('promo')); + } + if (Post::v('sub_ml')) { + $subs = array_keys(Post::v('sub_ml')); + $current_domain = null; + foreach ($subs as $list) { + list($sub, $domain) = explode('@', $list); + if ($domain != $current_domain) { + $current_domain = $domain; + $client = new MMList(S::v('uid'), S::v('password'), $domain); + } + $client->subscribe($sub); + } + } + + pl_redirect('profile/edit'); + } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: diff --git a/templates/register/success.tpl b/templates/register/success.tpl index c343cf0..04256a0 100644 --- a/templates/register/success.tpl +++ b/templates/register/success.tpl @@ -94,7 +94,7 @@ traitées avec la priorité minimale.

Rejoindre la communauté

-
+

Pour rejoindre la communauté des X sur le web, nous te convions le plus vivement à remplir ton profil !!!