X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fauth%2Fauth.inc.php;h=383745a815ce734d8247d1e60027e7c3372727f2;hb=4452750bdfcca53d7e1e8dfb8edb16c03fae4c8b;hp=c158ff2a7ce467848cdf8cef0828d3f5ed64700b;hpb=be638e733bce413df4324d985297d9a4d94dcbca;p=platal.git diff --git a/modules/auth/auth.inc.php b/modules/auth/auth.inc.php index c158ff2..383745a 100644 --- a/modules/auth/auth.inc.php +++ b/modules/auth/auth.inc.php @@ -1,6 +1,6 @@ hasProfile()) { - // XXX: Transition table for auth. + /* Transition table for authentification. */ $personnal_data = $user->profile()->data(); $personnal_data['matricule'] = $personnal_data['xorg_id']; $personnal_data['matricule_ax'] = $personnal_data['ax_id']; @@ -50,7 +50,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset) foreach ($fieldarr as $val) { // Determine the requested value, and add it to the answer. if ($val == 'perms') { - $params .= gpex_prepare_param($val, S::has_perms() ? 'admin' : 'user', $tohash, $charset); + $params .= gpex_prepare_param($val, S::admin() ? 'admin' : 'user', $tohash, $charset); } else if ($val == 'forlife') { $params .= gpex_prepare_param($val, S::v('hruid'), $tohash, $charset); } else if (S::has($val)) { @@ -60,21 +60,21 @@ function gpex_make($chlg, $privkey, $datafields, $charset) } else if ($val == 'username') { $res = XDB::query("SELECT alias FROM aliases - WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", + WHERE uid = {?} AND FIND_IN_SET('bestalias', flags)", S::i('uid')); $min_username = $res->fetchOneCell(); $params .= gpex_prepare_param($val, $min_username, $tohash, $charset); } else if ($val == 'grpauth') { if (isset($_GET['group'])) { $res = XDB::query("SELECT perms - FROM groupex.membres - INNER JOIN groupex.asso ON(id = asso_id) + FROM group_members + INNER JOIN groups 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 = S::has_perms() ? 'admin' : 'membre'; + $perms = S::admin() ? 'admin' : 'membre'; } $params .= gpex_prepare_param($val, $perms, $tohash, $charset); } else {