From 9a8b421ac3f22264e260a96ff817e5eccdb6bd04 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Fri, 21 Jan 2005 23:54:40 +0000 Subject: [PATCH] import profil from AX for new subcription + some tiny error in verif_address.php git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-392 --- htdocs/profil.php | 3 ++- include/profil/verif_adresses.inc.php | 1 + include/synchro_ax.inc.php | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/profil.php b/htdocs/profil.php index 5588d93..ef14602 100644 --- a/htdocs/profil.php +++ b/htdocs/profil.php @@ -26,9 +26,10 @@ $page->addCssLink('css/profil.css'); require_once('tabs.inc.php'); require_once('profil.func.inc.php'); - if (Post::has('register_from_ax_question')) { $globals->xdb->query('UPDATE auth_user_quick SET profile_from_ax = 1 WHERE user_id = {?}', Session::getInt('uid')); + require_once('synchro_ax.inc.php'); + copy_from_ax(Session::getInt('uid')); } //on met a jour $opened_tab et $new_tab qui sont le tab du POST et le tab demande diff --git a/include/profil/verif_adresses.inc.php b/include/profil/verif_adresses.inc.php index b6edb28..eea8b37 100644 --- a/include/profil/verif_adresses.inc.php +++ b/include/profil/verif_adresses.inc.php @@ -26,6 +26,7 @@ function generate_new_adrid(){ return 1; reset($adresses); $i = 0; + $adrid_array = Array(); foreach($adresses as $numero => $adr){ $adrid_array[$i] = $numero; $i++; diff --git a/include/synchro_ax.inc.php b/include/synchro_ax.inc.php index f2e626f..5f71eea 100644 --- a/include/synchro_ax.inc.php +++ b/include/synchro_ax.inc.php @@ -257,5 +257,11 @@ function import_from_ax($userax, $epouse=false, $mobile=false, $del_address=null } } +function copy_from_ax($uid) +{ + $uax = get_user_ax($uid); + import_from_ax($uax, true, true, null, array_keys($uax['adr']), null, array_keys($uax['adr_pro']), true); +} + // vim:set et sw=4 sts=4 sws=4: ?> -- 2.1.4