From 65e7975414f6b6887fed9834bb6e1a3fa6d12863 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 28 Sep 2008 19:08:18 +0000 Subject: Update: Modifed phpBB3 ACP Also modified subscription file to look pretty and to show verification when the subscription is encrypted. Fixes #68 --- update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html | 11 +++++++++-- .../plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php | 5 ++--- update/plugin/phpBB3/trunk/root/instadisc.php | 9 ++++++++- .../plugin/phpBB3/trunk/root/language/en/mods/instadisc.php | 4 ++-- .../trunk/root/styles/prosilver/template/instadisc.html | 10 +++++++++- 5 files changed, 30 insertions(+), 9 deletions(-) (limited to 'update') diff --git a/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html b/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html index 3443649..283fae7 100644 --- a/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html +++ b/update/plugin/phpBB3/trunk/root/adm/style/acp_instadisc.html @@ -4,7 +4,7 @@

{L_INSTADISC}

-

{L_INSTADISC_EXPLAIN}{L_INSTADISC_LINK_TEXT}

+

{L_INSTADISC_EXPLAIN}{L_INSTADISC_LINK_TEXT}

@@ -13,12 +13,19 @@
+
+
+ +
{L_SUBSCRIPTION_FILE_DESC} +
+
{S_SUBSCRIPTION_FILE}
+

{L_ENCRYPTION_DESC}
-
+

diff --git a/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php b/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php index f93ece6..9527908 100644 --- a/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php +++ b/update/plugin/phpBB3/trunk/root/includes/acp/acp_instadisc.php @@ -31,18 +31,17 @@ class acp_instadisc { // Add config to the database set_config('id_subscription_title', $_POST['subscription_title']); - set_config('id_subscription_url', $_POST['subscription_url']); set_config('id_encryption_key', $_POST['encryption_key']); trigger_error($user->lang['ID_CHANGES_SAVED'] . adm_back_link($this->u_action), E_USER_NOTICE); } else { $idst = isset($config['id_subscription_title']) ? $config['id_subscription_title'] : $config['sitename']; - $idsu = isset($config['id_subscription_url']) ? $config['id_subscription_url'] : ''; + $idsf = generate_board_url() . '/instadisc.php'; $idec = isset($config['id_encryption_key']) ? $config['id_encryption_key'] : ''; $template->assign_vars(array( 'S_SUBSCRIPTION_TITLE' => $idst, - 'S_SUBSCRIPTION_URL' => $idsu, + 'S_SUBSCRIPTION_FILE' => $idsf, 'S_ENCRYPTION_KEY' => $idec, 'S_SUBMIT' => $this->u_action )); diff --git a/update/plugin/phpBB3/trunk/root/instadisc.php b/update/plugin/phpBB3/trunk/root/instadisc.php index 185fc78..6fecd06 100644 --- a/update/plugin/phpBB3/trunk/root/instadisc.php +++ b/update/plugin/phpBB3/trunk/root/instadisc.php @@ -30,9 +30,16 @@ $template->set_filenames(array( $template->assign_vars(array( 'S_SUBSCRIPTION' => ('http://' . $_SERVER['SERVER_NAME'] . '/forum-post/' . generateSlug($config['id_subscription_title']) . '/'), 'S_TITLE' => $config['id_subscription_title'], - 'S_KEY' => $config['id_activation_key'], )); +if ($config['id_encryption_key'] != '') +{ + $verID = rand(1,2147483647); + + $template->assign_block_vars('encrypted', array( 'S_VERIFICATION' => md5($config['id_subscription_title'] . ':' . md5($config['id_encryption_key']) . ':' . $verID), + 'S_VERID' => $verID)); +} + page_footer(); function generateSlug($title) diff --git a/update/plugin/phpBB3/trunk/root/language/en/mods/instadisc.php b/update/plugin/phpBB3/trunk/root/language/en/mods/instadisc.php index 445290e..20819bb 100644 --- a/update/plugin/phpBB3/trunk/root/language/en/mods/instadisc.php +++ b/update/plugin/phpBB3/trunk/root/language/en/mods/instadisc.php @@ -40,10 +40,10 @@ $lang = array_merge($lang, array( 'SUBSCRIPTION' => 'Subscription', 'SUBSCRIPTION_TITLE' => 'Subscription Title', - 'SUBSCRIPTION_URL' => 'Subscription URL', + 'SUBSCRIPTION_FILE' => 'Subscription File URL', 'ENCRYPTION' => 'Encryption Key', - 'SUBSCRIPTION_URL_DESC' => 'This is a unique URI used to identify your subscription.', + 'SUBSCRIPTION_FILE_DESC' => 'This is the URL of your subscription file', 'ENCRYPTION_DESC' => 'If you have the PHP module "mcrypt" installed, you can password protect this subscription so that users who wish to subscribe to it must provide the correct password. Leave this field blank if you do not wish to encrypt this subscription.', 'ID_CHANGES_SAVED' => 'The changes you made to your InstaDisc settings have been saved!', diff --git a/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html b/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html index 1f0fc23..6627969 100644 --- a/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html +++ b/update/plugin/phpBB3/trunk/root/styles/prosilver/template/instadisc.html @@ -1,4 +1,12 @@ +

: {L_LN} Subscription: {S_SUBSCRIPTION}{L_LN} Title: {S_TITLE}{L_LN} Category: forum-post{L_LN} -Key: {S_KEY} + +Verification: {encrypted.S_VERIFICATION}{L_LN} +Verification-ID: {encrypted.S_VERID}{L_LN} + +End:
This is an InstaDisc Subscription file.

If you would like to subscribe to the InstaDisc subscription:
{S_TITLE} (forum-post)
Copy the address of this file to the "Add Subscription" form on your InstaDisc client.

+ +
Please note that this is an encrypted subscription.
To subscribe to it, you must know its password.
+ -- cgit 1.4.1