7b9d64a8 |
1 | <?php |
2 | /*************************************************************************** |
3 | * Copyright (C) 2003-2006 Polytechnique.org * |
4 | * http://opensource.polytechnique.org/ * |
5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * |
8 | * the Free Software Foundation; either version 2 of the License, or * |
9 | * (at your option) any later version. * |
10 | * * |
11 | * This program is distributed in the hope that it will be useful, * |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
14 | * GNU General Public License for more details. * |
15 | * * |
16 | * You should have received a copy of the GNU General Public License * |
17 | * along with this program; if not, write to the Free Software * |
18 | * Foundation, Inc., * |
19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * |
20 | ***************************************************************************/ |
21 | |
22 | require_once dirname(__FILE__).'/lists.php'; |
23 | |
24 | class XnetListsModule extends ListsModule |
25 | { |
26 | var $client; |
27 | |
28 | function handlers() |
29 | { |
30 | return array( |
31 | 'grp/lists' => $this->make_hook('lists', AUTH_MDP), |
32 | 'grp/lists/create' => $this->make_hook('create', AUTH_MDP), |
33 | |
34 | 'grp/lists/members' => $this->make_hook('members', AUTH_COOKIE), |
35 | 'grp/lists/trombi' => $this->make_hook('trombi', AUTH_COOKIE), |
36 | 'grp/lists/archives' => $this->make_hook('archives', AUTH_COOKIE), |
37 | |
38 | 'grp/lists/moderate' => $this->make_hook('moderate', AUTH_MDP), |
39 | 'grp/lists/admin' => $this->make_hook('admin', AUTH_MDP), |
40 | 'grp/lists/options' => $this->make_hook('options', AUTH_MDP), |
41 | 'grp/lists/delete' => $this->make_hook('delete', AUTH_MDP), |
42 | |
43 | 'grp/lists/soptions' => $this->make_hook('soptions', AUTH_MDP), |
44 | 'grp/lists/check' => $this->make_hook('check', AUTH_MDP), |
45 | |
46 | /* hack: lists uses that */ |
47 | 'profile' => $this->make_hook('profile', AUTH_PUBLIC), |
48 | ); |
49 | } |
50 | |
51 | function prepare_client(&$page) |
52 | { |
53 | global $globals; |
54 | |
55 | require_once 'lists.inc.php'; |
56 | |
57 | $this->client =& lists_xmlrpc(Session::getInt('uid'), |
58 | Session::get('password'), |
59 | $globals->asso('mail_domain')); |
60 | |
61 | $page->useMenu(); |
62 | $page->assign('asso', $globals->asso()); |
63 | $page->setType($globals->asso('cat')); |
64 | } |
65 | |
66 | function handler_profile(&$page, $user = null) |
67 | { |
68 | redirect('https://www.polytechnique.org/profile/'.$user); |
69 | } |
70 | } |
71 | |
72 | ?> |