* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// prevent connection to be linked to disconnection
if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false)
$returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i);
else
$returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
// prevent connection to be linked to disconnection
if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false)
$returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i);
else
$returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
$url .= "?session=" . session_id();
$url .= "&challenge=" . S::v('challenge');
$url .= "&pass=" . md5(S::v('challenge') . $globals->xnet->secret);
$url .= "?session=" . session_id();
$url .= "&challenge=" . S::v('challenge');
$url .= "&pass=" . md5(S::v('challenge') . $globals->xnet->secret);
protected function doAuth($level)
{
if (S::identified()) { // ok, c'est bon, on n'a rien à faire
protected function doAuth($level)
{
if (S::identified()) { // ok, c'est bon, on n'a rien à faire
if ($level == AUTH_SUID) {
S::set('auth', AUTH_MDP);
}
if ($level == AUTH_SUID) {
S::set('auth', AUTH_MDP);
}
- $res = XDB::query("SELECT a.uid, a.display_name, a.full_name,
+ $res = XDB::query("SELECT a.uid, a.hruid, a.display_name, a.full_name,
$may_update[$asso_id] = true;
} elseif (!isset($may_update[$asso_id]) || $force) {
$res = XDB::query("SELECT perms
$may_update[$asso_id] = true;
} elseif (!isset($may_update[$asso_id]) || $force) {
$res = XDB::query("SELECT perms
WHERE uid={?} AND asso_id={?}",
S::v('uid'), $asso_id);
$may_update[$asso_id] = ($res->fetchOneCell() == 'admin');
WHERE uid={?} AND asso_id={?}",
S::v('uid'), $asso_id);
$may_update[$asso_id] = ($res->fetchOneCell() == 'admin');
$is_member[$asso_id] = true;
} elseif (!isset($is_member[$asso_id]) || $force) {
$res = XDB::query("SELECT COUNT(*)
$is_member[$asso_id] = true;
} elseif (!isset($is_member[$asso_id]) || $force) {
$res = XDB::query("SELECT COUNT(*)
WHERE uid={?} AND asso_id={?}",
S::v('uid'), $asso_id);
$is_member[$asso_id] = ($res->fetchOneCell() == 1);
WHERE uid={?} AND asso_id={?}",
S::v('uid'), $asso_id);
$is_member[$asso_id] = ($res->fetchOneCell() == 1);