diff options
| author | wjames5 <will@tekimaki.com> | 2009-10-02 18:17:47 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2009-10-02 18:17:47 +0000 |
| commit | 89ad696dc37cfa430821fd0b9f7605f2e8912163 (patch) | |
| tree | fff3b2e61f9383a23f2f3a1c86f1839e5940a317 | |
| parent | f5bc2d243cd4a3f551a6b733fdaf85bdfba0e7a2 (diff) | |
| download | rss-89ad696dc37cfa430821fd0b9f7605f2e8912163.tar.gz rss-89ad696dc37cfa430821fd0b9f7605f2e8912163.tar.bz2 rss-89ad696dc37cfa430821fd0b9f7605f2e8912163.zip | |
new option to use httpauth on feeds to support private content - opt in and universally handled in rss_inc
| -rw-r--r-- | admin/admin_rss_inc.php | 14 | ||||
| -rw-r--r-- | index.php | 6 | ||||
| -rw-r--r-- | rss_inc.php | 9 | ||||
| -rw-r--r-- | 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 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_rss/admin/admin_rss_inc.php,v 1.10 2009/10/01 14:17:03 wjames5 Exp $ +// $Header: /cvsroot/bitweaver/_bit_rss/admin/admin_rss_inc.php,v 1.11 2009/10/02 18:17:47 wjames5 Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See below for details and a complete list of authors. @@ -45,6 +45,14 @@ $formRSSSettings = array( ); $gBitSmarty->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 ); + } } ?> @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_rss/index.php,v 1.9 2009/10/01 14:17:03 wjames5 Exp $ + * $Header: /cvsroot/bitweaver/_bit_rss/index.php,v 1.10 2009/10/02 18:17:47 wjames5 Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details * - * $Id: index.php,v 1.9 2009/10/01 14:17:03 wjames5 Exp $ + * $Id: index.php,v 1.10 2009/10/02 18:17:47 wjames5 Exp $ * @package pigeonholes * @subpackage functions */ @@ -43,7 +43,7 @@ $feedFormat = array( $gBitSmarty->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 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_rss/rss_inc.php,v 1.14 2009/05/13 23:09:09 wjames5 Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_rss/rss_inc.php,v 1.15 2009/10/02 18:17:47 wjames5 Exp $ * @package rss * @subpackage functions */ @@ -15,6 +15,13 @@ if( !is_dir( TEMP_PKG_PATH.'rss' ) ) { mkdir_p( TEMP_PKG_PATH.'rss' ); } +// if http auth is required run it before we start anything else +if( $gBitSystem->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} </div> {/foreach} + + {foreach from=$formRSSOptions key=item item=output} + <div class="row"> + {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} + </div> + {/foreach} {/legend} {/jstab} {/jstabs} |
