From: Stéphane Jacob Date: Mon, 25 Apr 2011 22:12:20 +0000 (+0200) Subject: Logs last use of Auth-Groupe-X keys (Closes #1476). X-Git-Tag: xorg/1.1.1~59 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=168a0eda11f8007a9fa1dc8e4a4cdfed4af2e3d3;p=platal.git Logs last use of Auth-Groupe-X keys (Closes #1476). Signed-off-by: Stéphane Jacob --- diff --git a/ChangeLog b/ChangeLog index 11a354e..045ad1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ Bug/Wish: * Auth: - #1474: Provides accounts data for accounts without profile -JAC + - #1476: Logs last use of Auth-Groupe-X keys -JAC * Emails: - #1110: Improves email combobox -JAC diff --git a/modules/auth.php b/modules/auth.php index 1883ab6..88a1e9d 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -145,6 +145,10 @@ class AuthModule extends PLModule // 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); + XDB::execute('UPDATE group_auth + SET last_used = DATE(NOW()) + WHERE name = {?}', + $name); http_redirect($returl); } else if (S::admin()) { $page->kill("La requête d'authentification a échouée (url de retour invalide)."); @@ -166,6 +170,7 @@ class AuthModule extends PLModule $table_editor->describe('privkey','clé privée',false); $table_editor->describe('datafields','champs renvoyés',true); $table_editor->describe('returnurls','urls de retour',true); + $table_editor->describe('last_used', 'dernière utilisation', true); $table_editor->apply($page, $action, $id); } } diff --git a/upgrade/1.1.1/09_auth_groupex.sql b/upgrade/1.1.1/09_auth_groupex.sql new file mode 100644 index 0000000..93ff9c4 --- /dev/null +++ b/upgrade/1.1.1/09_auth_groupex.sql @@ -0,0 +1,3 @@ +ALTER TABLE group_auth ADD COLUMN last_used DATE DEFAULT NULL; + +-- vim:set syntax=mysql: