Merge branch 'platal-0.9.16'
[platal.git] / modules / auth / auth.inc.php
index 9fd9c69..a1a562f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -60,9 +60,12 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
                                     WHERE  uid = {?} AND diminutif = {?}",
                                   S::v('uid'), $_GET['group']);
                 $perms = $res->fetchOneCell();
+                if (S::has_perms()) {
+                    $perms = 'admin';
+                }
             } else {
                 // if no group asked, return main rights
-                $perms = Session::has_perms()?'admin':'membre';
+                $perms = S::has_perms() ? 'admin' : 'membre';
             }
             $params .= gpex_prepare_param($val, $perms, $tohash, $charset);
         }