import profil from AX for new subcription + some tiny error in verif_address.php
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Fri, 21 Jan 2005 23:54:40 +0000 (23:54 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:51 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-392

htdocs/profil.php
include/profil/verif_adresses.inc.php
include/synchro_ax.inc.php

index 5588d93..ef14602 100644 (file)
@@ -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
index b6edb28..eea8b37 100644 (file)
@@ -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++;
index f2e626f..5f71eea 100644 (file)
@@ -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:
 ?>