droits admin quand aucun groupe demande lors de l'authentification distante
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 5 Mar 2007 17:53:51 +0000 (17:53 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 5 Mar 2007 17:53:51 +0000 (17:53 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1550 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/auth/auth.inc.php

index 208c691..804c527 100644 (file)
@@ -48,11 +48,16 @@ function gpex_make($chlg, $privkey, $datafields)
             $min_username = $res->fetchOneCell();
             $tohash      .= $min_username;
             $params      .= "&$val=".$min_username;
-        } else if ($val == 'grpauth' && isset($_GET['group'])) {
-               $res = XDB::query("SELECT perms FROM groupex.membres
-                               INNER JOIN groupex.asso ON(id = asso_id) 
-                               WHERE uid = {?} AND diminutif = {?}", S::v('uid'), $_GET['group']);
-                       $perms = $res->fetchOneCell();
+        } else if ($val == 'grpauth') {
+               if (isset($_GET['group'])) {
+                       $res = XDB::query("SELECT perms FROM groupex.membres
+                                       INNER JOIN groupex.asso ON(id = asso_id) 
+                                       WHERE uid = {?} AND diminutif = {?}", S::v('uid'), $_GET['group']);
+                               $perms = $res->fetchOneCell();
+                       } else {
+                               // if no group asked, return main rights
+                               $perms = Session::has_perms()?'admin':'membre';
+                       }
                        $tohash .= $perms;
                        $params .= "&$val=".$perms;
         }