Allow to customize the login page in handler_groupex.
[platal.git] / modules / lists.php
index eec6fa2..688b0b0 100644 (file)
@@ -26,23 +26,23 @@ class ListsModule extends PLModule
     function handlers()
     {
         return array(
-            'lists'              => $this->make_hook('lists',     AUTH_MDP),
+            'lists'              => $this->make_hook('lists',     AUTH_MDP,    'user'),
             '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/csv'          => $this->make_hook('csv',       AUTH_COOKIE),
-            'lists/annu'         => $this->make_hook('annu',      AUTH_COOKIE),
-            'lists/archives'     => $this->make_hook('archives',  AUTH_COOKIE),
+            'lists/members'      => $this->make_hook('members',   AUTH_COOKIE, 'user'),
+            'lists/csv'          => $this->make_hook('csv',       AUTH_COOKIE, 'user'),
+            'lists/annu'         => $this->make_hook('annu',      AUTH_COOKIE, 'user'),
+            'lists/archives'     => $this->make_hook('archives',  AUTH_COOKIE, 'user'),
             'lists/archives/rss' => $this->make_hook('rss',       AUTH_PUBLIC, 'user', NO_HTTPS),
 
-            '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/moderate'     => $this->make_hook('moderate',  AUTH_MDP,    'user'),
+            'lists/admin'        => $this->make_hook('admin',     AUTH_MDP,    'user'),
+            'lists/options'      => $this->make_hook('options',   AUTH_MDP,    'user'),
+            'lists/delete'       => $this->make_hook('delete',    AUTH_MDP,    'user'),
 
-            'lists/soptions'     => $this->make_hook('soptions',  AUTH_MDP),
-            'lists/check'        => $this->make_hook('check',     AUTH_MDP),
+            'lists/soptions'     => $this->make_hook('soptions',  AUTH_MDP,    'user'),
+            'lists/check'        => $this->make_hook('check',     AUTH_MDP,    'user'),
             'admin/lists'        => $this->make_hook('admin_all', AUTH_MDP,    'admin'),
             'admin/aliases'      => $this->make_hook('aaliases',  AUTH_MDP,    'admin')
         );
@@ -348,7 +348,7 @@ class ListsModule extends PLModule
         $list = list_fetch_basic_info(list_extract_members($members[1]));
         pl_cached_content_headers('text/x-csv', 1);
 
-        echo "email,nom,promo\n";
+        echo "nom,promo\n";
         echo implode("\n", $list);
         exit;
     }
@@ -377,29 +377,34 @@ class ListsModule extends PLModule
             $page->kill("La liste n'existe pas ou tu n'as pas le droit d'en voir les détails.");
         }
 
-        global $platal;
         list(,$members) = $this->client->get_members($liste);
-        $users = array();
-        foreach ($members as $m) {
-            $users[] = $m[1];
+
+        if ($action == 'moderators') {
+            $users = $owners;
+            $show_moderators = true;
+            $action = $subaction;
+            $subaction = '';
+        } else {
+            $show_moderators = false;
+            $users = array();
+            foreach ($members as $m) {
+                $users[] = $m[1];
+            }
         }
+
         require_once 'userset.inc.php';
-        $view = new ArraySet($users);
-        $view->addMod('trombi', 'Trombinoscope', true, array('with_promo' => true));
+        $view = new UserArraySet($users);
+        $view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true));
+        $view->addMod('listmember', 'Annuaire', true);
         if (empty($GLOBALS['IS_XNET_SITE'])) {
             $view->addMod('minifiche', 'Mini-fiches', false);
         }
-        // TODO: Reactivate when the new map is completed.
-        // $view->addMod('geoloc', 'Planisphère');
+        $view->addMod('map', 'Planisphère');
         $view->apply("lists/annu/$liste", $page, $action, $subaction);
-        if ($action == 'geoloc' && $subaction) {
-            return;
-        }
 
         $page->changeTpl('lists/annu.tpl');
-        $moderos = list_sort_owners($owners[1]);
         $page->assign_by_ref('details', $owners[0]);
-        $page->assign_by_ref('owners',  $moderos);
+        $page->assign('show_moderators', $show_moderators);
     }
 
     function handler_archives($page, $liste = null, $action = null, $artid = null)