From b49f3f403fa8bb518c709c4091946c5d7f2aad6b Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Mon, 5 Mar 2007 17:53:51 +0000 Subject: [PATCH] droits admin quand aucun groupe demande lors de l'authentification distante git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1550 839d8a87-29fc-0310-9880-83ba4fa771e5 --- modules/auth/auth.inc.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/auth/auth.inc.php b/modules/auth/auth.inc.php index 208c691..804c527 100644 --- a/modules/auth/auth.inc.php +++ b/modules/auth/auth.inc.php @@ -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; } -- 2.1.4