summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2006-10-07 20:01:03 +0000
committerChristian Fowler <spider@viovio.com>2006-10-07 20:01:03 +0000
commit40d492f8d4ac308351952c6dab7d3a078ab4c577 (patch)
treed11b1d7143ce289da8edf716a5827b8a9d20b321 /index.php
parenta7b1bb11ef7d2be0fd6771bb6520cc821c671bd5 (diff)
downloadnewsletters-40d492f8d4ac308351952c6dab7d3a078ab4c577.tar.gz
newsletters-40d492f8d4ac308351952c6dab7d3a078ab4c577.tar.bz2
newsletters-40d492f8d4ac308351952c6dab7d3a078ab4c577.zip
more unsub cleanup, still more to go
Diffstat (limited to 'index.php')
-rw-r--r--index.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/index.php b/index.php
index 1d4d97b..b74ae7b 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_newsletters/index.php,v 1.21 2006/07/31 02:17:00 spiderr Exp $
+// $Header: /cvsroot/bitweaver/_bit_newsletters/index.php,v 1.22 2006/10/07 20:01:02 spiderr Exp $
// Copyright (c) 2006 - bitweaver.org - Christian Fowler, Max Kremmel, et. al
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -26,9 +26,10 @@ if( !empty( $_REQUEST['nl_id'] ) ) {
if (isset($_REQUEST['info'])) {
$subscribe = true;
$gBitSmarty->assign('subscribe', 'y');
- $infoHash = array( 'user_id' => $gBitUser->mUserId, 'email' => $gBitUser->getField('email') );
- $info = $gContent->getSubscriberInfo( $infoHash );
- vd( $info );
+ if( $gBitUser->isRegistered() ) {
+ $infoHash = array( 'user_id' => $gBitUser->mUserId );
+ }
+ $gBitSmarty->assign( 'subInfo', $gContent->getSubscriberInfo( $infoHash ) );
}
}
$newsletters = $gContent->getList( $listHash );
@@ -41,7 +42,7 @@ $gBitSmarty->assign('url_subscribe', httpPrefix(). $foo["path"]);
if (isset($_REQUEST["sub"])) {
$gContent->confirmSubscription($_REQUEST["sub"], TRUE );
$gBitSmarty->assign('confirm', 'y');
-} elseif( isset( $_REQUEST["unsubscribe"] ) ) {
+} elseif( isset( $_REQUEST["unsub"] ) ) {
if (!empty( $_REQUEST["email"] )) {
$gContent->removeSubscription($_REQUEST["email"], TRUE );
} elseif (!empty( $_REQUEST["unsubscribe"] )) {
@@ -50,7 +51,7 @@ if (isset($_REQUEST["sub"])) {
$feedback['success'] = tra( "Your email address was removed from the list of subscriptors." );
}
-if( isset( $_REQUEST["sub"] ) || $gBitUser->isRegistered() ) {
+if( isset( $_REQUEST["sub"] ) ) {
if( isset( $_REQUEST["sub"] ) && strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitMailer::lookupSubscription( array( 'url_code' => $_REQUEST["sub"] ) )) ) {
$lookup['email'] = $subInfo['email'];
$unsubs = BitMailer::getUnsubscriptions( $lookup );
@@ -94,7 +95,7 @@ if( isset( $_REQUEST["sub"] ) || $gBitUser->isRegistered() ) {
$gBitSmarty->assign( 'subInfo', $subInfo );
$gBitSmarty->assign( 'unsubs', $unsubs );
$mid = 'bitpackage:newsletters/user_subscriptions.tpl';
-}
+} else {
$foo = parse_url($_SERVER["REQUEST_URI"]);
$gBitSmarty->assign('url_subscribe', httpPrefix(). $foo["path"]);
@@ -147,6 +148,7 @@ $subscribe = false;
$mid = 'bitpackage:newsletters/newsletters.tpl';
$title = "List Newsletters";
}
+}
$gBitSmarty->assign( 'feedback', $feedback );