Proof of concept:
[platal.git] / htdocs / profil.php
index 1d08633..42727de 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
 require_once("xorg.inc.php");
 new_skinned_page('profil.tpl',AUTH_MDP);
 $page->addCssLink('css/profil.css');
+$page->assign('xorg_title','Polytechnique.org - Mon Profil');
 
 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'));
+}
+
+require_once('synchro_ax.inc.php');
+if (is_ax_key_missing())
+    $page->assign('no_private_key', true);
+
+if (Env::get('synchro_ax') == 'confirm' && !is_ax_key_missing()) {
+    ax_synchronize(Session::get('bestalias'), Session::getInt('uid'));
+    $page->trig('Ton profil a été synchronisé avec celui du site polytechniciens.com');
 }
 
 //on met a jour $opened_tab et $new_tab qui sont le tab du POST et le tab demande