X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=aa518a051811c88d6468809adbe19bcfe293f9f5;hb=0fb07071cd99f867b48a527c90996601a079fff8;hp=5e9fcb9933c4498f9f284859b1f813ee54493164;hpb=d865c4a016f684116c4ffd9af78b05ee2fb46797;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index 5e9fcb9..aa518a0 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -29,6 +29,7 @@ class ProfileModule extends PLModule 'fiche.php' => $this->make_hook('fiche', AUTH_PUBLIC), 'profile' => $this->make_hook('profile', AUTH_PUBLIC), + 'profile/private' => $this->make_hook('profile', AUTH_COOKIE), 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP), 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP), 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP), @@ -190,6 +191,8 @@ class ProfileModule extends PLModule $new = Env::v('modif') == 'new'; $user = get_user_details($login, S::v('uid'), $view); + $user['freetext'] = preg_replace('/((?:https?|ftp):\/\/(?:&|\.*,*[a-z@0-9~%$£µ&i#\-+=_\/\?])*)/i', + '\\0', $user['freetext']); $title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage']; $page->assign('xorg_title', $title); @@ -251,12 +254,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); @@ -582,7 +600,6 @@ class ProfileModule extends PLModule require_once 'validations.inc.php'; require_once 'xorg.misc.inc.php'; - require_once dirname(__FILE__).'/../classes/Flagset.php'; $res = XDB::query( "SELECT u.nom, u.nom_usage, u.flags, e.alias @@ -755,7 +772,6 @@ class ProfileModule extends PLModule $page->assign('forlife', $forlife); } function handler_admin_binets(&$page, $action = 'list', $id = null) { - require_once('../classes/PLTableEditor.php'); $page->assign('xorg_title','Polytechnique.org - Administration - Binets'); $page->assign('title', 'Gestion des binets'); $table_editor = new PLTableEditor('admin/binets', 'binets_def', 'id'); @@ -764,7 +780,6 @@ class ProfileModule extends PLModule $table_editor->apply($page, $action, $id); } function handler_admin_formations(&$page, $action = 'list', $id = null) { - require_once('../classes/PLTableEditor.php'); $page->assign('xorg_title','Polytechnique.org - Administration - Formations'); $page->assign('title', 'Gestion des formations'); $table_editor = new PLTableEditor('admin/formations','applis_def','id'); @@ -774,7 +789,6 @@ class ProfileModule extends PLModule $table_editor->apply($page, $action, $id); } function handler_admin_groupesx(&$page, $action = 'list', $id = null) { - require_once('../classes/PLTableEditor.php'); $page->assign('xorg_title','Polytechnique.org - Administration - Groupes X'); $page->assign('title', 'Gestion des Groupes X'); $table_editor = new PLTableEditor('admin/groupes-x','groupesx_def','id'); @@ -784,7 +798,6 @@ class ProfileModule extends PLModule $table_editor->apply($page, $action, $id); } function handler_admin_medals(&$page, $action = 'list', $id = null) { - require_once('../classes/PLTableEditor.php'); $page->assign('xorg_title','Polytechnique.org - Administration - Distinctions'); $page->assign('title', 'Gestion des Distinctions'); $table_editor = new PLTableEditor('admin/medals','profile_medals','id');