X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=66d5c31eb2d92a076019291ba627a513ed5cfeb4;hb=69b7b6e9d2c1ab2a698257bd7882333c5b9c0b81;hp=d3a553000e199e4968667f4ab6bef19b05483691;hpb=5e1932971f861f2ca29f27384c6a502c4702de76;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index d3a5530..66d5c31 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -38,6 +38,7 @@ class ProfileModule extends PLModule 'referent/search' => $this->make_hook('ref_search', AUTH_COOKIE), 'trombi' => $this->make_hook('trombi', AUTH_COOKIE), + 'groupes-x' => $this->make_hook('xnet', AUTH_COOKIE), 'vcard' => $this->make_hook('vcard', AUTH_COOKIE), 'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'), @@ -186,13 +187,25 @@ class ProfileModule extends PLModule } if (empty($login)) { + if (preg_match('/([-a-z]+)\.([-a-z]+)\.([0-9]{4})/i', $x, $matches)) { + $matches = str_replace('-', '_', $matches); + $res = XDB::query("SELECT user_id + FROM auth_user_md5 + WHERE prenom LIKE {?} AND nom LIKE {?} AND promo = {?} + AND perms = 'pending'", + $matches[1], $matches[2], $matches[3]); + if ($res->numRows() == 1) { + $uid = $res->fetchOneCell(); + pl_redirect('marketing/public/' . $uid); + } + } return PL_NOT_FOUND; } $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']); + require_once('url_catcher.inc.php'); + $user['freetext'] = url_catcher($user['freetext'], false); $title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage']; $page->assign('xorg_title', $title); @@ -271,9 +284,8 @@ class ProfileModule extends PLModule 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')); + $mmlist = new MMList(S::v('uid'), S::v('password')); + $mmlist->subscribe("promo".S::v('promo')); } if (is_ax_key_missing()) { @@ -349,7 +361,7 @@ class ProfileModule extends PLModule // mise a jour des champs relatifs au tab ouvert require_once "profil/update_{$opened_tab}.inc.php"; - $log =& S::v('log'); + $log =& $_SESSION['log']; $log->log('profil', $opened_tab); $page->assign('etat_update', 'ok'); } @@ -636,8 +648,6 @@ class ProfileModule extends PLModule function handler_trombi(&$page, $promo = null) { - require_once 'trombi.inc.php'; - $page->changeTpl('trombipromo.tpl'); $page->assign('xorg_title', 'Polytechnique.org - Trombi Promo'); @@ -659,6 +669,20 @@ class ProfileModule extends PLModule } } + function handler_xnet(&$page) + { + $page->changeTpl('groupesx.tpl'); + $page->assign('xorg_title', 'Polytechnique.org - Promo, Groupes X, Binets'); + + $req = XDB::query(' + SELECT m.asso_id, a.nom, diminutif, COUNT(e.eid) AS events, mail_domain AS lists + FROM groupex.membres AS m + INNER JOIN groupex.asso AS a ON(m.asso_id = a.id) + LEFT JOIN groupex.evenements AS e ON(e.asso_id = m.asso_id) + WHERE uid = {?} GROUP BY m.asso_id ORDER BY a.nom', S::i('uid')); + $page->assign('assos', $req->fetchAllAssoc()); + } + function handler_vcard(&$page, $x = null) { if (is_null($x)) {