Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

singlelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: singlelist.php 9724 2002-09-03 09:10:28Z fh $
5 //
6 // Created on: <23-Oct-2000 17:53:46 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "ezbulkmail/classes/ezbulkmailsubscriptionaddress.php" );
28 // include_once( "ezbulkmail/classes/ezbulkmailcategory.php" );
29 // include_once( "ezbulkmail/classes/ezbulkmailforgot.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33 $wwwDir = $ini->WWWDir;
34 $indexFile = $ini->Index;
35
36 $Language = $ini->variable( "eZBulkMailMain", "Language" );
37 $languageIni = new eZINI( "kernel/ezbulkmail/user/intl/" . $Language . "/subscriptionlogin.php.ini", false );
38 $category = eZBulkMailCategory::singleList();
39
40 if( isset( $Hash ) && is_object( $category ) )
41 {
42 $change = new eZBulkMailForgot();
43 if( $change->check( $Hash ) != false )
44 {
45 $change->get( $change->check( $Hash ) );
46 if( eZBulkMailSubscriptionAddress::addressExists( $change->mail() ) && isset( $UnSubscribe ) )
47 {
48 $subscriptionaddress = eZBulkMailSubscriptionAddress::getByEmail( $change->mail() );
49 if( $subscriptionaddress != false )
50 {
51 $subscriptionaddress->delete();
52 $change->delete();
53 $unsubscribed="";
54 include( "kernel/ezbulkmail/user/usermessages.php" );
55 }
56 }
57 else if( isset( $Subscribe ) )
58 {
59 $subscriptionaddress = eZBulkMailSubscriptionAddress::getByEmail( $change->mail() );
60 $subscriptionaddress->store();
61 $subscriptionaddress->unsubscribe( true );
62 $subscriptionaddress->subscribe( $category );
63
64 // Cleanup
65 $change->delete();
66
67 $subscribed="";
68 include( "kernel/ezbulkmail/user/usermessages.php" );
69
70 }
71 }
72 else
73 {
74 $hasherror = "";
75 include( "kernel/ezbulkmail/user/usermessages.php" );
76 }
77 }
78 else if( isset( $Hash ) && !is_object( $category ) )
79 {
80 echo "Your administrator has specified an email list that is not available.";
81 }
82
83 if( isset( $SubscribeButton ) )
84 {
85 $subscriptionaddress = new eZBulkMailSubscriptionAddress();
86 if( $subscriptionaddress->setEMail( $Email ) && !$subscriptionaddress->addressExists( $Email ) )
87 {
88 $headersInfo = getallheaders();
89 $subjectText = ( $languageIni->variable( "strings", "subject_text" ) . " " . $headersInfo["Host"] );
90 $bodyText = $languageIni->variable( "strings", "body_text" );
91
92 $forgot = eZBulkMailForgot::getByEmail( $Email );
93 $forgot->store();
94
95 $mailconfirmation = new eZMail();
96 $mailconfirmation->setTo( $Email );
97 $mailconfirmation->setSubject( $subjectText );
98 $mailconfirmation->setFrom( $ini->variable( "eZBulkMailMain", "BulkmailSenderAddress" ) );
99 $mailconfirmation->setFromName( $ini->variable( "eZBulkMailMain", "BulkMailSenderName" ) );
100 $body = ( $bodyText . "\n");
101 $body .= ( "http://" . $headersInfo["Host"] . "/bulkmail/singlelistsubscribe/" . $forgot->Hash() );
102
103 $mailconfirmation->setBodyText( $body );
104 $mailconfirmation->send();
105
106 eZHTTPTool::header( "Location: /bulkmail/successfull/" );
107 exit();
108 }
109 else
110 {
111 // Not a valid email address
112 $subscriptionerror = "";
113 include( "kernel/ezbulkmail/user/usermessages.php" );
114 }
115 }
116
117 if( isset( $UnSubscribeButton ) )
118 {
119 $subscriptionaddress = new eZBulkMailSubscriptionAddress();
120 if( $subscriptionaddress->addressExists( $Email ) )
121 {
122 $headersInfo = getallheaders();
123 $subjectText = ( $languageIni->variable( "strings", "subject_text_unsubscribe" ) . " " . $headersInfo["Host"] );
124 $bodyText = $languageIni->variable( "strings", "body_text_unsubscribe" );
125
126 $forgot = new eZBulkMailForgot();
127 $forgot->get( $Email );
128 $forgot->setMail( $Email );
129 $forgot->store();
130
131 $mailconfirmation = new eZMail();
132 $mailconfirmation->setTo( $Email );
133 $mailconfirmation->setSubject( $subjectText );
134 $mailconfirmation->setFrom( $ini->variable( "eZBulkMailMain", "BulkmailSenderAddress" ) );
135 $mailconfirmation->setFromName( $ini->variable( "eZBulkMailMain", "BulkMailSenderName" ) );
136
137 $body = ( $bodyText . "\n");
138 $body .= ( "http://" . $headersInfo["Host"] . "/bulkmail/singlelistunsubscribe/" . $forgot->Hash() );
139
140 $mailconfirmation->setBodyText( $body );
141 $mailconfirmation->send();
142
143 $unsubscribemail = "";
144 include( "kernel/ezbulkmail/user/usermessages.php" );
145 }
146 else
147 {
148 $subscriptionerror = "";
149 include( "kernel/ezbulkmail/user/usermessages.php" );
150
151 }
152 }
153
154 ?>
$Email
$Email
Definition: admin/useredit.php:414
eZBulkMailForgot
Definition: ezbulkmailforgot.php:57
eZBulkMailForgot\getByEmail
static getByEmail( $email)
Definition: ezbulkmailforgot.php:168
eZBulkMailSubscriptionAddress
Definition: ezbulkmailsubscriptionaddress.php:40
eZBulkMailSubscriptionAddress\addressExists
addressExists( $email)
Definition: ezbulkmailsubscriptionaddress.php:183
eZBulkMailSubscriptionAddress\getByEmail
getByEmail( $email)
Definition: ezbulkmailsubscriptionaddress.php:150
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZINI
Reads and writes .ini style configuration files.
eZMail
Definition: ezmail.php:57
exit
exit
Definition: folder.php:81
$headersInfo
$headersInfo
Definition: forgot.php:32
$indexFile
$indexFile
Definition: singlelist.php:34
$wwwDir
$wwwDir
Definition: singlelist.php:33
$category
$category
Definition: singlelist.php:38
$languageIni
$languageIni
Definition: singlelist.php:37
$Language
$Language
Definition: singlelist.php:36
$ini
$ini
Definition: singlelist.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.