$this->setAccessCookie(false, S::i('auth_by_cookie') != $user->id());
} else {
$this->killAccessCookie();
+
+ // If login for an external website and not activating cookie,
+ // mark that we want to disconnect once external auth checks
+ // have been performed.
+ if (Post::b('external_auth')) {
+ S::set('external_auth_exit', true);
+ }
}
}
function handler_groupex($page, $charset = 'utf8')
{
if (!S::logged()) {
- $page->assign('referer', true);
+ $page->assign('external_auth', true);
$page->setTitle('Authentification');
$page->setDefaultSkin('group_login');
$page->kill("Le site demandé est réservé aux polytechniciens.");
}
+ // If we logged in specifically for this 'external_auth' request
+ // and didn't want to "keep access to services", we kill the session
+ // just before returning.
+ // See classes/xorgsession.php:startSessionAs
+ if (S::b('external_auth_exit')) {
+ S::logger()->log('decconnexion', @$_SERVER['HTTP_REFERER']);
+ Platal::session()->killAccessCookie();
+ Platal::session()->destroy();
+ }
http_redirect($returl);
} else if (S::admin()) {
$page->kill("La requête d'authentification a échoué (url de retour invalide).");
{* *}
{**************************************************************************}
-{if t($referer) || $platal->pl_self() neq 'login'}
+{if t($external_auth) || $platal->pl_self() neq 'login'}
<h1>
Accès restreint
</h1>
{else}
la page que vous avez demandée
{/if}
- (<strong>{if t($referer)}{$smarty.server.HTTP_REFERER|truncate:120:"...":false}{else}{$globals->baseurl}/{$platal->pl_self()}{/if}</strong>)
+ (<strong>{if t($external_auth)}{$smarty.server.HTTP_REFERER|truncate:120:"...":false}{else}{$globals->baseurl}/{$platal->pl_self()}{/if}</strong>)
nécessite une authentification.
</p>
{else}
<input type="hidden" name="xorpass" value="" />
<input type="hidden" name="username" value="" />
<input type="hidden" name="remember" value="" />
+ {if t($external_auth)}
+ <input type="hidden" name="external_auth" value="1" />
+ {/if}
</div>
</form>