On Xnet %grp/site redirects to the group's website
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 2 Mar 2007 13:08:30 +0000 (13:08 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 2 Mar 2007 13:08:30 +0000 (13:08 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1536 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/xnetgrp.php

index f340068..5c7939e 100644 (file)
@@ -76,6 +76,7 @@ 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),
@@ -205,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;