From b8f1396f30a1bb300ec0ede5d5b2bd0efbbf41c7 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 9 Nov 2008 14:53:23 +0100 Subject: [PATCH] Users can delete entries from their openid whitelid --- core | 2 +- modules/openid.php | 15 +++++++++++++++ upgrade/0.9.18/04_openid.sql | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core b/core index 8b6e9f4..7b64cc7 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 8b6e9f4e18cb8fbce6bb44f88474493476daf87e +Subproject commit 7b64cc7438eba834c765eef056628e2f1e6ea823 diff --git a/modules/openid.php b/modules/openid.php index 08eeb86..d3a4589 100644 --- a/modules/openid.php +++ b/modules/openid.php @@ -63,6 +63,7 @@ class OpenidModule extends PLModule return array( 'openid' => $this->make_hook('openid', AUTH_PUBLIC), 'openid/trust' => $this->make_hook('trust', AUTH_COOKIE), + 'openid/trusted' => $this->make_hook('trusted', AUTH_MDP), 'openid/idp_xrds' => $this->make_hook('idp_xrds', AUTH_PUBLIC), 'openid/user_xrds' => $this->make_hook('user_xrds', AUTH_PUBLIC), 'openid/melix' => $this->make_hook('melix', AUTH_PUBLIC), @@ -193,6 +194,20 @@ class OpenidModule extends PLModule $this->render_openid_response($webresponse); } + function handler_trusted(&$page, $action = 'list', $id = null) + { + $this->load('openid.inc.php'); + $page->setTitle('Sites tiers de confiance'); + $page->assign('title', 'Mes sites tiers de confiance pour OpenId'); + $table_editor = new PLTableEditor('openid/trusted', 'openid_trusted', 'id'); + $table_editor->set_where_clause('user_id = ' . XDB::escape(S::user()->id())); + // Display only URLs + $table_editor->vars['user_id']['display'] = false; + $table_editor->describe('url', 'site tiers', true); + $page->assign('deleteonly', true); + $table_editor->apply($page, $action, $id); + } + function handler_idp_xrds(&$page) { $this->load('openid.inc.php'); diff --git a/upgrade/0.9.18/04_openid.sql b/upgrade/0.9.18/04_openid.sql index f82c8c3..28f5923 100644 --- a/upgrade/0.9.18/04_openid.sql +++ b/upgrade/0.9.18/04_openid.sql @@ -1,9 +1,10 @@ # Creates a new table to store websites trusted by each user CREATE TABLE IF NOT EXISTS `openid_trusted` ( + id INTEGER UNSIGNED NOT NULL auto_increment, # user_id == NULL means a globally trusted website user_id INTEGER, url VARCHAR(256) NOT NULL, - INDEX user_id_index(user_id), + PRIMARY KEY id_pk(id), UNIQUE INDEX user_id_url_index(user_id, url) ) CHARSET=utf8; -- 2.1.4