From 89ad696dc37cfa430821fd0b9f7605f2e8912163 Mon Sep 17 00:00:00 2001 From: wjames5 Date: Fri, 2 Oct 2009 18:17:47 +0000 Subject: new option to use httpauth on feeds to support private content - opt in and universally handled in rss_inc --- admin/admin_rss_inc.php | 14 +++++++++++++- index.php | 6 +++--- rss_inc.php | 9 ++++++++- templates/admin_rss.tpl | 10 ++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/admin/admin_rss_inc.php b/admin/admin_rss_inc.php index 0d9926a..6f2d708 100644 --- a/admin/admin_rss_inc.php +++ b/admin/admin_rss_inc.php @@ -1,6 +1,6 @@ assign( "formRSSSettings", $formRSSSettings ); +$formRSSOptions = array( + 'rssfeed_httpauth' => array( + 'label' => 'Enable HTTP Authentication', + 'note' => 'Use HTTP Authentication with SSL to enable Registered Users to gain access to Private Content Feeds.', + ), +); +$gBitSmarty->assign( "formRSSOptions", $formRSSOptions ); + $cacheTimes = array( 0 => tra( "(no cache)" ), 60 => "1 ".tra( "minute" ), @@ -87,5 +95,9 @@ if( !empty( $_REQUEST['feed_settings'] ) ) { } simple_set_value( 'rssfeed_default_version' ); simple_set_int( 'rssfeed_cache_time' ); + + foreach( $formRSSOptions as $item => $data ) { + simple_set_toggle( $item, RSS_PKG_NAME ); + } } ?> diff --git a/index.php b/index.php index 13d9f8b..6bb85a8 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ assign( "feedFormat", $feedFormat ); if( !empty( $_REQUEST['get_feed'] ) ) { - $feedlink['url'] = constant( strtoupper( $_REQUEST['pkg'] ).'_PKG_URL' ).$_REQUEST['pkg'].'_rss.php?version='.$_REQUEST['format']; + $feedlink['url'] = constant( strtoupper( $_REQUEST['pkg'] ).'_PKG_URL' ).$_REQUEST['pkg'].'_rss.php?version='.$_REQUEST['format'].( $gBitSystem->getConfig( 'rssfeed_httpauth' ) && $gBitUser->isRegistered()?'&httpauth=y':''); $feedlink['title'] = $_REQUEST['pkg'].' - '.$feedFormat[$_REQUEST['format']]; $feedlink['pkg'] = $_REQUEST['pkg']; $feedlink['format'] = $_REQUEST['format']; diff --git a/rss_inc.php b/rss_inc.php index dd4466d..e4e0f42 100644 --- a/rss_inc.php +++ b/rss_inc.php @@ -1,6 +1,6 @@ getConfig( 'rssfeed_httpauth' ) && + !empty($_REQUEST['httpauth']) && + !$gBitUser->isRegistered() ){ + users_httpauth(); +} + // initiate feed creator class $rss = new UniversalFeedCreator(); diff --git a/templates/admin_rss.tpl b/templates/admin_rss.tpl index 272fdea..56ae409 100644 --- a/templates/admin_rss.tpl +++ b/templates/admin_rss.tpl @@ -77,6 +77,16 @@ {/forminput} {/foreach} + + {foreach from=$formRSSOptions key=item item=output} +
+ {formlabel label=`$output.label` for=$item} + {forminput} + {html_checkboxes name="$item" values="y" checked=$gBitSystem->getConfig($item) labels=false id=$item} + {formhelp note=`$output.note` page=`$output.page`} + {/forminput} +
+ {/foreach} {/legend} {/jstab} {/jstabs} -- cgit v1.3