From 168a0eda11f8007a9fa1dc8e4a4cdfed4af2e3d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 26 Apr 2011 00:12:20 +0200 Subject: [PATCH] Logs last use of Auth-Groupe-X keys (Closes #1476). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- ChangeLog | 1 + modules/auth.php | 5 +++++ upgrade/1.1.1/09_auth_groupex.sql | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 upgrade/1.1.1/09_auth_groupex.sql 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: -- 2.1.4