X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=inline;f=classes%2Fplatalglobals.php.in;h=f49b279a022d041d965dbc33b1e51b1371a9d520;hb=5660032ac785d410f90e3f5b0d6948dc90b0cfea;hp=e4b1b949d680d21dbd07383103f0a7bf10ee0e34;hpb=bd5ac0a242a1364b8c1419f037c7bb8778e22ba1;p=platal.git diff --git a/classes/platalglobals.php.in b/classes/platalglobals.php.in index e4b1b94..f49b279 100644 --- a/classes/platalglobals.php.in +++ b/classes/platalglobals.php.in @@ -1,6 +1,6 @@ bootstrap(array('NbValid'), array($this, 'updateNbValid')); } - public function asso($key=null) + public function asso($key = null) { static $aid = null; - if (is_null($aid)) { + if (isset($GLOBALS['IS_XNET_SITE']) && is_null($aid)) { $gp = Get::v('n'); if ($p = strpos($gp, '/')) { $gp = substr($gp, 0, $p); } - if ($gp) { - $res = XDB::query('SELECT a.*, d.nom AS domnom, - FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc, - FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub - FROM groupex.asso AS a - LEFT JOIN groupex.dom AS d ON d.id = a.dom - WHERE diminutif = {?}', $gp); - if (!($aid = $res->fetchOneAssoc())) { - $aid = array(); - } - } else { - $aid = array(); - } + $aid = Group::get($gp); } if (empty($key)) { return $aid; - } elseif ( isset($aid[$key]) ) { - return $aid[$key]; + } elseif (isset($aid->$key) ) { + return $aid->$key; } else { return null; } } - public function updateNbIns() { $res = XDB::query("SELECT COUNT(*)