From: Raphaël Barrois Date: Sun, 8 Apr 2012 17:53:37 +0000 (+0200) Subject: Rename $gpex_url to $ext_url in auth-groupe-x handler. X-Git-Tag: xorg/1.1.5~28 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=784e89ec6ed8b97fa0d87066770de61e19e704dd;p=platal.git Rename $gpex_url to $ext_url in auth-groupe-x handler. Signed-off-by: Raphaël Barrois --- diff --git a/modules/auth.php b/modules/auth.php index 0d9e12b..e222eeb 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -118,11 +118,11 @@ class AuthModule extends PLModule */ function handler_groupex($page, $charset = 'utf8') { - $gpex_url = urldecode(Get::s('url')); + $ext_url = urldecode(Get::s('url')); if (!S::logged()) { $page->assign('external_auth', true); - $page->assign('gpex_url', $gpex_url); + $page->assign('ext_url', $ext_url); $page->setTitle('Authentification'); $page->setDefaultSkin('group_login'); @@ -145,16 +145,16 @@ class AuthModule extends PLModule $gpex_pass = Get::s('pass'); if (Get::has('session')) { - if (strpos($gpex_url, '?') === false) { - $gpex_url .= "?PHPSESSID=" . Get::s('session'); + if (strpos($ext_url, '?') === false) { + $ext_url .= "?PHPSESSID=" . Get::s('session'); } else { - $gpex_url .= "&PHPSESSID=" . Get::s('session'); + $ext_url .= "&PHPSESSID=" . Get::s('session'); } } // Normalize the return URL. - if (!preg_match("/^(http|https):\/\/.*/",$gpex_url)) { - $gpex_url = "http://$gpex_url"; + if (!preg_match("/^(http|https):\/\/.*/",$ext_url)) { + $ext_url = "http://$ext_url"; } $gpex_challenge = Get::s('challenge'); @@ -187,8 +187,8 @@ class AuthModule extends PLModule // We check that the return url matches a per-key regexp to prevent // replay attacks (more exactly to force replay attacks to redirect // the user to the real GroupeX website, which defeats the attack). - if (empty($returnurls) || @preg_match($returnurls, $gpex_url)) { - $returl = $gpex_url . gpex_make_params($gpex_challenge, $privkey, $datafields, $charset); + if (empty($returnurls) || @preg_match($returnurls, $ext_url)) { + $returl = $ext_url . gpex_make_params($gpex_challenge, $privkey, $datafields, $charset); XDB::execute('UPDATE group_auth SET last_used = DATE(NOW()) WHERE name = {?}', diff --git a/templates/core/password_prompt.tpl b/templates/core/password_prompt.tpl index 56e84e8..ca73e88 100644 --- a/templates/core/password_prompt.tpl +++ b/templates/core/password_prompt.tpl @@ -31,7 +31,7 @@ {else} la page que vous avez demandée {/if} - ({if t($external_auth)}{$gpex_url|truncate:120:"...":false}{else}{$globals->baseurl}/{$platal->pl_self()}{/if}) + ({if t($external_auth)}{$ext_url|truncate:120:"...":false}{else}{$globals->baseurl}/{$platal->pl_self()}{/if}) nécessite une authentification.

{else}