Removes useless variable.
[platal.git] / modules / xnetgrp.php
index dbb2d07..fa804b5 100644 (file)
@@ -825,6 +825,13 @@ class XnetGrpModule extends PLModule
         if (empty($user)) {
             return PL_NOT_FOUND;
         }
+
+        global $globals;
+
+        if (!$user->inGroup($globals->asso('id'))) {
+            pl_redirect('annuaire');
+        }
+
         $page->assign('self', false);
         $page->assign('user', $user);
 
@@ -854,7 +861,6 @@ class XnetGrpModule extends PLModule
                 // It the user has already logged in the site, we notify site
                 // administrators that there is a new xnet account without any
                 // group.
-                global $globals;
                 $mailer = new PlMailer('xnetgrp/unsubscription.mail.tpl');
                 $mailer->assign('user', $user);
                 $mailer->assign('groupId', $globals->asso('id'));
@@ -864,7 +870,7 @@ class XnetGrpModule extends PLModule
         }
     }
 
-    private function changeLogin(PlPage &$page, PlUser &$user, MMList &$mmlist, $login)
+    private function changeLogin(PlPage &$page, PlUser &$user, $login)
     {
         // Search the user's uid.
         $xuser = User::getSilent($login);
@@ -912,7 +918,7 @@ class XnetGrpModule extends PLModule
 
             // Convert user status to X
             if (!Post::blank('login_X')) {
-                $forlife = $this->changeLogin($page, $user, $mmlist, Post::t('login_X'));
+                $forlife = $this->changeLogin($page, $user, Post::t('login_X'));
                 if ($forlife) {
                     pl_redirect('member/' . $forlife);
                 }