Fix session bootstrap
[platal.git] / modules / xnetgrp.php
index 2383b30..e0da41d 100644 (file)
@@ -76,8 +76,10 @@ class XnetGrpModule extends PLModule
             '%grp'                => $this->make_hook('index',     AUTH_PUBLIC),
             '%grp/asso.php'       => $this->make_hook('index',     AUTH_PUBLIC),
             '%grp/logo'           => $this->make_hook('logo',      AUTH_PUBLIC),
+            '%grp/site'           => $this->make_hook('site',      AUTH_PUBLIC),
             '%grp/edit'           => $this->make_hook('edit',      AUTH_MDP),
             '%grp/mail'           => $this->make_hook('mail',      AUTH_MDP),
+            '%grp/forum'          => $this->make_hook('forum',     AUTH_MDP),
             '%grp/annuaire'       => $this->make_hook('annuaire',  AUTH_MDP),
             '%grp/annuaire/vcard' => $this->make_hook('vcard',     AUTH_MDP),
             '%grp/trombi'         => $this->make_hook('trombi',    AUTH_MDP),
@@ -94,7 +96,7 @@ class XnetGrpModule extends PLModule
             '%grp/member/new'
                  => $this->make_hook('admin_member_new', AUTH_MDP),
             '%grp/member/new/ajax'
-                 => $this->make_hook('admin_member_new_ajax', AUTH_MDP, '', NO_AUTH),         
+                 => $this->make_hook('admin_member_new_ajax', AUTH_MDP, 'user', NO_AUTH),         
             '%grp/member/del'
                  => $this->make_hook('admin_member_del', AUTH_MDP),
 
@@ -204,6 +206,18 @@ class XnetGrpModule extends PLModule
         exit;
     }
 
+    function handler_site(&$page)
+    {
+        global $globals;
+        $site = $globals->asso('site');
+        if (!$site) {
+            $page->trig('Le groupe n\'a pas de site web');
+            return $this->handler_index($page);
+        }
+        header("Location: $site");
+        exit;
+    }
+
     function handler_edit(&$page)
     {
         global $globals;
@@ -294,6 +308,19 @@ class XnetGrpModule extends PLModule
         }
     }
 
+    function handler_forum(&$page, $group = null, $artid = null)
+    {
+        global $globals;
+        new_group_page('xnetgrp/forum.tpl');
+        if (!$globals->asso('forum')) {
+            return PL_NOT_FOUND;
+        }
+        require_once 'banana/forum.inc.php';
+        $get = array();
+        get_banana_params($get, $globals->asso('forum'), $group, $artid);
+        run_banana($page, 'ForumsBanana', $get);
+    }
+
     function handler_annuaire(&$page)
     {
         global $globals;