X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Flists.php;h=60ca0ee9cb0f845402c5dcf559c6a288f70bb254;hb=6bc4c6ef44c78ac6b9520ac1a8d9d4720a3828e2;hp=f6e01098aeba450e2405b34938d3489574db2668;hpb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;p=platal.git diff --git a/modules/lists.php b/modules/lists.php index f6e0109..60ca0ee 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -1,6 +1,6 @@ $this->make_hook('lists', AUTH_MDP, 'lists'), - 'lists/ajax' => $this->make_hook('ajax', AUTH_MDP, 'lists', NO_AUTH), + 'lists' => $this->make_hook('lists', AUTH_MDP), + 'lists/ajax' => $this->make_hook('ajax', AUTH_MDP, 'user', NO_AUTH), 'lists/create' => $this->make_hook('create', AUTH_MDP, 'lists'), - 'lists/members' => $this->make_hook('members', AUTH_COOKIE, 'lists'), - 'lists/csv' => $this->make_hook('csv', AUTH_COOKIE, 'lists'), - 'lists/annu' => $this->make_hook('annu', AUTH_COOKIE, 'lists'), - 'lists/archives' => $this->make_hook('archives', AUTH_COOKIE, 'lists'), - 'lists/archives/rss' => $this->make_hook('rss', AUTH_PUBLIC, 'lists', NO_HTTPS), + 'lists/members' => $this->make_hook('members', AUTH_COOKIE), + 'lists/csv' => $this->make_hook('csv', AUTH_COOKIE), + 'lists/annu' => $this->make_hook('annu', AUTH_COOKIE), + 'lists/archives' => $this->make_hook('archives', AUTH_COOKIE), + 'lists/archives/rss' => $this->make_hook('rss', AUTH_PUBLIC, 'user', NO_HTTPS), - 'lists/moderate' => $this->make_hook('moderate', AUTH_MDP, 'lists'), - 'lists/admin' => $this->make_hook('admin', AUTH_MDP, 'lists'), - 'lists/options' => $this->make_hook('options', AUTH_MDP, 'lists'), - 'lists/delete' => $this->make_hook('delete', AUTH_MDP, 'lists'), + 'lists/moderate' => $this->make_hook('moderate', AUTH_MDP), + 'lists/admin' => $this->make_hook('admin', AUTH_MDP), + 'lists/options' => $this->make_hook('options', AUTH_MDP), + 'lists/delete' => $this->make_hook('delete', AUTH_MDP), - 'lists/soptions' => $this->make_hook('soptions', AUTH_MDP, 'lists'), - 'lists/check' => $this->make_hook('check', AUTH_MDP, 'lists'), + 'lists/soptions' => $this->make_hook('soptions', AUTH_MDP), + 'lists/check' => $this->make_hook('check', AUTH_MDP), 'admin/lists' => $this->make_hook('admin_all', AUTH_MDP, 'admin'), ); } - function prepare_client(&$page, $user = null) + function prepare_client($page, $user = null) { global $globals; @@ -76,7 +76,7 @@ class ListsModule extends PLModule return array($subs, $mails); } - function handler_lists(&$page) + function handler_lists($page) { function filter_owner($list) { @@ -91,7 +91,6 @@ class ListsModule extends PLModule $domain = $this->prepare_client($page); $page->changeTpl('lists/index.tpl'); - $page->addJsLink('ajax.js'); $page->setTitle('Listes de diffusion'); @@ -133,7 +132,7 @@ class ListsModule extends PLModule } } - function handler_ajax(&$page, $list = null) + function handler_ajax($page, $list = null) { pl_content_headers("text/html"); $domain = $this->prepare_client($page); @@ -163,7 +162,7 @@ class ListsModule extends PLModule $page->assign_by_ref('liste', $liste); } - function handler_create(&$page) + function handler_create($page) { global $globals; @@ -309,7 +308,7 @@ class ListsModule extends PLModule } } - function handler_members(&$page, $liste = null) + function handler_members($page, $liste = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -348,7 +347,7 @@ class ListsModule extends PLModule } } - function handler_csv(PlPage &$page, $liste = null) + function handler_csv(PlPage $page, $liste = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -356,14 +355,14 @@ class ListsModule extends PLModule $this->prepare_client($page); $members = $this->client->get_members($liste); $list = list_fetch_basic_info(list_extract_members($members[1])); - pl_content_headers("text/x-csv"); + pl_cached_content_headers('text/x-csv', 1); echo "email,nom,promo\n"; echo implode("\n", $list); exit; } - function handler_annu(&$page, $liste = null, $action = null, $subaction = null) + function handler_annu($page, $liste = null, $action = null, $subaction = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -412,7 +411,7 @@ class ListsModule extends PLModule $page->assign_by_ref('owners', $moderos); } - function handler_archives(&$page, $liste = null, $action = null, $artid = null) + function handler_archives($page, $liste = null, $action = null, $artid = null) { global $globals; @@ -441,7 +440,7 @@ class ListsModule extends PLModule } } - function handler_rss(&$page, $liste = null, $alias = null, $hash = null) + function handler_rss($page, $liste = null, $alias = null, $hash = null) { if (!$liste) { return PL_NOT_FOUND; @@ -481,7 +480,7 @@ class ListsModule extends PLModule $liste, $domain, $mid, S::i('uid'), $action, Post::v('reason')); } - function handler_moderate(&$page, $liste = null) + function handler_moderate($page, $liste = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -512,8 +511,7 @@ class ListsModule extends PLModule $mailer->addTo("$liste-owner@{$domain}"); $mailer->addHeader('Reply-To', "$liste-owner@{$domain}"); $mailer->setSubject("L'inscription de {$sub['name']} a été $info"); - $text = "L'inscription de {$sub['name']} à la liste $liste@{$domain} a été $info par " . S::v('prenom') . ' ' - . S::v('nom') . '(' . S::v('promo') . ")\n"; + $text = "L'inscription de {$sub['name']} à la liste $liste@{$domain} a été $info par " . S::user()->fullName(true) . ".\n"; if (trim(Post::v('reason'))) { $text .= "\nLa raison invoquée est :\n" . Post::v('reason'); } @@ -599,7 +597,7 @@ class ListsModule extends PLModule } } - function handler_admin(&$page, $liste = null) + function handler_admin($page, $liste = null) { global $globals; @@ -732,7 +730,7 @@ class ListsModule extends PLModule } } - function handler_options(&$page, $liste = null) + function handler_options($page, $liste = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -799,7 +797,7 @@ class ListsModule extends PLModule } } - function handler_delete(&$page, $liste = null) + function handler_delete($page, $liste = null) { global $globals; if (is_null($liste)) { @@ -846,7 +844,7 @@ class ListsModule extends PLModule } } - function handler_soptions(&$page, $liste = null) + function handler_soptions($page, $liste = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -875,7 +873,7 @@ class ListsModule extends PLModule } } - function handler_check(&$page, $liste = null) + function handler_check($page, $liste = null) { if (is_null($liste)) { return PL_NOT_FOUND; @@ -898,7 +896,7 @@ class ListsModule extends PLModule } } - function handler_admin_all(&$page) + function handler_admin_all($page) { $page->changeTpl('lists/admin_all.tpl'); $page->setTitle('Administration - Mailing lists');